{"id":30186056,"url":"https://github.com/linthithtwe/dashboard-fastapi-backend","last_synced_at":"2026-05-07T00:37:13.035Z","repository":{"id":306963812,"uuid":"1026052394","full_name":"LinThitHtwe/dashboard-fastapi-backend","owner":"LinThitHtwe","description":"A simple FastAPI REST API data querying, pagination, and performance optimization with Redis caching.","archived":false,"fork":false,"pushed_at":"2025-07-28T17:59:42.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T18:40:41.699Z","etag":null,"topics":["fastapi","python","redis","rest-api"],"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/LinThitHtwe.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-07-25T08:26:09.000Z","updated_at":"2025-07-28T18:24:28.000Z","dependencies_parsed_at":"2025-07-28T18:40:45.992Z","dependency_job_id":"d21d6e53-3d54-4ede-9eae-9cb3750c7b1c","html_url":"https://github.com/LinThitHtwe/dashboard-fastapi-backend","commit_stats":null,"previous_names":["linthithtwe/dashboard-fastapi-backend"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/LinThitHtwe/dashboard-fastapi-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinThitHtwe%2Fdashboard-fastapi-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinThitHtwe%2Fdashboard-fastapi-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinThitHtwe%2Fdashboard-fastapi-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinThitHtwe%2Fdashboard-fastapi-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinThitHtwe","download_url":"https://codeload.github.com/LinThitHtwe/dashboard-fastapi-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinThitHtwe%2Fdashboard-fastapi-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270073664,"owners_count":24522390,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["fastapi","python","redis","rest-api"],"created_at":"2025-08-12T14:10:11.851Z","updated_at":"2026-05-07T00:37:13.006Z","avatar_url":"https://github.com/LinThitHtwe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Product Rest API using FastAPI\n\nThis project is a simple Product REST API built with Python FastAPI. It uses PostgreSQL as the database and Redis for caching to improve performance. The main focus is on building clean and efficient REST API endpoints that support data retrieval with filtering, sorting, pagination, and exception handling.\n\n## Features\n\n- FastAPI backend with async SQLAlchemy\n- PostgreSQL database\n- Redis caching (via fastapi-cache2)\n- Filtering, sorting, and pagination for product listing\n- Pydantic models and validation\n- Centralized exception handling and logging\n- Docker \u0026 docker-compose support\n\n## Main Focus of development\n\n- **Global Exception Handling:** All errors are caught and returned in a consistent, structured format, to make debugging and client integration easier.\n- **Redis Caching:** Queries are cached, reducing latency and database load.\n\n## Project Structure\n\n```\n.\n├── docker-compose.yml\n├── dockerfile\n├── requirement.txt\n├── .env.sample\n├── src/\n│   ├── main.py\n│   ├── core/\n│   ├── db/\n│   ├── models/\n│   ├── routes/\n│   ├── schemas/\n│   ├── services/\n│   ├── common/\n│   └── constants/\n```\n\n## API Highlights\n\n- `GET /products/` — List products with advanced filtering, sorting, and pagination\n- `GET /products/{product_id}` — Retrieve a single product by ID\n- `POST /products/` — Create a new product\n- `PUT /products/{product_id}` — Update a product\n\n## Dependencies\n\n```txt\npython==3.13.4\nfastapi==0.116.1\nuvicorn==0.35.0\nsqlalchemy==2.0.41\nasyncpg==0.30.0\npydantic==2.11.7\npydantic-settings==2.10.1\npython-dotenv==1.1.1\nfastapi-cache2==0.2.2\nredis==6.2.0\naioredis==2.0.1\nFaker==37.4.2\n```\n\n## Frontend Project Url\n\n[https://github.com/LinThitHtwe/dashboard-nextjs-frontend](https://github.com/LinThitHtwe/dashboard-nextjs-frontend)\n\n## Configuration \u0026 Setup\n\nBelow are the steps to run this project locally\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/LinThitHtwe/dashboard-fastapi-backend\ncd dashboard-fastapi-backend\n```\n\n---\n\n### 2. Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n---\n\n### 3. Setup Environment Variables\n\nCreate a `.env` file in the root directory and add the following variables:\n\n```env\nDATABASE_URL=postgresql+asyncpg://\u003cusername\u003e:\u003cpassword\u003e@localhost:5432/\u003cyour_db_name\u003e\nREDIS_URL=redis://localhost:6379\n```\n\n---\n\n### 4. Seed Sample Data (Optional)\n\n```bash\npython -m db.seed\n```\n\n---\n\n### 5. Start the FastAPI Server\n\n```bash\nuvicorn src.main:app --reload\n```\n\nVisit: [http://localhost:8000/docs](http://localhost:8000/docs) for the interactive Swagger UI.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinthithtwe%2Fdashboard-fastapi-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinthithtwe%2Fdashboard-fastapi-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinthithtwe%2Fdashboard-fastapi-backend/lists"}