{"id":50453258,"url":"https://github.com/nnavales/fastapi-template","last_synced_at":"2026-06-01T01:03:33.611Z","repository":{"id":276727492,"uuid":"930101847","full_name":"nnavales/fastapi-template","owner":"nnavales","description":"Backend modern template. Using FastAPI, SQLModel, PostgreSQL, Docker, GitHub Actions, and more. ","archived":false,"fork":false,"pushed_at":"2025-02-13T21:24:50.000Z","size":8042,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-27T05:54:16.421Z","etag":null,"topics":["api","backend","backend-api","development","fastapi","production"],"latest_commit_sha":null,"homepage":"","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/nnavales.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-10T04:23:40.000Z","updated_at":"2025-02-14T19:43:34.000Z","dependencies_parsed_at":"2025-02-10T23:02:04.654Z","dependency_job_id":null,"html_url":"https://github.com/nnavales/fastapi-template","commit_stats":null,"previous_names":["navalesnahuel/fastapi-template","nnavales/fastapi-template"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nnavales/fastapi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnavales%2Ffastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnavales%2Ffastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnavales%2Ffastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnavales%2Ffastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnavales","download_url":"https://codeload.github.com/nnavales/fastapi-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnavales%2Ffastapi-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33755375,"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-05-31T02:00:06.040Z","response_time":95,"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":["api","backend","backend-api","development","fastapi","production"],"created_at":"2026-06-01T01:03:28.851Z","updated_at":"2026-06-01T01:03:33.606Z","avatar_url":"https://github.com/nnavales.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Project Template\nA modern, production-ready template for building APIs with FastAPI, featuring OAuth2 authentication, SQLModel ORM, and comprehensive testing.\n\n## Features\n\n- 🚀 FastAPI – High-performance, modern web framework for building APIs\n- 🔐 OAuth2 Authentication – Secure login flow with Password and JWT token support\n- 📚 SQLModel – Type-safe SQL database integration for Python\n- 🐘 PostgreSQL – Robust, open-source relational database management system\n- 🧪 Pytest – Powerful testing framework for test-driven development\n- 🔍 Ruff – Lightning-fast Python linter for maintaining code quality\n- 🐋 Docker – Simplified deployment with containerization\n- ⚙️ GitHub Actions – Automated CI/CD pipeline for continuous integration and delivery\n- ⚡ Async Endpoints – High-performance, non-blocking API endpoints\n- 🔒 JWT Authentication – Secure, token-based authentication using OAuth2\n- 📊 SQLModel Integration – Type-safe database queries with SQLModel\n- 🔄 Alembic – Database schema migrations for version control\n- 🧪 Comprehensive Testing – Full test suite with Pytest for ensuring app stability\n- 📝 Custom Logging – Tailored logging configuration for effective debugging and monitoring\n- 🔍 Sentry – Real-time error tracking and alerting integration\n- 🛡️ Secure Docker Configuration – Best practices for secure and efficient containerized deployment\n- 🔧 Code Quality – Code enforcement with Ruff for cleaner and maintainable code\n- 📦 Fast Dependency Management – Streamlined project setup with uv for rapid development\n\n---\n\n## Prerequisites\n\n- **Python 3.11+**\n- `uv` package manager\n- **Docker and Docker Compose**\n- just (to run scripts faster)\n\n---\n\n## Project Structure\n\nThis project follows a modular approach, with separate directories for different components:\n\n- **`app/`**: Contains the core application code\n  - **`auth/`**: Handles user authentication, JWT tokens, and security-related services\n  - **`config.py`**: Centralized configuration settings\n  - **`database.py`**: Database setup and connections\n  - **`models.py`**: SQLAlchemy and SQLModel ORM models\n  - **`main.py`**: Entry point for the FastAPI application\n  - **`routes.py`**: All endpoint route definitions\n  - **`tests/`**: Test suite using pytest for unit and integration testing\n- **`alembic/`**: Database migration scripts managed by Alembic\n\n### Key Files:\n- **`main.py`**: FastAPI app initialization and middleware configuration\n- **`config.py`**: Configuration file for environment variables\n- **`database.py`**: Database connection and session management\n- **`models.py`**: All ORM models (with SQLModel)\n- **`routes.py`**: API routes and endpoints\n- **`scripts/`**: Custom scripts for deployment and maintenance tasks\n\n---\n\n## Setup Guide\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/navalesnahuel/fastapi-template.git\ncd fastapi-template\n```\n\n### 2. Set Up the `.env` File\n\n\u003cdiv align=\"center\"\u003e\n\n| Variable                   | Description                               | Dev Required | Deploy Required |\n|---------------------------|-------------------------------------------|--------------|-----------------|\n| `APP_VERSION`             | Version of the application                | Yes          | Yes             |\n| `ENVIRONMENT`             | Environment the application is running in  | Yes          | No              |\n| `DATABASE_URL`            | Database connection string                | Yes          | Yes             |\n| `CORS_HEADERS`            | Allowed headers for CORS requests         | No           | No              |\n| `CORS_ORIGINS`            | Allowed origins for CORS requests         | No           | No              |\n| `FIRST_SUPERUSER`         | Email for the first superuser            | Yes          | Yes             |\n| `FIRST_SUPERUSER_PASSWORD`| Password for the first superuser         | Yes          | Yes |\n| `DOCKERHUB_USERNAME`      | Docker Hub username (for deployment)      | No           | Yes             |\n| `DOCKERHUB_TOKEN`         | Docker Hub authentication token          | No           | Yes             |\n| `VIRTUAL_HOST`                    | Primary domain for the application       | No           | Yes             |\n| `LETSENCRYPT_EMAIL`       | Email for SSL certificates              | No           | Yes             |\n\n\u003c/div\u003e\n\n### 3. Running the Application\nThis project uses separate documentation files for development, deployment, and CI/CD.\n\n- **Development**: See [Development Instructions](./docs/development.md).  \n- **Deployment**: See [Deployment Instructions](./docs/deployment.md).\n\n---\n\n#### CI/CD Pipeline Setup \nFor CI/CD setup instructions, see [CI/CD Instructions](./docs/cicd.md)\n\n--- \n\n## License\nThe Full Stack FastAPI Template is licensed under the terms of the MIT license.\n\n## Acknowledgements\nThis repository incorporates code and ideas from the following open-source projects:\n\n- [FastAPI Production Template](https://github.com/zhanymkanov/fastapi_production_template)\n- [Full Stack FastAPI Template](https://github.com/fastapi/full-stack-fastapi-template)\n\nA big thanks to the contributors of these repositories for providing foundational code that made this project possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnavales%2Ffastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnavales%2Ffastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnavales%2Ffastapi-template/lists"}