{"id":51070728,"url":"https://github.com/ayusharma-ctrl/postgres-as-a-platform","last_synced_at":"2026-06-23T10:01:51.031Z","repository":{"id":339277120,"uuid":"1158010268","full_name":"ayusharma-ctrl/postgres-as-a-platform","owner":"ayusharma-ctrl","description":"Node.js \u0026 TypeScript production-ready app demonstrating how modern PostgreSQL can replace Redis, queues, schedulers, search engines, vector databases, RAG pipelines, and more using built-in features and extensions. Learn Postgres as an application platform, not just a database. Here I explain core concepts and real-world system design patterns.","archived":false,"fork":false,"pushed_at":"2026-03-26T19:24:59.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T08:17:51.975Z","etag":null,"topics":["caching","docker","embeddings","full-text-search","gemini","langchain","materialized-views","nodejs","pgvector","postgresql","production-ready","pub-sub","queue-workers","rag","rate-limiting","scheduler","semantic-search","system-design","typescript","vector-database"],"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/ayusharma-ctrl.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T16:51:34.000Z","updated_at":"2026-03-26T20:00:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ayusharma-ctrl/postgres-as-a-platform","commit_stats":null,"previous_names":["ayusharma-ctrl/postgres-for-all"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayusharma-ctrl/postgres-as-a-platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayusharma-ctrl%2Fpostgres-as-a-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayusharma-ctrl%2Fpostgres-as-a-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayusharma-ctrl%2Fpostgres-as-a-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayusharma-ctrl%2Fpostgres-as-a-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayusharma-ctrl","download_url":"https://codeload.github.com/ayusharma-ctrl/postgres-as-a-platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayusharma-ctrl%2Fpostgres-as-a-platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34684686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"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":["caching","docker","embeddings","full-text-search","gemini","langchain","materialized-views","nodejs","pgvector","postgresql","production-ready","pub-sub","queue-workers","rag","rate-limiting","scheduler","semantic-search","system-design","typescript","vector-database"],"created_at":"2026-06-23T10:01:50.371Z","updated_at":"2026-06-23T10:01:51.027Z","avatar_url":"https://github.com/ayusharma-ctrl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postgres-as-a-platform\n\nA modular Node.js + TypeScript backend using PostgreSQL as the primary system of record.\nThe project demonstrates practical backend patterns: queueing, caching, pub/sub, search, vector search, RAG, and more...\n\n## What This Project Does\n\n- Runs an HTTP API with independently mounted modules.\n- Uses PostgreSQL for relational data, queue state, cache state, full-text search, and vector search.\n- Supports RAG over uploaded PDF/DOCX files.\n- Runs background workers for queue processing and cache maintenance.\n\n## Stack\n\n- Node.js, TypeScript, Express\n- PostgreSQL 17 + pgvector\n- Sequelize\n- LangChain + Gemini (embeddings + answer generation)\n\n## High-Level Request Flow\n\n1. `server.ts` boots DB, modules, routes, and workers.\n2. Routes are mounted from `api/src/modules/index.ts`.\n3. Module services use PostgreSQL directly (via Sequelize ORM + raw SQL where needed).\n4. Queue and cache workers run in background loops.\n\n## Project Structure\n\n- `api/src/server.ts`: app bootstrap\n- `api/src/modules/`: feature modules\n- `api/src/db/migrations/`: schema evolution\n- `api/src/routes/health.ts`: health endpoint\n- `docker-compose.yml`: local stack (Postgres, migrate job, API)\n\n## Module Docs\n\n- `api/src/modules/rag/RAG_README.md`\n- `api/src/modules/queue/QUEUE_README.md`\n- `api/src/modules/pubsub/PUBSUB_README.md`\n- `api/src/modules/cache/CACHE_README.md`\n- `api/src/modules/rate-limit/RATE_LIMIT_README.md`\n- `api/src/modules/search/SEARCH_README.md`\n- `api/src/modules/vector/VECTOR_README.md`\n\n## Local Run (Docker)\n\n1. Ensure `api/.env` is configured.\n2. Run: `docker compose up --build`\n3. API default: `http://localhost:8000`\n4. Health check: `GET /health`\n\n## Notes\n\n- Queue module is event-assisted (`pg_notify`) with DB polling as fallback.\n- RAG ingestion is asynchronous: upload returns quickly, processing happens in worker.\n- This repo intentionally keeps modules decoupled so each concept is easy to learn and extend.\n- Will add more to it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayusharma-ctrl%2Fpostgres-as-a-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayusharma-ctrl%2Fpostgres-as-a-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayusharma-ctrl%2Fpostgres-as-a-platform/lists"}