CRM API (FastAPI + SQLModel)
Quickstart (PostgreSQL)
- Start the local PostgreSQL service (we provide a docker-compose.yml):
 
docker-compose up -d- Create a Python venv and install dependencies:
 
python -m venv .venv; .\.venv\Scripts\Activate; pip install -r requirements.txt- Ensure the 
DATABASE_URLenvironment variable is set to point at the Postgres DB used above. Example (PowerShell): 
$env:DATABASE_URL = 'postgresql+psycopg2://crm:crm_pass@127.0.0.1:5432/crm_dev'- Apply Alembic migrations (creates the schema in Postgres):
 
.\.venv\Scripts\python -m alembic upgrade head- (Optional) Seed sample data:
 
.\.venv\Scripts\python scripts/seed.py- Run the app with Uvicorn:
 
uvicorn app.main:app --reload --host 127.0.0.1 --port 4000- Open http://127.0.0.1:4000/docs for the interactive API docs.
 
Notes
- This project is Postgres-first. SQLite is no longer supported.
 - For CI, start a Postgres service in your workflow and run Alembic before test steps.
 - See 
scripts/manage.ps1for convenience commands on Windows (start DB, migrate, seed, test).