{"id":27455583,"url":"https://github.com/ahmadalsharef994/fastapi-postgres-boilerplate","last_synced_at":"2026-04-29T23:03:55.927Z","repository":{"id":287717796,"uuid":"965534201","full_name":"ahmadalsharef994/fastapi-postgres-boilerplate","owner":"ahmadalsharef994","description":"Production-Ready Starter Template, FastAPI + PostgreSQL boilerplate with Docker, GitHub Actions, and clean architecture.","archived":false,"fork":false,"pushed_at":"2025-04-13T18:48:05.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T19:44:40.915Z","etag":null,"topics":["api","backend","boilerplate","docker","fastapi","guthub-actions","postgres","python","template"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ahmadalsharef994.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-04-13T11:31:56.000Z","updated_at":"2025-04-13T18:50:40.000Z","dependencies_parsed_at":"2025-04-13T14:48:13.909Z","dependency_job_id":null,"html_url":"https://github.com/ahmadalsharef994/fastapi-postgres-boilerplate","commit_stats":null,"previous_names":["ahmadalsharef994/smarthub","ahmadalsharef994/fastapi-postgres-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadalsharef994%2Ffastapi-postgres-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadalsharef994%2Ffastapi-postgres-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadalsharef994%2Ffastapi-postgres-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadalsharef994%2Ffastapi-postgres-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmadalsharef994","download_url":"https://codeload.github.com/ahmadalsharef994/fastapi-postgres-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249110824,"owners_count":21214406,"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":["api","backend","boilerplate","docker","fastapi","guthub-actions","postgres","python","template"],"created_at":"2025-04-15T16:44:11.228Z","updated_at":"2026-04-29T23:03:55.919Z","avatar_url":"https://github.com/ahmadalsharef994.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 FastAPI + PostgreSQL Boilerplate\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.11+-blue?logo=python\" alt=\"Python\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/FastAPI-0.100+-green?logo=fastapi\" alt=\"FastAPI\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-SQLAlchemy-blue?logo=postgresql\" alt=\"PostgreSQL\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/docker-compose-blue?logo=docker\" alt=\"Docker\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/CI-GitHub%20Actions-black?logo=githubactions\" alt=\"CI\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License\"\u003e\n\u003c/p\u003e\n\nA **production-ready starter template** for building FastAPI applications with PostgreSQL — clean architecture, Docker Compose setup, and GitHub Actions CI included out of the box.\n\n---\n\n## ✨ What's Included\n\n- ✅ **FastAPI** with async route handlers\n- ✅ **SQLAlchemy 2.0** ORM with PostgreSQL\n- ✅ **Alembic** for database migrations\n- ✅ **Docker + Docker Compose** — one command to start everything\n- ✅ **GitHub Actions CI** — runs tests on every push\n- ✅ **Dependency injection** — clean, testable service layer\n- ✅ **Pydantic v2** request/response validation\n- ✅ **Auto-generated Swagger UI** at `/docs`\n\n---\n\n## 🚀 Quick Start\n\n```bash\ngit clone https://github.com/ahmadalsharef994/fastapi-postgres-boilerplate.git\ncd fastapi-postgres-boilerplate\n\ncd infra/docker\ndocker-compose up --build\n```\n\nAPI: `http://localhost:8000`\nSwagger: `http://localhost:8000/docs`\n\n### Without Docker\n\n```bash\npython -m venv venv \u0026\u0026 source venv/bin/activate\npip install -r requirements.txt\n\n# Set up DB\nalembic upgrade head\n\nuvicorn app.main:app --reload\n```\n\n---\n\n## 📁 Structure\n\n```\napp/\n├── main.py          # FastAPI app entry point\n├── db/\n│   ├── base.py      # SQLAlchemy base + session\n│   └── models.py    # ORM models\n├── routes/          # API route handlers\n├── schemas/         # Pydantic schemas\n├── services/        # Business logic layer\n└── dependencies.py  # DI container\ninfra/\n└── docker/\n    └── docker-compose.yml\n.github/\n└── workflows/ci.yml # GitHub Actions\n```\n\n---\n\n## ⚙️ Environment Variables\n\n```env\nDATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/dbname\nSECRET_KEY=your-secret-key\nDEBUG=true\n```\n\n---\n\n## 🧪 Testing\n\n```bash\npytest tests/ -v --cov=app\n```\n\n---\n\n## 📄 License\n\nMIT — Start building faster 💡\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadalsharef994%2Ffastapi-postgres-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmadalsharef994%2Ffastapi-postgres-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadalsharef994%2Ffastapi-postgres-boilerplate/lists"}