{"id":13764687,"url":"https://github.com/ahmetuysal/nest-hackathon-starter","last_synced_at":"2025-10-13T06:44:15.364Z","repository":{"id":37540152,"uuid":"205373050","full_name":"ahmetuysal/nest-hackathon-starter","owner":"ahmetuysal","description":"Hackathon starter project for NestJS. Includes Prisma, email verification, Passport-JWT authentication, Swagger and more","archived":false,"fork":false,"pushed_at":"2023-03-08T01:52:16.000Z","size":1884,"stargazers_count":420,"open_issues_count":2,"forks_count":53,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T15:08:39.129Z","etag":null,"topics":["boilerplate","hackathons","jwt-authentication","mail-verification","nest","nestjs","nodemailer","prisma","swagger","typescript"],"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/ahmetuysal.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}},"created_at":"2019-08-30T11:56:17.000Z","updated_at":"2025-03-17T05:00:38.000Z","dependencies_parsed_at":"2024-01-07T18:07:03.344Z","dependency_job_id":"29fb5006-c651-4487-a345-5274d689f542","html_url":"https://github.com/ahmetuysal/nest-hackathon-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetuysal%2Fnest-hackathon-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetuysal%2Fnest-hackathon-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetuysal%2Fnest-hackathon-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetuysal%2Fnest-hackathon-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetuysal","download_url":"https://codeload.github.com/ahmetuysal/nest-hackathon-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"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":["boilerplate","hackathons","jwt-authentication","mail-verification","nest","nestjs","nodemailer","prisma","swagger","typescript"],"created_at":"2024-08-03T16:00:25.883Z","updated_at":"2025-10-13T06:44:10.340Z","avatar_url":"https://github.com/ahmetuysal.png","language":"TypeScript","funding_links":[],"categories":["Resources"],"sub_categories":[],"readme":"# Nest Hackathon Starter \u003ca href=\"https://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" height=\"28px\" alt=\"Nest Logo\"/\u003e\u003c/a\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\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. **JWT Authentication**\n\n3. **Mail Verification**\n\n4. **Mail Change**\n\n5. **Password Reset**\n\n6. **Request Validation**\n\n7. **Customizable Mail Templates**\n\n8. **Swagger API Documentation**\n\n9. **Security Techniques**\n\n10. **Logger**\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## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ahmetuysal\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26417668?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAhmet Uysal\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ahmetuysal/nest-hackathon-starter/commits?author=ahmetuysal\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/ahmetuysal/nest-hackathon-starter/commits?author=ahmetuysal\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/ahmetuysal/nest-hackathon-starter/commits?author=ahmetuysal\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://dnlytras.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4951004?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDimitrios Lytras\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ahmetuysal/nest-hackathon-starter/commits?author=dimitrisnl\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\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%2Fahmetuysal%2Fnest-hackathon-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetuysal%2Fnest-hackathon-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetuysal%2Fnest-hackathon-starter/lists"}