# Backend

تمام کد منبع backend فقط در این پوشه قرار دارد.

## Structure

```
backend/
├── core-service/   # Core Platform (FastAPI) — Active
├── shared-lib/     # Shared backend library
└── services/       # identity-access (Active) + future module placeholders
```

## Rules (mandatory)

- **No** React, Next.js, Tailwind, UI components, or HTML pages in backend.
- Frontend lives only in `frontend/`.
- Communicate with frontend only via versioned REST APIs.
- Database-per-service; no cross-DB access.
- Follow [`docs/development/project-principles.md`](../docs/development/project-principles.md)
  and [`docs/architecture/module-boundaries.md`](../docs/architecture/module-boundaries.md).

## Run Core

```bash
cd backend/core-service
python -m venv .venv
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reload
```

## Tests

```bash
cd backend/core-service
pytest -q
```

## Related Documents

- [Developer Guide](../docs/development/developer-guide.md)
- [Module Registry](../docs/module-registry.md)
- [Services Contracts](../docs/reference/services-contracts.md)
- [Services README](services/README.md)
