{"id":29016381,"url":"https://github.com/waliaharsh74/docker-practice","last_synced_at":"2026-04-06T01:35:09.581Z","repository":{"id":301232082,"uuid":"1008592876","full_name":"waliaharsh74/docker-practice","owner":"waliaharsh74","description":"This project demonstrates a simple Node.js backend written in TypeScript. It exposes a few REST endpoints that use both MongoDB (via Mongoose) and PostgreSQL(via Prisma).","archived":false,"fork":false,"pushed_at":"2025-06-25T19:53:43.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T20:34:57.953Z","etag":null,"topics":["docker","docker-compose","express","mongodb","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/waliaharsh74.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,"zenodo":null}},"created_at":"2025-06-25T19:36:08.000Z","updated_at":"2025-06-25T19:57:19.000Z","dependencies_parsed_at":"2025-06-25T20:45:13.379Z","dependency_job_id":null,"html_url":"https://github.com/waliaharsh74/docker-practice","commit_stats":null,"previous_names":["waliaharsh74/docker-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/waliaharsh74/docker-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliaharsh74%2Fdocker-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliaharsh74%2Fdocker-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliaharsh74%2Fdocker-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliaharsh74%2Fdocker-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waliaharsh74","download_url":"https://codeload.github.com/waliaharsh74/docker-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliaharsh74%2Fdocker-practice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31456662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"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":["docker","docker-compose","express","mongodb","nodejs","postgresql","prisma"],"created_at":"2025-06-25T22:08:11.670Z","updated_at":"2026-04-06T01:35:09.559Z","avatar_url":"https://github.com/waliaharsh74.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Practice Backend\n\nThis project demonstrates a simple **Node.js** backend written in TypeScript. It exposes a few REST endpoints that use both **MongoDB** (via Mongoose) and **PostgreSQL** (via Prisma).\n\nThe repository includes a `Dockerfile` and a `docker-compose.yaml` to run the service together with MongoDB and PostgreSQL containers. It can also be executed directly with Node locally.\n\n## Features\n\n- Express based API server\n- MongoDB integration using Mongoose\n- PostgreSQL integration using Prisma ORM\n- Dockerfile for containerisation\n- Docker Compose configuration for local development with MongoDB and PostgreSQL\n\n## Endpoints\n\n| Method | Endpoint           | Description                                  |\n|-------|-------------------|----------------------------------------------|\n| `GET` | `/`               | Health check route                           |\n| `GET` | `/mongo-register` | Registers a sample user in MongoDB           |\n| `GET` | `/mongo-data`     | Retrieves all users stored in MongoDB        |\n| `GET` | `/prisma-register`| Registers a sample user in PostgreSQL        |\n| `GET` | `/prisma-data`    | Retrieves all users stored in PostgreSQL     |\n\n## Running locally\n\n1. Install dependencies\n   ```bash\n   npm install\n   ```\n2. Create an `.env` file with the following values (adjust if required):\n   ```ini\n   PORT=3000\n   MONGOSE_URL=mongodb://localhost:27017/my-data\n   DATABASE_URL=postgres://myuser:mypass@localhost:5432/mydatabase\n   ```\n3. Build and start the server\n   ```bash\n   npm run dev\n   ```\n\n## Using Docker Compose\n\nTo launch the server together with MongoDB and PostgreSQL containers, run:\n\n```bash\ndocker-compose up --build\n```\n\nWhen started via compose, the application will be available on `http://localhost:3000`.\n\n## NPM Scripts\n\n- `npm run build` – Compile the TypeScript source\n- `npm start` – Start the compiled JavaScript from `dist/`\n- `npm run dev` – Build then start the server\n- `npm run docker-dev` – Used within the Docker container to run migrations, build and start\n- `npm test` – Currently prints a placeholder message\n\n## License\n\nThis project is provided under the ISC license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaliaharsh74%2Fdocker-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaliaharsh74%2Fdocker-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaliaharsh74%2Fdocker-practice/lists"}