A modern FastAPI admin template with SQLModel and Starlette Admin.
- Python 3.11 or higher
- PostgreSQL
- UV package manager
- Install UV if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh- Create and activate a virtual environment:
uv venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows- Install dependencies:
uv pip install -e ".[dev]"- Copy
.env.exampleto.envand configure your environment variables:
cp .env.example .env- Initialize the database:
alembic upgrade headStart the development server:
uvicorn app.main:app --reloadThe admin interface will be available at http://localhost:8000/admin
Run the test suite:
# Run all tests
pytest
# Run tests with coverage report
pytest --cov=app
# Run specific test file
pytest tests/test_specific.py# Lint your code
ruff check .
# Lint with auto-fix
ruff check --fix .
# Format your code
ruff format .# Create a new migration
alembic revision --autogenerate -m "describe your changes"
# Apply all pending migrations
alembic upgrade head
# Rollback last migration
alembic downgrade -1
# Check current migration status
alembic currentfastapi-admin-template/
├── app/
│ ├── api/
│ ├── core/
│ ├── models/
│ └── main.py
├── alembic/
├── tests/
└── pyproject.toml