# SACMC Connect

Production foundation for an enterprise church management system: FastAPI, Python 3.13, PostgreSQL, SQLAlchemy 2.0, Alembic, JWT, and Docker Compose.

## Layout

```text
backend/app/api       HTTP routes and dependencies
backend/app/core      configuration and security
backend/app/database  SQLAlchemy engine, sessions, and base
backend/app/models    persistence models
backend/app/schemas   request/response contracts
backend/app/services  business use cases
backend/alembic       database migrations
backend/tests         backend tests
frontend              future client application
docs                  architecture documentation
```

No business-domain modules are included until their requirements are defined. Add each bounded context through reviewed models, schemas, services, routes, and Alembic revisions.

## Start locally

1. Copy `.env.example` to `.env` and replace all placeholders.
2. Run `docker compose up --build`.
3. The readiness endpoint is `GET /api/v1/health`.

For a non-container workflow, install `backend/requirements.txt`, set `POSTGRES_HOST=localhost`, run `alembic upgrade head` from `backend`, then run `uvicorn app.main:app --reload`.

## Operational practices

- Store production configuration in a secret manager, never in source control.
- Use a unique, high-entropy `SECRET_KEY` for every environment.
- Review every autogenerated Alembic revision before committing it.
- Deploy migrations as a single controlled release step; scale API workers separately.
