Starting point for any express api.
With docker
To start the API with everything configured just run:
docker-compose up -d
The API takes 30 seconds to start because it waits MySQL to be ready :)
Without docker
To start the API you need to install and run:
- Redis server (cache)
- MongoDB server (database)
- RabbitMQ (queue)
Then, configure the environment variables inside the .env and run:
npm start
- App server listening on port 3000
- Environment config using dotenv
- ESLint basic configuration (based on airbnb)
- Redis connection (no auth) as singleton
- Import/exports barrel pattern with CommonJS :)
- Docker setup
- Domain-driven design
- Basic authentication using JWT
- Standardized error handling for api calls
- Jest basic configuration
- Domain unit tests
- Logger with many logging levels using Winston (includes logger request middleware)
- Mail system through message queuing (Nodemailer + RabbitMQ)
- Nginx or Traefik configuration for the server
- Basic authorization with roles
- Integration tests
- Config per environment (I think that dotenv might be a cleaner and better solution)