A simple template to get started with Nest which just meets my need. Feel free to fork and open a pull request if you would like to put something into in.
This boilerplate aims to bring a simple nest application setup with all the support which a developer aims to get in an application to start. Please do note that this is just a reflection of how I like to have my application with all the utils and other things, If you know, you know.
I am not aiming yet to bring the test feature into this application since it varies in many cases, and you should write your test as per yourself. It's something important but yeah not yet on my To-Do. Sooner or later, it will be there anyway.
npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# using docker
$ docker-compose up
# production mode
$ npm run start:prod
- Make
docker-compose.yml
file. - Add the following contents into it -
version: '3.9'
services:
api:
image: ghcr.io/r-priyam/nestjs-boilerplate:latest
container_name: My-Cute-API
env_file:
- .env
- Make
.env
file in same directory wheredocker-compose.yml
file is. Sample env file can be found here - All set, run
docker-compose up
fromCLI
and application will start up.
- Please note, by default docker will assign your current directory name to project name while running
docker-compose up
command. To provide a name for your prject addCOMPOSE_PROJECT_NAME=Your-Project-Name
variable in.env
file. Read more aboutcompose enviroments
here.
- Fork the repo!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D