{"id":18952749,"url":"https://github.com/m7moudgadallah/expressjs-prisma-postgres-demo","last_synced_at":"2026-04-09T12:49:30.750Z","repository":{"id":196902989,"uuid":"697426012","full_name":"m7moudGadallah/expressjs-prisma-postgres-demo","owner":"m7moudGadallah","description":"This is a personal practice project for experimenting with Prisma, Express.js, and PostgreSQL.","archived":false,"fork":false,"pushed_at":"2023-09-27T23:36:25.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T02:41:45.077Z","etag":null,"topics":["expressjs","jest","nodejs","postgresql","prisma-orm","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/m7moudGadallah.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-27T17:49:49.000Z","updated_at":"2023-09-27T18:35:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"243f20d4-3ba6-4202-ba42-a0fa0821337d","html_url":"https://github.com/m7moudGadallah/expressjs-prisma-postgres-demo","commit_stats":null,"previous_names":["m7moudgadallah/expressjs-prisma-postgres-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpressjs-prisma-postgres-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpressjs-prisma-postgres-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpressjs-prisma-postgres-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpressjs-prisma-postgres-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7moudGadallah","download_url":"https://codeload.github.com/m7moudGadallah/expressjs-prisma-postgres-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"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":["expressjs","jest","nodejs","postgresql","prisma-orm","unit-testing"],"created_at":"2024-11-08T13:34:30.138Z","updated_at":"2025-12-30T22:58:03.940Z","avatar_url":"https://github.com/m7moudGadallah.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express.js, Prisma, and PostgreSQL Demo\n\nThis is a personal practice project for experimenting with Prisma, Express.js, and PostgreSQL.\n\n## Table of content\n\n\u003c!-- TOC --\u003e\n\n- [Express.js, Prisma, and PostgreSQL Demo](#expressjs-prisma-and-postgresql-demo)\n  - [Table of content](#table-of-content)\n  - [Getting Started](#getting-started)\n    - [Clone the repository](#clone-the-repository)\n    - [Install dependencies](#install-dependencies)\n    - [Set up your PostgreSQL database](#set-up-your-postgresql-database)\n    - [Update the database credentials](#update-the-database-credentials)\n    - [Migrate and seed the database](#migrate-and-seed-the-database)\n    - [Start the Server](#start-the-server)\n    - [Testing](#testing)\n  - [Usage](#usage)\n\n\u003c!-- /TOC --\u003e\n\n## Getting Started\n\n### Clone the repository\n\n```bash\n  git clone \u003crepository-url\u003e\n  cd expressjs-prisma-postgres-demo\n```\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Install dependencies\n\n```bash\n  npm install\n```\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Set up your PostgreSQL database\n\n- Open psql shell and connect postgres database on your local machine\n\n```bash\npsql -h localhost -p 5432 -U postgres postgres\n```\n\n- Create database using psql\n\n```sql\nCREATE DATABASE your-db-name;\n\n```\n\n- Create a new user with a password on you postgresql server and give it rule as superuser\n\n```sql\nCREATE USER your-db-user WITH PASSWORD your-password SUPERUSER;\n```\n\n- Exit the `psql` shell\n\n```psql\n\\q\n```\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Update the database credentials\n\n- In src/config/.env, provide the necessary database credentials:\n\n  ```env\n  DATABASE_URL=postgresql://\u003cusername\u003e:\u003cpassword\u003e@localhost:5432/\u003cDB\u003e\n  DATABASE_DEV=db_name\n  DATABASE_PROD=db_name\n  DATABASE_TEST=db_name\n  DATABASE_USERNAME=user_name\n  DATABASE_PASSWORD=password\n  ```\n\n- In `prisma/.env``, make sure the database URL matches your PostgreSQL database configuration:\n\n  ```env\n  # db_url like that 'postgresql://mo:test123@localhost:5432/prisma_demo'\n  DATABASE_URL=db_url\n  DATABASE_URL_TEST=db_url\n  ```\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Migrate and seed the database\n\n```bash\n  npx prisma migrate dev\n```\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Start the Server\n\n- **_Development Mode_**: Run npm run `start:dev` to start the server with nodemon for automatic reloading during development.\n- **_Production Mode_**: Run npm run `start:prod` to start the server in production mode.\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n### Testing\n\n- Run tests using Jest:\n  - `npm test`: Run tests in the testing environment.\n  - `npm run test:coverage`: Run tests with code coverage report.\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n## Usage\n\n- Use your preferred API client (e.g., Postman, curl) to interact with the API.\n- Alternatively, you can use the [REST Client extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) in Visual Studio Code to test the API directly from the provided `rest.http` file. The `rest.http` file contains URLs to all endpoints, making it convenient to make requests and test your API.\n\n\u003e The npm test command will not only start the server but also run Jest for testing purposes.\n\n**[\u0026uarr; Top](#expressjs-prisma-and-postgresql-demo)**\n\n**_Enjoy the demo!_**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7moudgadallah%2Fexpressjs-prisma-postgres-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7moudgadallah%2Fexpressjs-prisma-postgres-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7moudgadallah%2Fexpressjs-prisma-postgres-demo/lists"}