{"id":44329877,"url":"https://github.com/alwil17/fastapi-boilerplate","last_synced_at":"2026-02-11T09:01:38.797Z","repository":{"id":334017253,"uuid":"1139675185","full_name":"Alwil17/fastapi-boilerplate","owner":"Alwil17","description":"FastAPI boilerplate with clean architecture","archived":false,"fork":false,"pushed_at":"2026-01-22T11:20:08.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-23T00:09:26.572Z","etag":null,"topics":["api","backend","boilerplate","clean-architecture","fastapi","fastapi-template","jwt","postgresql","python","starter","template"],"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/Alwil17.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-01-22T09:13:28.000Z","updated_at":"2026-01-22T11:27:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Alwil17/fastapi-boilerplate","commit_stats":null,"previous_names":["alwil17/fastapi-boilerplate"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/Alwil17/fastapi-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alwil17%2Ffastapi-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alwil17%2Ffastapi-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alwil17%2Ffastapi-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alwil17%2Ffastapi-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alwil17","download_url":"https://codeload.github.com/Alwil17/fastapi-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alwil17%2Ffastapi-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29330858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: 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":["api","backend","boilerplate","clean-architecture","fastapi","fastapi-template","jwt","postgresql","python","starter","template"],"created_at":"2026-02-11T09:01:08.427Z","updated_at":"2026-02-11T09:01:38.791Z","avatar_url":"https://github.com/Alwil17.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 FastAPI Boilerplate - Clean Architecture\n\n[![Use this template](https://img.shields.io/badge/Use%20this-Template-2ea44f?style=for-the-badge\u0026logo=github)](https://github.com/Alwil17/fastapi-boilerplate/generate)\n\n![CI](https://github.com/Alwil17/fastapi-boilerplate/workflows/CI/badge.svg)\n![Python](https://img.shields.io/badge/python-3.11+-blue.svg)\n![FastAPI](https://img.shields.io/badge/FastAPI-0.109+-green.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)\n![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)\n![Codecov](https://codecov.io/gh/Alwil17/fastapi-boilerplate/branch/master/graph/badge.svg)\n![Template checkbox](https://docs.github.com/assets/cb-24935/images/help/repository/template-repository-checkbox.png)\n\n\u003e A production-ready FastAPI boilerplate with clean architecture, JWT authentication, and PostgreSQL/SQLite support.\n\n## ✨ Features\n\n- 🏗️ **Clean Architecture** - Layered structure (API/Services/Repositories/Models)\n- 🔐 **JWT Authentication** - Complete auth system with refresh tokens\n- 🗄️ **Database Support** - PostgreSQL for production, SQLite for testing\n- 🔄 **Alembic Migrations** - Database schema versioning\n- 🧪 **Testing Suite** - Pytest with fixtures and mocks\n- 🐳 **Docker Ready** - Dockerfile included\n- 📝 **API Documentation** - Auto-generated with Swagger UI\n- ⚙️ **Configuration Management** - Pydantic Settings for env variables\n- 🔒 **Security Best Practices** - Password hashing, CORS, JWT validation\n\n## 📂 Project Structure\n\n```\nfastapi-boilerplate/\n├── app/\n│   ├── api/\n│   │   └── routes/          # API endpoints\n│   ├── core/                # Configuration \u0026 security\n│   ├── db/\n│   │   └── models/          # SQLAlchemy models\n│   ├── repositories/        # Data access layer\n│   ├── services/            # Business logic\n│   └── schemas/             # Pydantic models (DTOs)\n├── alembic/                 # Database migrations\n├── tests/                   # Test suite\n├── . env. example             # Environment variables template\n├── Dockerfile               # Docker configuration\n└── requirements.txt         # Python dependencies\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Python 3.11+\n- PostgreSQL (or use SQLite for local dev)\n- pip or poetry\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/Alwil17/fastapi-boilerplate.git\n   cd fastapi-boilerplate\n   ```\n\n2. **Create virtual environment**\n   ```bash\n   python -m venv . venv\n   source .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Set up environment variables**\n   ```bash\n   cp .env.example .env\n   # Edit .env with your configuration\n   ```\n\n5. **Run database migrations**\n   ```bash\n   alembic upgrade head\n   ```\n\n6. **Start the server**\n   ```bash\n   uvicorn app.main:app --reload\n   ```\n\n7. **Access the API**\n   - API:  http://localhost:8000\n   - Swagger UI: http://localhost:8000/docs\n   - ReDoc: http://localhost:8000/redoc\n\n## 🐳 Docker Deployment\n\n```bash\n# Build the image\ndocker build -t fastapi-boilerplate .\n\n# Run the container\ndocker run -p 8000:8000 --env-file .env fastapi-boilerplate\n```\n\n## 🧪 Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=app tests/\n\n# Run specific test file\npytest tests/test_auth.py -v\n```\n\n## 📖 API Endpoints\n\n### Authentication\n- `POST /auth/register` - Register new user\n- `POST /auth/token` - Login (get JWT tokens)\n- `POST /auth/refresh` - Refresh access token\n- `GET /auth/me` - Get current user info\n\n### Health Check\n- `GET /health` - API health status\n- `GET /` - Welcome message\n\n## 🔧 Configuration\n\nKey environment variables (see `.env.example`):\n\n```env\n# Application\nAPP_NAME=\"FastAPI Boilerplate\"\nAPP_ENV=development\nAPP_SECRET_KEY=your-secret-key\n\n# Database\nDB_ENGINE=postgresql\nDB_HOST=localhost\nDB_PORT=5432\nDB_NAME=mydb\nDB_USER=user\nDB_PASSWORD=password\n\n# JWT\nACCESS_TOKEN_EXPIRE_MINUTES=1440\nREFRESH_TOKEN_EXPIRE_DAYS=7\n```\n\n## 🏗️ Architecture Principles\n\nThis boilerplate follows:\n\n- **Clean Architecture** - Separation of concerns\n- **Repository Pattern** - Abstract data access\n- **Dependency Injection** - Loose coupling\n- **SOLID Principles** - Maintainable code\n- **DTOs with Pydantic** - Type safety and validation\n\n## 📚 Tech Stack\n\n- **FastAPI** - Modern web framework\n- **SQLAlchemy** - ORM for database operations\n- **Alembic** - Database migrations\n- **Pydantic** - Data validation\n- **JWT** - Authentication\n- **Pytest** - Testing framework\n- **PostgreSQL** - Production database\n- **SQLite** - Testing database\n\n## 🤝 Contributing\n\nContributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see [LICENSE](LICENSE) file.\n\n## 🙏 Acknowledgments\n\n- Inspired by clean architecture principles\n- Built with FastAPI best practices\n- Community-driven development\n\n---\n\n**Made with ❤️ by [Alwil17](https://github.com/Alwil17)**\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwil17%2Ffastapi-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwil17%2Ffastapi-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwil17%2Ffastapi-boilerplate/lists"}