- Docker
- Node.js v12.0 or above - https://nodejs.org/
- Nodemon package installed globally
npm i -g nodemon
The project is based on a Docker container holding the MariaDB database, another for PHPMyAdmin. The core of the project is running on NodeJS using Express framework (https://expressjs.com/).
Command | Description |
---|---|
npm run api |
Regenerate the documentation |
npm run docker:build |
Build the Docker containers |
npm run docker:start |
Create & start the Docker containers |
npm run docker:stop |
Stop & remove the Docker containers |
npm run start |
Start the NodeJS server |
npm run migrate |
Migrate pending migrations under /migrations |
npm run seed |
Run seeds under /seeders |
npm run migrate:seed |
Run migrations & seeds |
npm run migrate:reset |
Revert all migrations |
npm run test |
Run all tests under /tests |
Once Docker containers & the NodeJS server are running, these URLs become available:
URL | Description |
---|---|
http://localhost:1234 | PHPMyAdmin |
http://localhost:3000 | NodeJS Server |
http://localhost:3000/docs | API Documentation |
We use Gitflow as our Git workflow. More explanation here.
- We use Prettier (https://prettier.io/) as code formatting tool. The configuration is written in
.prettierrc
at the root of the project. You must NOT edit this file. - We use 2 (two) spaces for indentation.
- We use camelCase for
variables
,properties
,functions
andmethods
. - We use PascalCase for
classes
.
- We use apiDoc (https://apidocjs.com/) for functions documentation.
Before pushing code, please make sure to :
- Include unit tests to test every function you've added.
- Add comments, and regenerate the documentation :
npm run api
. - Clean and refactor code.