{"id":42165086,"url":"https://github.com/pedramcode/mpec-demp","last_synced_at":"2026-01-26T21:00:39.990Z","repository":{"id":310399118,"uuid":"1039637821","full_name":"pedramcode/mpec-demp","owner":"pedramcode","description":"MPEC demo service","archived":false,"fork":false,"pushed_at":"2025-08-17T20:42:59.000Z","size":377,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-17T22:07:23.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pedramcode.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-08-17T17:02:52.000Z","updated_at":"2025-08-17T20:43:02.000Z","dependencies_parsed_at":"2025-08-17T22:07:27.236Z","dependency_job_id":"e2455ae9-36b1-4568-8c6f-62a1092dc6a4","html_url":"https://github.com/pedramcode/mpec-demp","commit_stats":null,"previous_names":["pedramcode/mpec-demp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pedramcode/mpec-demp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fmpec-demp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fmpec-demp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fmpec-demp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fmpec-demp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedramcode","download_url":"https://codeload.github.com/pedramcode/mpec-demp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fmpec-demp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28788061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2026-01-26T21:00:21.716Z","updated_at":"2026-01-26T21:00:39.960Z","avatar_url":"https://github.com/pedramcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPEC service\n\nA **Mathematical Proof Explanatory Chain** service for demo.\n\n## Dependencies\n\n* **@nestjs/swagger** – Generates OpenAPI (Swagger) documentation for all REST APIs, making endpoints self-describing and testable.\n* **class-validator** – Declarative validation of request DTOs (e.g., ensuring non-empty strings, valid UUIDs, enums).\n* **typeorm** – Object-relational mapper (ORM) for PostgreSQL, handling entities, migrations, and database queries in a TypeScript-friendly way.\n* **winston** – A versatile logging library supporting multiple transports (console, file, JSON).\n\n## How to run\n\nCreate a `.env` file at root with following content (values are sample):\n\n```ENV\n# ========== Docker compose requirements ==========\nPOSTGRES_USER=admin\nPOSTGRES_PASSWORD=admin\nPOSTGRES_DB=mpec\nPGADMIN_DEFAULT_EMAIL=admin@mail.com\nPGADMIN_DEFAULT_PASSWORD=admin\n\n# ========== Main service requirements ==========\nNODE_ENV=development\nDATABASE_HOST=postgres\nDATABASE_PORT=5432\nDATABASE_NAME=mpec\nDATABASE_USERNAME=admin\nDATABASE_PASSWORD=admin\n```\n\nThen run following command:\n\n```bash\ndocker compose up --build\n```\n\nNOTE: Swagger documentation is at `/docs` end-point\n\n---\n\n## 🛠 Services (Docker Compose)\n\nThis project uses **Docker Compose** to orchestrate the backend, database, and database administration tool. Below are the services included in `docker-compose.yml`:\n\n### 1. **mpec (Backend Service)**\n\n* **Image/Build**: Built from the local `Dockerfile.dev`.\n* **Container Name**: `mpec-service`.\n* **Purpose**: Runs the NestJS backend API.\n* **Environment Variables**:\n\n  * `NODE_ENV=development`\n  * `DATABASE_HOST=postgres`\n  * `DATABASE_PORT=5432`\n  * `DATABASE_NAME=${POSTGRES_DB}`\n  * `DATABASE_USERNAME=${POSTGRES_USER}`\n  * `DATABASE_PASSWORD=${POSTGRES_PASSWORD}`\n  * `PORT=3000`\n* **Ports**: Exposes backend API on `http://localhost:3000`.\n* **Volumes**: Mounts `./src` to `/app/src` for hot-reloading in development.\n* **Depends On**: Waits for the `postgres` service to be available.\n* **Network**: Connected to `mpec_net`.\n\n---\n\n### 2. **postgres (Database Service)**\n\n* **Image**: `postgres:16-alpine`.\n* **Container Name**: `mpec-postgres`.\n* **Purpose**: Provides the PostgreSQL database used by the backend.\n* **Environment Variables**:\n\n  * `POSTGRES_USER=${POSTGRES_USER}`\n  * `POSTGRES_PASSWORD=${POSTGRES_PASSWORD}`\n  * `POSTGRES_DB=${POSTGRES_DB}`\n* **Ports**: Maps container port `5432` to host port `5430` → accessible at `localhost:5430`.\n* **Volumes**: Persists data using `mpec_pgdata` volume.\n* **Network**: Connected to `mpec_net`.\n\n---\n\n### 3. **pgadmin (Database Administration UI)**\n\n* **Image**: `dpage/pgadmin4:latest`.\n* **Container Name**: `mpec-pgadmin`.\n* **Purpose**: Web-based administration tool for PostgreSQL.\n* **Environment Variables**:\n\n  * `PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}`\n  * `PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}`\n* **Ports**: Exposes UI on `http://localhost:5440`.\n* **Depends On**: Requires `postgres` to be available.\n* **Network**: Connected to `mpec_net`.\n\n---\n\n### 🔗 Networks and Volumes\n\n* **Network**: `mpec_net` (bridge driver) ensures communication between containers.\n* **Volume**: `mpec_pgdata` persists PostgreSQL data across container restarts.\n\n---\n\n## ERD\n\n![ERD image](./ERDiagram.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Fmpec-demp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedramcode%2Fmpec-demp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Fmpec-demp/lists"}