- REST architecture ✔️
- Authentication and permissions ✔️
- Data modeling and migrations ✔️
- SQL database ✔️
- Query optimization ✔️
- Serialization ✔️
- Production builds ✔️
- Rate Limit ✔️
- Request Data validation with Joi ✔️
- Unit Tests with Jest ✔️
Run our app locally with sqlite database First, we need to install all depedencies:
yarn install or npm install
Once all dependencies are installed we now can run our application.
The fastest way of run our app is using a sqlite database. First, we need to make a copy of .env.sqlite.local
and save as .env
cp .env.sqlite.local .env
Then we need to create our tables and add initial data:
Generate tables in database:
yarn run migrate:dev
Load fake data in database:
yarn run seed:dev
Now, just execute:
yarn start:dev
Our app is going to be running using port 5000.
Make a copy of .env.docker.development
and save as .env
.
cp docker/.env.docker.development .env
Install dependencies and run the application locally.
docker-compose -f docker/docker-compose.dev.yml up -d db
Then we need to create our tables and add initial data:
Generate tables in database:
yarn run migrate:dev
Load fake data in database:
yarn run seed:dev
Now, just execute:
yarn start:dev
Our app is going to be running using port 5000.
Make a copy of .env.docker.development
and save as .env
.
cp docker/.env.docker.development .env
Install dependencies and run the application locally.
docker-compose -f docker/docker-compose.dev.yml up -d
it's really simple to test the aplpication see the results. You just need to run:
yarn test
Make a copy of .env.docker.production
and save as .env
.
cp docker/.env.docker.production .env
TO run the app in prod you just need to run:
docker-compose -f docker/docker-compose.prod.yml up -d
After that, please run the following commands to create the database and run seeds:
docker exec -it api-prod yarn run migrate:prod
docker exec -it api-prod yarn run seed:prod