Skip to main content

Introduction

Building a webapp often requires building a backend. Especially when persistent data and authentication mechanisms are planned. There are many options when building a backend. From architectural to specific technical ones. Because I wanted to expand my horizon and learn as much as possible about this whole project, I decided to get my hands dirty and build as much as I can from the ground up.

Overview

To host the website and the backend I chose DigitalOcean because of its cheap prices and high configurability. For the server I chose the Javascript framework ExpressJs which is build upon NodeJS. The server uses a PostgreSQL database to store application data. In front of the server, Nginx is used as a reverse proxy server and to serve some static content. The server itself runs within a Docker container.

Visit the source code here: https://github.com/Ratsch0k/group-car-api

Used software and libraries

As mentioned before, the software this project is build upon is ExpressJS, NodeJS, PostgreSQL, Nginx. But for many parts of the project I used additional libraries. The following section includes the most essential ones.

I use sequelize as an ORM, socket.io for WebSocket communication, nodemailer to send emails, bcrypt for handling user passwords, canvas for generating profile pictures, and express-validator to validate and sanitize user data. For testing, I use sinon.js, chai, mocha and supertest.

The project itself is written in TypeScript and code quality is ensured with ESLint and CodeFactor.