{"id":36862437,"url":"https://github.com/adamjq/production-ready-serverless-nestjs","last_synced_at":"2026-01-12T14:51:08.043Z","repository":{"id":59357269,"uuid":"497732141","full_name":"adamjq/production-ready-serverless-nestjs","owner":"adamjq","description":"Backend starter template for a NestJS GraphQL API on AWS Lambda with security and performance best practices","archived":false,"fork":false,"pushed_at":"2025-12-31T16:46:19.000Z","size":377,"stargazers_count":40,"open_issues_count":12,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-05T01:57:19.204Z","etag":null,"topics":["aws","aws-lambda","graphql","nestjs","nodejs","postgresql","prisma","serverless","serverless-framework","supabase","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/adamjq.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-29T23:27:34.000Z","updated_at":"2025-11-19T07:59:03.000Z","dependencies_parsed_at":"2024-02-18T19:28:52.308Z","dependency_job_id":"fd267963-a0d6-4ce0-b70f-2334ecacfc64","html_url":"https://github.com/adamjq/production-ready-serverless-nestjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/adamjq/production-ready-serverless-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjq%2Fproduction-ready-serverless-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjq%2Fproduction-ready-serverless-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjq%2Fproduction-ready-serverless-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjq%2Fproduction-ready-serverless-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamjq","download_url":"https://codeload.github.com/adamjq/production-ready-serverless-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjq%2Fproduction-ready-serverless-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","aws-lambda","graphql","nestjs","nodejs","postgresql","prisma","serverless","serverless-framework","supabase","typescript"],"created_at":"2026-01-12T14:51:07.946Z","updated_at":"2026-01-12T14:51:08.026Z","avatar_url":"https://github.com/adamjq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Production Ready Serverless NestJS\n\nThis project contains a backend starter template for running NestJS GraphQL APIs on AWS Lambda with security and performance best practices.\n\n![NestJS](https://img.shields.io/badge/nestjs-%23E0234E.svg?style=for-the-badge\u0026logo=nestjs\u0026logoColor=white)\n![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white)\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=for-the-badge\u0026logo=amazon-aws\u0026logoColor=white)\n![Prisma](https://img.shields.io/badge/Prisma-3982CE?style=for-the-badge\u0026logo=Prisma\u0026logoColor=white)\n![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n\n## Features\n- GraphQL configuration (Code-first approach)\n- Prisma Database config with migrations\n- Docker database for local development\n- AWS Deployment with [Serverless Framework](https://www.serverless.com/)\n- AWS Lambda NodeJS 18x configuration and optimizations\n- GitHub actions for CI/CD\n\n### Not included\n- Authentication/Authorization\n\n## Technology Choices\n\n### NestJS\n- Opinionated, mature backend framework with active community\n- Supports dependency injection out of the box\n- First-class typescript support\n\n### GraphQL\n- Provides a query language that lets clients specify the data they need\n- Strong support in frontend frameworks like React\n\n### AWS Lambda\n- Pay-per-use pricing is ideal for early-stage startups where traffic and access patterns are unknown\n- Cold starts can be minimized by keeping package bundles small, caching server between invocations and keeping lambdas warm\n\n### Serverless framework\n- Strong community of plugins and supports for NodeJS/Typescript\n\n### Prisma\n- ORM with great developer experience\n- Excellent Typescript support\n\n### Supabase\n- Hosted serverless Postgres database\n\n## Dependencies\n\n- NodeJS\n- NVM `brew install nvm`\n- Yarn\n- Docker\n- VSCode\n- AWS Account\n\n## Setup\n\n### Local Development\n\n1. Create a `.env` file using [.env.example](./.env.example) as an example\n\n2. `nvm use`\n\n3. `yarn install`\n\n4. Launch Supabase in Docker with `npx supabase start`\n\n5. Run database migrations locally in a separate terminal if it's a first time setup with `npx prisma migrate dev`\n\n6. Seed the database with `npx prisma db seed`\n\n7. Start the NestJS server with `yarn start:dev`\n\n8. Call the endpoints in [requests.http](./requests.http) to test the API.\n\n### Integration tests\n\n```\nyarn test:e2e\n```\n\n### Webpack bundling\n\n```shell\nyarn build # with webpack\n\n# run binary locally\nnode dist/main.js\n```\n\n### Serverless Offline\n\nTest AWS Lambda packaging and run locally with:\n```\nnpx serverless offline\n```\n\n### AWS Deployment\n\n**Note** - create all AWS and Supabase resources in the `us-east-1` AWS region.\n\n1. Setup your AWS Credentials for deployments\n\n2. Create [a free-tier Supabase database](https://supabase.com/).\n\n3. Create an AWS SSM Parameter in the AWS console named `/dev/database/url` with the secure string type\nand save the DB connection string.\n\n    Confirm it exists with:\n    ```\n    aws ssm get-parameter --name /dev/database/url --with-decryption\n    ```\n\n4. Install dependencies:\n    ```\n    nvm use 18\n    yarn install\n    ```\n\n5. Deploy the app to AWS:\n    ```\n    npx serverless deploy\n    ```\n\nUpdate [requests.http](./requests.http) with the output of the deployment to call the API.\n\n## Database Migrations\n\n```\n# create migrations\nnpx prisma migrate dev --name \u003cMIGRATION_NAME\u003e\n\n# run migration\nnpx prisma migrate dev\n\n# reset development database\nnpx prisma migrate reset\n```\n\nNote - an ERD diagram for the database schema will be generated under `/docs` - [see diagram](./docs/README.md).\n\n### Production Database Migrations\n\nProduction database migrations should be run in a CI/CD pipeline but can also be run locally with:\n\n```\nnpx prisma migrate deploy\n```\n\nSee [the Prisma docs](https://www.prisma.io/docs/concepts/components/prisma-migrate/migrate-development-production#production-and-testing-environments) for more information.\n\n## Resources\n\n- [Serverless Framework](https://www.serverless.com/framework/docs)\n- [NestJS](https://docs.nestjs.com/)\n- [Prisma](https://www.prisma.io/docs/)\n- [Supabase](https://supabase.com/)\n- [GraphQL](https://graphql.org/)\n\n## Suggested SaaS integrations\n\n### Auth\n- [Auth0](https://auth0.com/)\n\n### Monitoring\n- [Lumigo](https://lumigo.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjq%2Fproduction-ready-serverless-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamjq%2Fproduction-ready-serverless-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjq%2Fproduction-ready-serverless-nestjs/lists"}