The easiest way to get up and running is using Docker. Once the Docker CLI is installed from https://www.docker.com/get-docker.
Run: cp .env.sample .env
and add stripe API key.
Run: docker-compose up --build
If everything is good. Then you can access all the services,
- Can access api server via http://localhost:8001/api
Run
docker-compose run web npx sequelize model:create --name Test --attributes name:string
Swagger documentation available for each services.
- subscription - http://localhost:3000/api/docs
To run jest test cases inside docker, run the following command
docker-compose -f docker-compose.yml -f dct.yml up --build
- Instant feedback and reload
- Use Nodemon to automatically reload the server after a file change when on development mode, makes the development faster and easier.
- Scalable and easy to use web server
- Use Express for requests routing and middlewares. There are some essential middlewares for web APIs already setup, like body-parser, compression, CORS and method-override.
- Database integration
- Sequelize, an ORM for SQL databases, is already integrated, you just have to set the authentication configurations.
- Prepared for testing
- The test suite uses Jest and is prepared to run unit, integration and functional tests right from the beginning.
- CLI integration
- Both the application and Sequelize have command-line tools to make it easy to work with them. Check the Scripts section to know more about this feature.
- Logging
- The Log4js logger is highly pluggable, being able to append the messages to a file during the development and send them to a logging service when on production. Even the requests (through morgan) and queries will be logged.
- Linter
- It's also setup with ESLint to make it easy to ensure a code styling and find code smells.