A Standard Boilerplate for Node Express REST API
- Language :
- Pacakges :
- Database :
- Utility :
mv .env.manual .env
npm install
bash migrate.sh
npm run dev
npm run build
npm run prod
Note: If you run manual installation, make sure postgre and redis server is running or that will be error
// Build and running docker container
docker-compose build
docker-compose up
// Stop all running container
docker-compose down
- 5000:5000 Express Rest API
- 5400:5432 PostgreSQL
- 6379:6379 Redis
- 8080:8080 Adminer
npm run test
// Run it in Bash terminal
bash migrate.sh
.
โโโ __test__ // Jest test file
โโโ database // Knex Module
โโโ dist // Automatically generate when you run production Installation
โโโ src
โ โโโ controllers
โ โ โโโ **.ts
โ โโโ helper
โ โ โโโ **.ts
โ โโโ models
โ โ โโโ **.ts
โ โโโ routes
โ โ โโโ **.ts
โ โโโ app.ts // Main
โ โโโ index.ts // Running Sever
โโโ .env
โโโ docker-compose.yml
โโโ Dockerfile
โโโ jest.config.js // Jest Configuration
โโโ knexfile.ts // Knex Configuration
โโโ migrate.sh // Shell migrate Database
โโโ redis.ts // Redis Configuration
โโโ swagger.json // Swagger Definition
โโโ ...
After you running development/production Installation you can see documentation at : http://localhost:5000/docs
