Skip to content

Latest commit

 

History

History
93 lines (69 loc) · 3.47 KB

README.md

File metadata and controls

93 lines (69 loc) · 3.47 KB

Node JS Bolierplate for Stripe Subscription

How to use

Docker

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 the following and add stripe API key.

cp .env.sample .env

To build and run application on docker

Run

bash start_dev.sh

To start docker container

docker-compose up

DB migrations

Run

 docker-compose run subscription npx sequelize model:create --name Test --attributes name:string

Swagger Documentation

Swagger documentation available for each services.

Features

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.

Tech