{"id":18537403,"url":"https://github.com/vitaee/prismanodepostgre","last_synced_at":"2026-04-18T11:02:54.314Z","repository":{"id":130440970,"uuid":"421736990","full_name":"Vitaee/PrismaNodePostgre","owner":"Vitaee","description":"An example nodejs typescript project which using prisma orm  with postgresql databse.","archived":false,"fork":false,"pushed_at":"2023-07-29T09:09:47.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T07:22:55.214Z","etag":null,"topics":["nodejs","postgresql","prisma"],"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/Vitaee.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-27T08:29:19.000Z","updated_at":"2023-07-02T09:08:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed6748ec-1752-4b71-ab88-2f2189c8c246","html_url":"https://github.com/Vitaee/PrismaNodePostgre","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vitaee/PrismaNodePostgre","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vitaee%2FPrismaNodePostgre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vitaee%2FPrismaNodePostgre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vitaee%2FPrismaNodePostgre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vitaee%2FPrismaNodePostgre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vitaee","download_url":"https://codeload.github.com/Vitaee/PrismaNodePostgre/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vitaee%2FPrismaNodePostgre/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["nodejs","postgresql","prisma"],"created_at":"2024-11-06T19:38:05.506Z","updated_at":"2026-04-18T11:02:52.272Z","avatar_url":"https://github.com/Vitaee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prisma Nodejs PostgreSQL\n - In this repository you will see an example nodejs ( express js ) project which using prisma with postgresql database.\n - In this project we are saving \u0026 filtering json object.\n\n - Node version === v16.11.1\n\n### Setup\n- mkdir prisma-node\n- npm init -y\n- npm install prisma\n- npx prisma init\n- When you create your model etc. run this command to sync it with our db. ```npx prisma migrate dev```\n- Then install express ``` npm i express ```\n- Finally create file for main server file ``` index.js ```\n\n### Model\n\n- We have a model ( Job ) and we have 3 params. ``` id , boat , saved ```.\n\n        \"id\" SERIAL NOT NULL, CONSTRAINT, PRIMARY KEY \n        \"boat\" JSONB NOT NULL,\n        \"saved\" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP\n\n- Check schema.prisma to see **prismatic** version. \n\n\n### Example Data\n- The **boat** variable store this object. \n\n```\n{\n    \"id\": 8076018,\n    \"url\": \"https://www.yachtworld.com/yacht/1996-bavaria-44-holiday-8076018/\",\n    \"fuel\": \"diesel\",\n    \"make\": \"Bavaria\",\n    \"model\": \"44 Holiday\",\n    \"price\": 91971.37,\n    \"title\": \"1996 Bavaria 44 Holiday\",\n    \"engine\": \"Volvo Penta\",\n    \"images\": [\n        {\n            \"url\": \"https://images.boatsgroup.com/resize/1/60/18/8076018_20211020085804109_1_XLARGE.jpg\",\n            \"date\": {\n                \"created\": \"2021-10-20T15:58:04Z\",\n                \"modified\": \"2021-10-20T16:03:37Z\"\n            },\n            \"format\": \"jpg\"\n        },\n    ]\n}\n```\n\n\n### Routes \n\n- Check **routes** folder to see more information.\n- For now we have 1 route which is **/boat** and have 2 endpoints **/save** \u0026 **/:id**.\n- Example request;\n\n\n- ```localhost:3000/boat/save``` -\u003e accepts **POST** request and **request.body**\n\n- \u003ca id=\"example-data\" href=\"#example-data\" \u003ebody data should be.\u003c/a\u003e\n\n- ```localhost:3000/boat/1``` -\u003e accepts **GET** request and parameter **id** to find row by id.\n\n### Setup PostgreSQL via Docker\n\n- Firstly, run this command with your credentials; ```docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres```\n\n- If you don't have docker you can install it from [here](https://docs.docker.com/get-docker/).\n\n- Check your container via ``` docker ps ``` this will return a container ID (the first 12 characters from the hash), the image name (in this case, postgres), command, created, status, ports and the name of the container (some-postgres).\n\n- Then download the ( GUI tool ) [pgadmin4](https://www.pgadmin.org/download/).\n\n- Create server from pgadmin4 gui tool. In connection tab you should provide your ```IPAddress``` to connect our postgreSQL db. \n\n- ``` docker inspect some-postgres``` with this commend you will get output like this;\n\n```\n \"Networks\": {\n                \"bridge\": {\n                    \"IPAMConfig\": null,\n                    \"Links\": null,\n                    \"Aliases\": null,\n                    \"NetworkID\":\"\",\n                    \"EndpointID\": \"\",\n                    \"Gateway\": \"172.17.0.1\",\n                    \"IPAddress\": \"172.17.0.2\",\n                    \"IPPrefixLen\": 16,\n                    \"IPv6Gateway\": \"\",\n                    \"GlobalIPv6Address\": \"\",\n                    \"GlobalIPv6PrefixLen\": 0,\n                    \"MacAddress\": \"02:42:ac:11:00:02\",\n                    \"DriverOpts\": null\n                }\n            }\n```\n\n- Copy the ``` IPAddress ``` and in pgadmin4 enter Ip address to Host section. Finally enter your password and click save  ( check example [image](https://i.stack.imgur.com/K9NtY.png) ). Congracts you're connected to your db!\n\n- If you are using Linux / MacOS assume that you're writing ```sudo``` before ```docker``` commands.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitaee%2Fprismanodepostgre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitaee%2Fprismanodepostgre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitaee%2Fprismanodepostgre/lists"}