- Created Dockerfile for building and running the application with Uvicorn. - Added docker-compose.yml to manage application and PostgreSQL service. - Introduced Alembic migrations with initial schema for CRM domain objects. - Configured async SQLAlchemy engine for migrations. - Updated dependencies in uv.lock to include asyncpg, passlib, and pyjwt. |
||
|---|---|---|
| app | ||
| migrations | ||
| .dockerignore | ||
| .gitignore | ||
| .python-version | ||
| LICENSE | ||
| README.md | ||
| alembic.ini | ||
| docker-compose.yml | ||
| main.py | ||
| pyproject.toml | ||
| uv.lock | ||
README.md
Test Task CRM
FastAPI backend template that follows the architecture described in the system prompt: async SQLAlchemy ORM, Alembic-ready models, service/repository layers, JWT auth helpers, and Pydantic v2 schemas.
Quick start
- Create a
.envfile based on variables inapp/core/config.py. - Install dependencies:
uv sync - Run the development server:
uv run python main.py
Project layout
app/
api/ # FastAPI routers and dependencies
core/ # Settings, database, security helpers
models/ # SQLAlchemy models and Pydantic schemas
repositories/ # Data access layer (SQLAlchemy ORM usage)
services/ # Business logic (auth, users, etc.)
Add new routers under app/api/v1, repositories under app/repositories, and keep business rules inside app/services.