{"id":19180641,"url":"https://github.com/leizhenpeng/starter-nestjs","last_synced_at":"2026-04-15T05:32:32.671Z","repository":{"id":107543606,"uuid":"524664744","full_name":"Leizhenpeng/starter-nestjs","owner":"Leizhenpeng","description":"Starter template for NestJs library","archived":false,"fork":false,"pushed_at":"2022-12-14T09:19:52.000Z","size":302,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-20T01:29:12.285Z","etag":null,"topics":["jwt","nestjs","pino-logs","postgresql","prisma","redis","swagger"],"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/Leizhenpeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-08-14T12:27:28.000Z","updated_at":"2026-03-04T03:23:48.000Z","dependencies_parsed_at":"2023-06-08T11:30:57.540Z","dependency_job_id":null,"html_url":"https://github.com/Leizhenpeng/starter-nestjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Leizhenpeng/starter-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leizhenpeng%2Fstarter-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leizhenpeng%2Fstarter-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leizhenpeng%2Fstarter-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leizhenpeng%2Fstarter-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Leizhenpeng","download_url":"https://codeload.github.com/Leizhenpeng/starter-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leizhenpeng%2Fstarter-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["jwt","nestjs","pino-logs","postgresql","prisma","redis","swagger"],"created_at":"2024-11-09T10:50:29.248Z","updated_at":"2026-04-15T05:32:32.649Z","avatar_url":"https://github.com/Leizhenpeng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Starter-Nestjs  \u003ca href=\"https://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" height=\"22px\" alt=\"Nest Logo\"/\u003e\u003c/a\u003e\n\n\n\nThis project contains boilerplate for creating APIs using [Nest](https://nestjs.com), a progressive [Node.js](http://nodejs.org) framework for building efficient and scalable server-side applications.\n\nIt is mostly built to be used as a starting point in hackathons and implements common operations such as sign up, JWT authentication, mail validation, model validation and database access.\n\nYou can also look at my [Angular Hackathon Starter](https://github.com/ahmetuysal/angular-hackathon-starter) template that shares the same contract with this API.\n\n## Features\n\n1. **PostgreSQL with Prisma**\n\n2. **Pino Logger**\n\n3. **Redis**\n\n4. **socket-io**\n\n5. **Request Validation**\n   \n6. **JWT Authentication**\n   \n7. **Swagger API Documentation**\n   \n8. **LOGIN Module**\n   \n9.  **Email Module**\n\n\n\n\n\n## Getting Started\n\n### Installation\n\n1. Make sure that you have [Node.js](https://nodejs.org)(\u003e= 10.13.0, except for v13) installed.\n2. Clone this repository by running `git clone https://github.com/ahmetuysal/nest-hackathon-starter.git \u003cYOUR_PROJECT_NAME\u003e` or [directly create your own GitHub repository using this template](https://github.com/ahmetuysal/nest-hackathon-starter/generate).\n3. Move to the appropriate directory: `cd \u003cYOUR_PROJECT_NAME\u003e`.\n4. Run `yarn` to install dependencies.\n\n### Configuration Files\n\n#### [Prisma](https://github.com/prisma/prisma) Configurations\n\nThis template uses Postgres by default. If you want to use another database, follow instructions in the [official Nest recipe on Prisma](https://docs.nestjs.com/recipes/prisma).\n\nIf you wish to use another database you will also have to edit the connection string on [`prisma/.env`](prisma/.env) file accordingly.\n\nTemplate includes three different environment options by default. Most of the time you will use the `local`\nenvironment when developing and `production` environment on production. You will need to fill out corresponding\nenvironment files in [`env`](env) directory.\n\n```dosini\nDATABASE_HOST=__YOUR_DATABASE_URL__\nDATABASE_PORT=5432\nDATABASE_USERNAME=__YOUR_USERNAME__\nDATABASE_PASSWORD=__YOUR_PASSWORD__\nDATABASE_NAME=__YOUR_DATABASE__\n```\n\n#### JWT Configurations\n\nA secret key is needed in encryption process. Generate a secret key using a service like [randomkeygen](https://randomkeygen.com/).\n\nEnter your secret key to [`config.ts`](src/config.ts) file. You can also the change expiration time, default is 86400 seconds(1 day).\n\n```js\n  jwt: {\n    secretOrKey: '__JWT_SECRET_KEY__',\n    expiresIn: 86400,\n  },\n```\n\n#### [NodeMailer✉️](https://github.com/nodemailer/nodemailer) Configurations\n\nA delivery provider is required for sending mails with Nodemailer. I mostly use [SendGrid](https://sendgrid.com) to send mails, however, Nodemailer can work with any service with SMTP transport.\n\nTo get a SendGrid API key:\n\n- Create a free account from [https://signup.sendgrid.com/](https://signup.sendgrid.com/)\n- Confirm your account via the activation email and login.\n- Create an API Key with mail sending capability.\n\nEnter your API key and sender credentials to [`config.ts`](src/config.ts) file. Sender credentials are the sender name and sender mail that will be seen by your users.\n\n```js\nmail:\n    service: {\n      host: 'smtp.sendgrid.net',\n      port: 587,\n      secure: false,\n      user: 'apikey',\n      pass: '__SENDGRID_API_KEY__',\n    },\n    senderCredentials: {\n      name: '__SENDER_NAME__',\n      email: '__SENDER_EMAIL__',\n    },\n  },\n```\n\n#### Mail Template Configurations\n\nMail templates are highly customizable and heavily depend on configurations. Enter your project's information to [`config.ts`](src/config.ts). Urls are used as references in the templates. If your mail verification logic is independent from your front-end application, you can use API's own mail verification endpoint, e.g. `http://localhost:3000/auth/verify`, as `mailVerificationUrl`. Otherwise, send a HTTP `GET` request to verification endpoint with token added as a parameter named token, e.g, `http://localhost:3000/auth/verify?token=__VERIFICATION_TOKEN__`\n\n```js\n project: {\n    name: '__YOUR_PROJECT_NAME__',\n    address: '__YOUR_PROJECT_ADDRESS__',\n    logoUrl: 'https://__YOUR_PROJECT_LOGO_URL__',\n    slogan: 'Made with ❤️ in Istanbul',\n    color: '#123456',\n    // You can enter as many social links as you want\n    socials: [\n      ['GitHub', '__Project_GitHub_URL__'],\n      ['__Social_Media_1__', '__Social_Media_1_URL__'],\n      ['__Social_Media_2__', '__Social_Media_2_URL__'],\n    ],\n    url: 'http://localhost:4200',\n    mailVerificationUrl: 'http://localhost:3000/auth/verify',\n    mailChangeUrl: 'http://localhost:3000/auth/change-email',\n    resetPasswordUrl: 'http://localhost:4200/reset-password',\n    termsOfServiceUrl: 'http://localhost:4200/legal/terms',\n  },\n```\n\n### Migrations\n\nPlease refer to the official [Prisma Migrate Guide](https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate) to get more info about Prisma migrations.\n\n```bash\n# generate migration for local environment\n$ yarn migrate:dev:create\n# run migrations in local environment\n$ yarn migrate:dev\n\n# deploy migration to prod environment\n$ yarn migrate:deploy:prod\n```\n\n### Running the app\n\n```bash\n# development mode\n$ yarn start:dev\n\n# production\n$ yarn build\n$ yarn start:prod\n```\n\n### Running the tests\n\n```bash\n# unit tests\n$ yarn test\n\n# e2e tests\n$ yarn test:e2e\n\n# test coverage\n$ yarn test:cov\n```\n\n\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Support Nest\n\nNest is an MIT-licensed open source project. If you'd like to join support Nest, please [read more here](https://docs.nestjs.com/support).\n\n## License\n\nLicenced under [MIT License](LICENSE). Nest is also MIT licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleizhenpeng%2Fstarter-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleizhenpeng%2Fstarter-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleizhenpeng%2Fstarter-nestjs/lists"}