PrathamCare is a production-grade backend system for Health Centre & Supply Chain Intelligence. Built with modern technologies focusing on scalability, maintainability, and clean architecture principles.
- Python 3.11+
- FastAPI: High-performance web framework for APIs.
- uv: Extremely fast Python package and project manager.
- Clean Architecture: Domain, Application, Infrastructure, and API layers to ensure business logic is isolated and fully testable.
This project follows Clean / Hexagonal Architecture (Ports & Adapters) — structuring code by layers:
- Domain Layer (
src/prathamcare/domain): Core business entities, value objects, pure business rules, and interface definitions (ports). No external dependencies. - Application Layer (
src/prathamcare/application): Use-cases and orchestration. Links the domain layer with infrastructure adapters. - Infrastructure Layer (
src/prathamcare/infrastructure): Concrete adapters for persistence (Firestore/BigQuery), AI (Gemini/Speech), forecasting (Prophet), and external services. - API Layer (
src/prathamcare/api): Controllers, HTTP/WebSocket routing, request validation, and middlewares. - Core (
src/prathamcare/core): Cross-cutting concerns like dependency injection, configuration, logging, and security.
- Install
uv(Python packaging tool).
# Clone the repository and navigate to the backend folder
cd PrathamCare-Backend
# The project is managed by uv. To sync dependencies:
uv sync
# To run the development server
uv run fastapi dev src/prathamcare/api/server.pyTo add any package, use uv add:
uv add <package_name>The codebase structure is designed for complete testability via mockable adapters:
- Unit Tests: Test domain rules and application use cases with zero external network calls.
- Integration Tests: Tests with actual infrastructure (e.g., Firestore emulator).
# Run tests using pytest
uv run pytest