NodeJS simple REST API boilerplate using expressJS
Multipurpose ExpressJS boilerplate for building fast & robust application. The idea of this boilerplate is to build an expressJS REST API as a base that ideal for any purpose such as payment, storage, etc. For data handling and ORM, I'm using prisma, so you can use postgresql, mysql, sqlite, sqlserver, mongodb, cockroachdb. For more info kindly check prisma documentation
project - ROOT
├── config - Application config
│ └── config.js - global application config to run the server
├── db - Database related files & folder
│ ├── main - Main application database folder
│ │ ├── schema.prisma - application schema & model
│ │ ├── seeders - database seeders
│ │ └── migrations - database migration
│ └── db.js - Connection to prisma client
├── services - API Connection
└── src - Main application logic
├── routes - Application routes
│ ├── v1 - API Version
│ │ ├── handlers - Application logic
│ │ ├── middlewares - Middlewares function
│ │ ├── helpers - helpers function
│ │ ├── index.js - Express routes
│ │ └── validation.js - validation
│ └──index.js - Version import
└── index.js - server
Below is an example of how you can instruct your audience on installing and setting up your app.
-
Clone the repo
git clone https://github.com/orandong/express-boilerplate.git
-
Install NPM packages
npm install
-
Copy
.env.example
to.env
and fill in the missing values. -
Run prisma migration
npx prisma migrate dev --name init
-
Run prisma seeder (optional)
npx prisma db seed
-
Run the server
npm run dev
I assume you already have docker installed on your machine.
-
Clone the repo
git clone https://github.com/orandong/express-boilerplate.git
-
Build docker image
docker build -t express-boilerplate:latest .
-
Run docker container
docker run -d -p 5000:5000 --name=docker-express docker-express:latest
This tables shows which features that has been implemented by this boilerplate.
✅ : ready
❗ : in progress
❌ : not yet
Features | Provider | Status |
---|---|---|
Cloud Storage | Google Cloud | ❌ |
S3 Bucket | Amazon | ❌ |