{"id":50927204,"url":"https://github.com/skatesham/fastapi-bigger-application","last_synced_at":"2026-06-17T00:03:59.579Z","repository":{"id":46558996,"uuid":"386847660","full_name":"skatesham/fastapi-bigger-application","owner":"skatesham","description":"Example of FastAPI bigger application","archived":false,"fork":false,"pushed_at":"2026-02-27T18:10:03.000Z","size":153,"stargazers_count":100,"open_issues_count":6,"forks_count":22,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-27T21:39:10.705Z","etag":null,"topics":["docker-compose","fastapi","postgresql","python","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skatesham.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":"2021-07-17T05:37:53.000Z","updated_at":"2026-02-27T18:09:51.000Z","dependencies_parsed_at":"2024-08-05T08:05:09.232Z","dependency_job_id":null,"html_url":"https://github.com/skatesham/fastapi-bigger-application","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/skatesham/fastapi-bigger-application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatesham%2Ffastapi-bigger-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatesham%2Ffastapi-bigger-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatesham%2Ffastapi-bigger-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatesham%2Ffastapi-bigger-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skatesham","download_url":"https://codeload.github.com/skatesham/fastapi-bigger-application/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatesham%2Ffastapi-bigger-application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34428197,"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-06-16T02:00:06.860Z","response_time":126,"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":["docker-compose","fastapi","postgresql","python","rest-api"],"created_at":"2026-06-17T00:03:53.641Z","updated_at":"2026-06-17T00:03:59.566Z","avatar_url":"https://github.com/skatesham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Car Shop ERP\n\n\n[![Coverage: 78%](https://img.shields.io/badge/coverage-78%25-brightgreen.svg)](tests/)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![FastAPI](https://img.shields.io/badge/FastAPI-0.133.1-green.svg)](https://fastapi.tiangolo.com/)\n[![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-2.0.47-blue.svg)](https://www.sqlalchemy.org/)\n[![Pydantic](https://img.shields.io/badge/Pydantic-2.12.5-orange.svg)](https://docs.pydantic.dev/)\n\nProfessional REST API ERP system for car shop management built with FastAPI 0.133, SQLAlchemy 2.0, and modern Python patterns.\n\n---\n\n## ✨ Features\n\n- 🚀 **FastAPI 0.133.1** - Latest stable version with modern patterns\n- 🗄️ **SQLAlchemy 2.0.47** - Modern ORM with async support\n- 🔐 **Professional Security** - JWT with core.security module\n- 📊 **Pydantic V2.12.5** - Modern data validation and serialization\n- 🏗️ **Clean Architecture** - Professional structure with core modules\n- 🧪 **Comprehensive Testing** - Tests separated from application code\n- 📝 **Auto Documentation** - Swagger/OpenAPI with `/docs`\n- 🔧 **Professional Tooling** - Black, isort, mypy, pytest, coverage\n- 🎯 **Dependency Injection** - FastAPI Annotated patterns\n- 📦 **Modern Packaging** - pyproject.toml with professional setup\n- 🔒 **Security Best Practices** - passlib, bcrypt, secure JWT handling\n\n---\n\n## 🛠️ Tech Stack\n\n- **Framework**: FastAPI 0.133.1\n- **Database**: PostgreSQL with SQLAlchemy 2.0.47\n- **Configuration**: Pydantic Settings V2\n- **Authentication**: JWT with python-jose[cryptography]\n- **Validation**: Pydantic V2.12.5 + Pydantic Settings 2.13.1\n- **Testing**: pytest 9.0.2 + pytest-asyncio 1.3.0 + pytest-cov 7.0.0\n- **Code Quality**: Black 26.1.0, isort 8.0.0, flake8 7.3.0, mypy 1.19.1\n- **Security**: passlib[bcrypt] 1.7.4, python-multipart 0.0.6\n- **Database Tools**: psycopg2-binary 2.9.0, alembic 1.12.0\n- **Documentation**: Auto-generated Swagger/OpenAPI\n- **Architecture**: Clean API structure with v1 versioning\n\n---\n\n## 🏗️ Project Structure\n\n```\nfastapi-bigger-application/\n├── app/                    # Application source code\n│   ├── src/\n│   │   ├── api/           # API layer (v1)\n│   │   │   ├── deps.py    # Dependencies injection\n│   │   │   ├── converters/ # Response converters\n│   │   │   └── v1/\n│   │   │       └── endpoints/\n│   │   ├── core/          # Core modules\n│   │   │   ├── config.py  # Pydantic Settings\n│   │   │   ├── database.py # Database setup\n│   │   │   └── security.py # JWT \u0026 auth\n│   │   ├── domain/        # Business logic\n│   │   └── internal/      # Internal utilities\n│   └── main.py           # Application entry point\n├── tests/                # Test suite (external)\n├── Dockerfile            # Docker container configuration\n├── docker-compose.yml    # Docker Compose orchestration\n├── docker-dev.sh         # Interactive development script\n├── .dockerignore         # Docker build exclusions\n├── pyproject.toml       # Modern Python packaging\n├── requirements.txt     # Dependencies\n├── setup.cfg            # Flake8 configuration\n├── .coveragerc          # Coverage configuration\n└── .env.example        # Environment template\n```\n\n---\n\n## 🚀 Quick Start\n\n### 🐳 Docker (Recommended - Automated)\n\nThe fastest way to get started is using Docker Compose:\n\n```bash\n# Clone and start everything automatically\ngit clone https://github.com/carshop/fastapi-erp.git\ncd fastapi-erp\ndocker-compose up --build\n```\n\n#### 🚀 Interactive Development Script\n\nFor an enhanced development experience, use our interactive script:\n\n```bash\n# Run the interactive development script\n./docker-dev.sh\n```\n\nThe script provides:\n- **🚀 Auto-start services** with health checks\n- **📊 Service status monitoring**\n- **📋 Live logs viewing**\n- **🛑 Clean stop/reset options**\n- **🔗 Quick access URLs**\n- **🎨 Colored output and status indicators**\n\nThat's it! 🎉 The application will be available at:\n- **API**: http://localhost:8000\n- **Documentation**: http://localhost:8000/docs\n- **Database Admin**: http://localhost:9000 (Adminer)\n\nServices included:\n- **FastAPI App** (port 8000) - Main application\n- **PostgreSQL** (port 5432) - Database with persistent data\n- **Adminer** (port 9000) - Database management interface\n\n### Local Development\n\nIf you prefer to run locally:\n\n#### Prerequisites\n\n- Python 3.11+\n- PostgreSQL 12+\n- Docker \u0026 Docker Compose (optional)\n\n#### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/carshop/fastapi-erp.git\ncd fastapi-erp\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -e \".[dev]\"\n\n# Setup environment\ncp .env.example .env\n# Edit .env with your configuration\n\n# Start the application\nuvicorn app.main:app --reload\n```\n\n### Environment Configuration\n\nCreate `.env` file based on `.env.example`:\n\n```bash\n# Database\nDATABASE_URL=postgresql://user:password@localhost/dbname\n\n# Security\nSECRET_KEY=your-secret-key-here\nALGORITHM=HS256\nACCESS_TOKEN_EXPIRE_MINUTES=30\n\n# Service Configuration\nSERVICE_NAME=fastapi-car-shop-erp\nSERVICE_VERSION=1.0.0\nSERVICE_DESCRIPTION=Professional ERP system for car shop management\nSERVICE_AUTHOR=Your Name\n\n# Application\nDEBUG=false\nENVIRONMENT=production\n\n# CORS\nALLOWED_HOSTS=localhost,127.0.0.1,yourdomain.com\n```\n\n**Note**: All service information (name, version, description, author) is centralized in the configuration and automatically used by health/info endpoints.\n\n---\n\n## 📚 API Documentation\n\nOnce running, access:\n- **Swagger UI**: http://localhost:8000/docs\n- **ReDoc**: http://localhost:8000/redoc\n- **OpenAPI JSON**: http://localhost:8000/openapi.json\n\n## 🧪 Testing\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=app --cov-report=html\n\n# Run specific test\npytest tests/test_jwt.py -v\n```\n\n---\n\n## 🔧 Development\n\n### Code Quality\n\n```bash\n# Format code\nblack app/ tests/\nisort app/ tests/\n\n# Lint\nflake8 app/ tests/\n\n# Type checking\nmypy app/\n\n# Security check\nbandit -r app/\n```\n\n### Database Migrations\n\n```bash\n# Create migration\nalembic revision --autogenerate -m \"Description\"\n\n# Apply migrations\nalembic upgrade head\n\n# Downgrade\nalembic downgrade -1\n```\n\n---\n\n## 📦 Deployment\n\n### 🐳 Docker (Recommended)\n\n#### Quick Start - One Command Setup\n\n```bash\n# Clone and run everything automatically\ngit clone https://github.com/carshop/fastapi-erp.git\ncd fastapi-erp\ndocker-compose up --build\n```\n\n#### Docker Services\n\nThe `docker-compose.yml` includes three services:\n\n1. **api** - FastAPI Application\n   - Port: 8000\n   - Auto-reload with volume mounting\n   - Health checks enabled\n   - Depends on database\n\n2. **db** - PostgreSQL Database\n   - Port: 5432\n   - Persistent data volume\n   - Health checks for startup order\n   - Credentials: `skatesham:skatesham-github`\n\n3. **adminer** - Database Admin Interface\n   - Port: 9000\n   - Web-based database management\n   - Connect to `db` service\n\n#### Docker Commands\n\n```bash\n# Start all services\ndocker-compose up --build\n\n# Start in background\ndocker-compose up -d --build\n\n# View logs\ndocker-compose logs -f api\n\n# Stop services\ndocker-compose down\n\n# Stop and remove volumes\ndocker-compose down -v\n\n# Rebuild specific service\ndocker-compose up --build api\n\n# Access running container\ndocker-compose exec api bash\n```\n\n#### Environment Variables\n\nThe Docker setup automatically configures:\n- `DATABASE_URL=postgresql://skatesham:skatesham-github@db:5432/skatesham`\n- `DEBUG=true` (development mode)\n- `ENVIRONMENT=development`\n\n### Production\n\n```bash\n# Install production dependencies\npip install -e .\n\n# Run with Gunicorn (recommended for production)\ngunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker\n```\n\n## 📊 API Endpoints\n\n### System \u0026 Health Monitoring\n- `GET /api/v1/system/health` - Complete health check with database connectivity and pool status\n- `GET /api/v1/system/health/live` - Kubernetes liveness probe (simple alive check)\n- `GET /api/v1/system/health/ready` - Kubernetes readiness probe (database connectivity)\n- `GET /api/v1/system/info` - Detailed service information and configuration\n- `GET /api/v1/` - API root endpoint with navigation links\n\n### Authentication\n- `POST /api/v1/auth/login/` - User login with OAuth2PasswordRequestForm\n- `POST /api/v1/auth/register/` - User registration with password hashing\n- `GET /api/v1/auth/me/` - Get current authenticated user info\n\n### Resources\n- `GET /api/v1/buyers/` - List buyers\n- `POST /api/v1/buyers/` - Create buyer\n- `GET /api/v1/cars/` - List cars\n- `POST /api/v1/cars/` - Create car\n- `GET /api/v1/sales/` - List sales\n- `POST /api/v1/sales/` - Create sale\n\n### Health Check Examples\n\n#### Basic Health Check\n```bash\ncurl http://localhost:8000/api/v1/system/health\n```\n\nResponse:\n```json\n{\n  \"status\": \"healthy\",\n  \"timestamp\": \"2024-01-01T00:00:00Z\",\n  \"version\": \"1.0.0\",\n  \"service\": \"fastapi-car-shop-erp\",\n  \"checks\": {\n    \"database\": {\n      \"status\": \"healthy\",\n      \"message\": \"Database connection successful\"\n    },\n    \"database_pool\": {\n      \"status\": \"healthy\",\n      \"pool_size\": 5,\n      \"checked_in\": 5,\n      \"checked_out\": 0,\n      \"overflow\": 0\n    }\n  }\n}\n```\n\n#### Service Information\n```bash\ncurl http://localhost:8000/api/v1/system/info\n```\n\nResponse:\n```json\n{\n  \"service\": {\n    \"name\": \"fastapi-car-shop-erp\",\n    \"version\": \"1.0.0\",\n    \"description\": \"Professional ERP system for car shop management\",\n    \"author\": \"Sham Vinicius Fiorin\"\n  },\n  \"technology\": {\n    \"framework\": \"FastAPI\",\n    \"database\": \"PostgreSQL\",\n    \"orm\": \"SQLAlchemy\",\n    \"authentication\": \"JWT OAuth2\"\n  },\n  \"environment\": {\n    \"debug\": false,\n    \"database_configured\": true,\n    \"secret_key_configured\": true,\n    \"environment\": \"development\"\n  }\n}\n```\n\n### Kubernetes Integration\n\nThe health endpoints are designed for Kubernetes orchestration:\n\n```yaml\n# Kubernetes Deployment Example\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: fastapi-erp\nspec:\n  template:\n    spec:\n      containers:\n      - name: app\n        image: fastapi-erp:latest\n        ports:\n        - containerPort: 8000\n        livenessProbe:\n          httpGet:\n            path: /api/v1/system/health/live\n            port: 8000\n          initialDelaySeconds: 30\n          periodSeconds: 10\n        readinessProbe:\n          httpGet:\n            path: /api/v1/system/health/ready\n            port: 8000\n          initialDelaySeconds: 5\n          periodSeconds: 5\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run tests and code quality checks\n5. Submit a pull request\n\n---\n\n## Source Documentation\n\n- [FastAPI](https://fastapi.tiangolo.com/)\n- [Bigger Application](https://fastapi.tiangolo.com/tutorial/bigger-applications/)\n- [SQL](https://fastapi.tiangolo.com/tutorial/sql-databases/)\n- [Pagination](https://uriyyo-fastapi-pagination.netlify.app/)\n- [Testing](https://fastapi.tiangolo.com/tutorial/testing/)  \n- [Pydantic](https://pydantic-docs.helpmanual.io/)  \n- [SQL Relational Database SQLAlchemy by FastAPI](https://fastapi.tiangolo.com/tutorial/sql-databases/?h=databa#sql-relational-databases)\n- [SQLAlchemy 1.4](https://docs.sqlalchemy.org/en/14/tutorial/engine.html)  \n- [FastAPI Full Stack Template](https://github.com/fastapi/full-stack-fastapi-template)\n- [FastAPI \"Real world example app\"](https://github.com/nsidnev/fastapi-realworld-example-app)\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## Created by\n\u003e Sham Vinicius Fiorin\n\n**Built with ❤️ using FastAPI and modern Python patterns**\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskatesham%2Ffastapi-bigger-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskatesham%2Ffastapi-bigger-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskatesham%2Ffastapi-bigger-application/lists"}