{"id":13495999,"url":"https://github.com/monstar-lab-oss/nestjs-starter-rest-api","last_synced_at":"2025-04-07T10:19:24.655Z","repository":{"id":37224618,"uuid":"281077067","full_name":"monstar-lab-oss/nestjs-starter-rest-api","owner":"monstar-lab-oss","description":"NestJS Starter Kit. Monolithic Backend. REST API.","archived":false,"fork":false,"pushed_at":"2024-09-23T23:23:54.000Z","size":2187,"stargazers_count":578,"open_issues_count":16,"forks_count":92,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T09:03:14.199Z","etag":null,"topics":["backend","monolithic","nestjs","nodejs","rest-api","starter-kit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monstar-lab-oss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-20T09:46:28.000Z","updated_at":"2025-03-29T16:36:57.000Z","dependencies_parsed_at":"2023-02-18T12:03:47.774Z","dependency_job_id":"86f37f64-b268-4e04-aae0-75f7cda1ff51","html_url":"https://github.com/monstar-lab-oss/nestjs-starter-rest-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monstar-lab-oss%2Fnestjs-starter-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monstar-lab-oss%2Fnestjs-starter-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monstar-lab-oss%2Fnestjs-starter-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monstar-lab-oss%2Fnestjs-starter-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monstar-lab-oss","download_url":"https://codeload.github.com/monstar-lab-oss/nestjs-starter-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631834,"owners_count":20970069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","monolithic","nestjs","nodejs","rest-api","starter-kit"],"created_at":"2024-07-31T19:01:40.556Z","updated_at":"2025-04-07T10:19:24.629Z","avatar_url":"https://github.com/monstar-lab-oss.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Resources"],"sub_categories":[],"readme":"## NestJS Starter Kit [v2]\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![build](https://github.com/monstar-lab-oss/nestjs-starter-rest-api/actions/workflows/build-workflow.yml/badge.svg?branch=master\u0026event=push)](https://github.com/monstar-lab-oss/nestjs-starter-rest-api/actions/workflows/build-workflow.yml)\n[![tests](https://github.com/monstar-lab-oss/nestjs-starter-rest-api/actions/workflows/tests-workflow.yml/badge.svg?branch=master\u0026event=push)](https://github.com/monstar-lab-oss/nestjs-starter-rest-api/actions/workflows/tests-workflow.yml)\n\nThis starter kit has the following outline:\n\n- Monolithic Project\n- REST API\n\nThis is a Github Template Repository, so it can be easily [used as a starter template](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) for other repositories.\n\n## Sample implementations\n\nTo view sample implementations based on this starter kit, please visit the [nestjs-sample-solutions](https://github.com/monstar-lab-oss/nestjs-sample-solutions) repository.\n\n## Starter kit Features\n\nOne of our main principals has been to keep the starter kit as lightweight as possible. With that in mind, here are some of the features that we have added in this starter kit.\n\n| Feature                  | Info               | Progress |\n|--------------------------|--------------------|----------|\n| Authentication           | JWT                | Done     |\n| Authorization            | RBAC (Role based)  | Done     |\n| ORM Integration          | TypeORM            | Done     |\n| DB Migrations            | TypeORM            | Done     |\n| Logging                  | winston            | Done     |\n| Request Validation       | class-validator    | Done     |\n| Pagination               | SQL offset \u0026 limit | Done     |\n| Docker Ready             | Dockerfile         | Done     |\n| Devcontainer             | -                  | Done     |\n| Auto-generated OpenAPI   | -                  | Done     |\n| Auto-generated ChangeLog | -                  | WIP      |\n\nApart from these features above, our start-kit comes loaded with a bunch of minor awesomeness like prettier integration, commit-linting husky hooks, package import sorting, SonarCloud github actions, docker-compose for database dependencies, etc. :D\n\n## Consulting\n\nMost of the features added to this starter kit have already been tried out in production applications by us here at MonstarLab. Our production applications are more feature rich, and we constantly strive to bring those features to this OSS starter kit.\n\nIf you would like to use a more feature rich starter kit, with more awesome features from Day 1, then please reach out to us and we can collaborate on it together as technology partners. :)\n\n## Installation\n\nNote: when using docker, all the `npm` commands can also be performed using `./scripts/npm` (for example `./scripts/npm install`).\nThis script allows you to run the same commands inside the same environment and versions than the service, without relying on what is installed on the host.\n\n```bash\n$ npm install\n```\n\nCreate a `.env` file from the template `.env.template` file.\n\nGenerate public and private key pair for jwt authentication:\n\n### With docker\n\nRun this command:\n```bash\n./scripts/generate-jwt-keys\n```\n\nIt will output something like this. You only need to add it to your `.env` file.\n```\nTo setup the JWT keys, please add the following values to your .env file:\nJWT_PUBLIC_KEY_BASE64=\"(long base64 content)\"\nJWT_PRIVATE_KEY_BASE64=\"(long base64 content)\"\n```\n\n### Without docker\n\n```bash\n$ ssh-keygen -t rsa -b 2048 -m PEM -f jwtRS256.key\n# Don't add passphrase\n$ openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub\n```\n\nYou may save these key files in `./local` directory as it is ignored in git.\n\nEncode keys to base64:\n\n```bash\n$ base64 -i local/jwtRS256.key\n\n$ base64 -i local/jwtRS256.key.pub\n```\n\nMust enter the base64 of the key files in `.env`:\n\n```bash\nJWT_PUBLIC_KEY_BASE64=BASE64_OF_JWT_PUBLIC_KEY\nJWT_PRIVATE_KEY_BASE64=BASE64_OF_JWT_PRIVATE_KEY\n```\n\n## Running the app\n\nWe can run the project with or without docker.\n\n### Local\n\nTo run the server without Docker we need this pre-requisite:\n\n- Postgres server running\n\nCommands:\n\n```bash\n# development\n$ npm run start\n\n# watch mode\n$ npm run start:dev\n\n# production mode\n$ npm run start:prod\n```\n\n### Docker\n\n```bash\n# build image\n$ docker build -t my-app .\n\n# run container from image\n$ docker run -p 3000:3000 --volume 'pwd':/usr/src/app --network --env-file .env my-app\n\n# run using docker compose\n$ docker compose up\n```\n\nLearn more about Docker conventions [here](https://github.com/monstar-lab-group/nodejs-backend/blob/master/architecture/docker-ready.md). (WIP - Currently this is an internal org link.)\n\n## Test\n\n```bash\n# unit tests\n$ npm run test\n\n# e2e tests\n$ npm run test:e2e\n\n# test coverage\n$ npm run test:cov\n```\n\n## Migrations\n\n```bash\n# using docker\n$ docker compose exec app npm run migration:run\n\n# generate migration (replace CreateUsers with name of the migration)\n$ npm run migration:generate --name=CreateUsers\n\n# run migration\n$ npm run migration:run\n\n# revert migration\n$ npm run migration:revert\n```\n\n## Architecture\n\n- [Project Structure](./docs/project-structure.md)\n\n## Contributors\n\n- [Yash Murty](https://github.com/yashmurty)\n- [S M Asad Rahman](https://github.com/asad-mlbd)\n- [Tanveer Hassan](https://github.com/war1oc)\n- [Saad Bin Amjad](https://github.com/Saad-Amjad)\n- [Sivan Payyadakath](https://github.com/sivanpayyadakath)\n- [Sébastien Caparros](https://github.com/Seb-C)\n\n## External Links\n\n\u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo.svg\" width=\"150\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\n[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-white.svg)](https://sonarcloud.io/dashboard?id=monstar-lab-oss_nestjs-starter-rest-api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonstar-lab-oss%2Fnestjs-starter-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonstar-lab-oss%2Fnestjs-starter-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonstar-lab-oss%2Fnestjs-starter-rest-api/lists"}