A modern web API built with FastAPI, using Poetry for dependency management and Alembic for database migrations.
- Fast and high-performance API endpoints
- Automatic interactive API documentation
- Type hints throughout the codebase
- Database integration with SQLAlchemy ORM
- Database migrations using Alembic
- Dependency management with Poetry
- FastAPI - Modern, fast web framework for building APIs
- Pydantic - Data validation and settings management
- SQLAlchemy - SQL toolkit and ORM
- Alembic - Database migration tool
- Poetry - Dependency management and packaging
- Uvicorn - ASGI server
- Python 3.8 or higher
- Poetry
- Clone the repository:
git clone https://github.com/username/app-api.git
cd app-api
- Install dependencies with Poetry:
poetry install
- Set up environment variables:
cp .env.example .env
# Edit .env file with your configuration
- Run database migrations:
poetry run db-migrate
# Development mode
poetry run startThe API will be available at http://localhost:8000.
FastAPI provides automatic interactive API documentation:
- Swagger UI: http://localhost:8000/docs
├── app/
│ ├── api/ # API endpoints
│ ├── core/ # Core functionality
│ ├── models/ # SQLAlchemy models
│ ├── repos/ # Repositories
│ ├── schemas/ # Pydantic schemas
│ ├── services/ # Application services
│ └── main.py # Application entry point
├── alembic/ # Alembic migrations
├── tests/ # Test suite
├── pyproject.toml # Poetry configuration
└── alembic.ini # Alembic configuration
This project uses Alembic for database migrations.
poetry run db-generate "description of the change"poetry run db-migrate- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request