{"id":24895329,"url":"https://github.com/xam1dullo/nestjs-backend-project","last_synced_at":"2026-05-11T06:03:18.958Z","repository":{"id":196756965,"uuid":"697065067","full_name":"xam1dullo/nestjs-backend-project","owner":"xam1dullo","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-02T16:12:24.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T19:17:40.259Z","etag":null,"topics":["nest-backend","nestjs","postgresql","prisma","sql","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xam1dullo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-27T01:34:50.000Z","updated_at":"2023-10-02T15:56:42.000Z","dependencies_parsed_at":"2023-09-27T11:31:16.571Z","dependency_job_id":null,"html_url":"https://github.com/xam1dullo/nestjs-backend-project","commit_stats":null,"previous_names":["xam1dullo/nestjs-backend-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xam1dullo%2Fnestjs-backend-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xam1dullo%2Fnestjs-backend-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xam1dullo%2Fnestjs-backend-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xam1dullo%2Fnestjs-backend-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xam1dullo","download_url":"https://codeload.github.com/xam1dullo/nestjs-backend-project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245869906,"owners_count":20685938,"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":["nest-backend","nestjs","postgresql","prisma","sql","typescript"],"created_at":"2025-02-01T19:17:43.983Z","updated_at":"2026-05-11T06:03:18.883Z","avatar_url":"https://github.com/xam1dullo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instructions\n\nStarter template for 😻 [NestJS](https://nestjs.com/) and [Prisma](https://www.prisma.io/).\n\nsimple run\n\n```MakeFile\nmake all\n```\n\n[Postman Documentation](https://identity.getpostman.com/handover/multifactor?user=15905030\u0026handover_token=8729f4ba-7962-4459-ab12-18c1757f2ea7)\n\n[Postman Nest-backend REST-API](https://speeding-capsule-68866.postman.co/workspace/Team-Workspace~d19af575-99c6-4b6d-8ef9-186657f492b9/collection/15905030-c9c5840a-e11c-415c-962e-38be4a4ca93a?action=share\u0026creator=15905030\u0026active-environment=15905030-e9a53d1d-dfb3-41bd-beca-8bf6615894b1)\n\n[Postman Nest-backend Websocket](https://speeding-capsule-68866.postman.co/workspace/Team-Workspace~d19af575-99c6-4b6d-8ef9-186657f492b9/collection/6512c25b97fc8e4d2f995eca?action=share\u0026creator=15905030\u0026active-environment=15905030-e9a53d1d-dfb3-41bd-beca-8bf6615894b1)\n\n### 1. Install Dependencies\n\nInstall [Nestjs CLI](https://docs.nestjs.com/cli/usages) to start and [generate CRUD resources](https://trilon.io/blog/introducing-cli-generators-crud-api-in-1-minute)\n\nInstall the dependencies for the Nest application:\n\n```bash\n# npm\nnpm install\n# yarn\nyarn install\n# pnpm\npnpm install\n```\n\n### 2. PostgreSQL with Docker\n\nSetup a development PostgreSQL with Docker. Copy [.env.example](./.env.example) and rename to `.env` - `cp .env.example .env` - which sets the required environments for PostgreSQL such as `POSTGRES_USER`, `POSTGRES_PASSWORD` and `POSTGRES_DB`. Update the variables as you wish and select a strong password.\n\nStart the PostgreSQL database\n\n```bash\nmake postgres\n```\n```bash\nmake redis\n```\n\n### 3. Prisma Migrate\n\n[Prisma Migrate](https://github.com/prisma/prisma2/tree/master/docs/prisma-migrate) is used to manage the schema and migration of the database. Prisma datasource requires an environment variable `DATABASE_URL` for the connection to the PostgreSQL database. Prisma reads the `DATABASE_URL` from the root [.env](./.env) file.\n\nUse Prisma Migrate in your [development environment](https://www.prisma.io/blog/prisma-migrate-preview-b5eno5g08d0b#evolving-the-schema-in-development) to\n\n1. Creates `migration.sql` file\n2. Updates Database Schema\n3. Generates Prisma Client\n\n```bash\nmake prisma-int\n```\n\n### 4. Prisma: Prisma Studio\n\n```bash\nnpx prisma studio\n# or npm/yarn/pnpm\nmake prisma-studio\n```\n\n### 5. Seed the database data with this script\n\nExecute the script with this command:\n\n```bash\n#  npm/yarn/pnpm\npnpm run seed\n```\n\n### 6. Start NestJS Server\n\nRun Nest Server in Development mode:\n\n```bash\n#  npm/yarn/pnpm\npnpm run start\n\n# watch mode\npnpm run start:dev\n```\n\nRun Nest Server in Production mode:\n\n```bash\npnpm run start:prod\n```\n\nPrisma Studio for the NestJS Server is available here: http://localhost:5555/\n\n**[⬆ back to top](#overview)**\n\n## Rest Api\n\n[RESTful API](http://localhost:3000/api) documentation available with Swagger.\n\n## Docker\n\nNest server is a Node.js application and it is easily [dockerized](https://nodejs.org/de/docs/guides/nodejs-docker-webapp/).\n\nSee the [Dockerfile](./Dockerfile) on how to build a Docker image of your Nest server.\n\nNow to build a Docker image of your own Nest server simply run:\n\n```bash\n# give your docker image a name\ndocker build -t \u003cyour username\u003e/nest-prisma-server .\n# for example\ndocker build -t nest-prisma-server .\n```\n\nAfter Docker build your docker image you are ready to start up a docker container running the nest server:\n\n```bash\ndocker run -d -t -p 3000:3000 --env-file .env nest-prisma-server\n```\n\nNow open up [localhost:3000](http://localhost:3000) to verify that your nest server is running.\n\nWhen you run your NestJS application in a Docker container update your [.env](.env) file\n\n```diff\n- DB_HOST=localhost\n# replace with name of the database container\n+ DB_HOST=postgres\n\n# Prisma database connection\n+ DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}?schema=${DB_SCHEMA}\u0026sslmode=prefer\n```\n\nIf `DATABASE_URL` is missing in the root `.env` file, which is loaded into the Docker container, the NestJS application will exit with the following error:\n\n```bash\n(node:19) UnhandledPromiseRejectionWarning: Error: error: Environment variable not found: DATABASE_URL.\n  --\u003e  schema.prisma:3\n   |\n 2 |   provider = \"postgresql\"\n 3 |   url      = env(\"DATABASE_URL\")\n```\n\n### Docker Compose\n\nYou can also setup a the database and Nest application with the docker-compose\n\n```bash\n# building new NestJS docker image\ndocker-compose build\n# or\npnpm run docker:build\n\n# start docker-compose\ndocker-compose up -d\n# or\npnpm run docker\n```\n\n## Schema Development\n\nUpdate the Prisma schema `prisma/schema.prisma` and after that run the following two commands:\n\n```bash\nnpx prisma generate\n# or in watch mode\nnpx prisma generate --watch\n# or\npnpm run prisma:generate\npnpm run prisma:generate:watch\n```\n\n**[⬆ back to top](#overview)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxam1dullo%2Fnestjs-backend-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxam1dullo%2Fnestjs-backend-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxam1dullo%2Fnestjs-backend-project/lists"}