{"id":18831686,"url":"https://github.com/yuting1214/fullstack-fastapi","last_synced_at":"2026-02-20T09:03:00.603Z","repository":{"id":245047442,"uuid":"817100767","full_name":"yuting1214/Fullstack-FastAPI","owner":"yuting1214","description":"Deploy a FastAPI app with PostgreSQL integration with one click.","archived":false,"fork":false,"pushed_at":"2025-04-05T14:44:05.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T07:51:00.992Z","etag":null,"topics":["fastapi","postgresql","python","railway","zeabur"],"latest_commit_sha":null,"homepage":"https://railway.app/template/IhHgYS","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuting1214.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-06-19T02:56:58.000Z","updated_at":"2025-02-16T19:54:38.000Z","dependencies_parsed_at":"2024-08-22T18:02:37.795Z","dependency_job_id":"3bdb0e3e-eb3a-48a0-9dc0-f175652ba47e","html_url":"https://github.com/yuting1214/Fullstack-FastAPI","commit_stats":null,"previous_names":["yuting1214/fullstack-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yuting1214/Fullstack-FastAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuting1214%2FFullstack-FastAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuting1214%2FFullstack-FastAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuting1214%2FFullstack-FastAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuting1214%2FFullstack-FastAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuting1214","download_url":"https://codeload.github.com/yuting1214/Fullstack-FastAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuting1214%2FFullstack-FastAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29646520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T08:48:14.886Z","status":"ssl_error","status_checked_at":"2026-02-20T08:45:26.777Z","response_time":59,"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":["fastapi","postgresql","python","railway","zeabur"],"created_at":"2024-11-08T01:55:44.357Z","updated_at":"2026-02-20T09:03:00.599Z","avatar_url":"https://github.com/yuting1214.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: FastAPI\ndescription: A FastAPI server\ntags:\n  - fastapi\n  - uvicorn\n  - python\n  - postgresql\n---\n\n\u003c!-- LINK GROUP --\u003e\n[deploy-on-zeabur-button-image]: https://zeabur.com/button.svg\n[deploy-on-zeabur-link]: https://zeabur.com/templates/A2TNYB\n\n# FastAPI Fullstack Template\n\nA production-ready [FastAPI](https://fastapi.tiangolo.com/) template with [PostgreSQL](https://www.postgresql.org/), fully async, and modern Python tooling.\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/IhHgYS?referralCode=jk_FgY)\n[![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link]\n\n\u003e **[CHANGELOG](./CHANGELOG.md)** — See what's changed between versions.\n\n## Features\n\n- **FastAPI** with ORJSONResponse for fast serialization\n- **Fully async** — endpoints, CRUD, and database layer\n- **SQLAlchemy 2.0** with async engine and `select()` style queries\n- **Pydantic v2** for request/response validation and settings management\n- **Pure ASGI middleware** for doc protection (no `BaseHTTPMiddleware` overhead)\n- **Typed lifespan state** with proper startup/shutdown lifecycle\n- **uvloop + httptools** for maximum ASGI performance\n- **GZIP compression** for responses \u003e 1KB\n- **Session-based auth** protecting `/docs` and `/redoc`\n- **uv** for fast, reproducible dependency management\n- **Locust** load testing included\n- **Docker** multi-stage build ready\n\n## Project Structure\n\n```\n├── src/\n│   ├── backend/\n│   │   ├── main.py              # FastAPI app entry point\n│   │   ├── api/v1/endpoints/    # Route handlers\n│   │   ├── core/                # Config, lifespan, middleware, routers\n│   │   ├── crud/                # Service layer (async CRUD)\n│   │   ├── dependencies/        # Database setup, DI\n│   │   ├── models/              # SQLAlchemy ORM models\n│   │   ├── schemas/             # Pydantic schemas\n│   │   ├── security/            # Authentication\n│   │   └── data/                # Seed data\n│   └── frontend/\n│       └── login/               # Login page templates \u0026 static files\n├── tests/                       # Async test suite\n├── pyproject.toml               # Dependencies \u0026 project config\n├── Dockerfile                   # Multi-stage build with uv\n├── locustfile.py                # Load testing\n└── .env.example                 # Environment variable template\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv/) package manager\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/yuting1214/Fullstack-FastAPI.git\ncd Fullstack-FastAPI\n\n# Install dependencies\nuv sync\n\n# Copy environment template\ncp .env.example .env\n# Edit .env with your values\n\n# Run in development mode (SQLite)\nuv run python -m src.backend.main --mode dev\n\n# Run in production mode (PostgreSQL)\nuv run python -m src.backend.main --mode prod --host 0.0.0.0\n```\n\n### Running Tests\n\n```bash\nuv sync --extra dev\nuv run pytest\n```\n\n\u003e **Note:** Tests use `httpx.AsyncClient` via `ASGITransport`, which does not trigger FastAPI's lifespan events. The shared `tests/conftest.py` handles DB table creation and teardown automatically. If you add new tests, the `setup_db` fixture runs via `autouse` — no manual setup needed.\n\n### Load Testing\n\n```bash\nuv run locust\n# Open http://localhost:8089\n```\n\n### Docker\n\n```bash\ndocker build -t fullstack-fastapi .\ndocker run -p 5000:5000 fullstack-fastapi\n```\n\n## API Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/` | Health check |\n| `GET` | `/login` | Login page |\n| `POST` | `/login` | Authenticate |\n| `GET` | `/logout` | Clear session |\n| `POST` | `/api/v1/messages/` | Create message |\n| `GET` | `/api/v1/messages/` | List messages |\n| `GET` | `/api/v1/messages/{id}` | Get message |\n| `PUT` | `/api/v1/messages/{id}` | Update message |\n| `DELETE` | `/api/v1/messages/{id}` | Delete message |\n\n## Environment Variables\n\nSee [`.env.example`](./.env.example) for all available configuration options.\n\n## Learn More\n\n- [FastAPI Documentation](https://fastapi.tiangolo.com/tutorial/)\n- [Uvicorn Documentation](https://www.uvicorn.org/)\n- [uv Documentation](https://docs.astral.sh/uv/)\n- [FastAPI Tips](https://github.com/Kludex/fastapi-tips)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuting1214%2Ffullstack-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuting1214%2Ffullstack-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuting1214%2Ffullstack-fastapi/lists"}