🏛️ ADR-001: FastAPI for Backend Services
Context
We need a modern, high-performance web framework to build the SplitDee backend. The backend must handle user requests, real-time message notifications, and image upload streams for AI slip OCR processing.
Alternatives Considered
- Django / Django REST Framework (DRF): Highly robust but carries significant overhead, lacks native asynchronous performance out of the box, and setup is complex.
- Node.js (Express / NestJS): Excellent for real-time and I/O tasks, but limits integration with the Python AI ecosystem (OCR, image matching libraries).
- FastAPI (Selected): A modern, high-performance Python framework based on standard type hints.
Decision
We selected FastAPI for our backend microservices.
Consequences
- Asynchronous Execution: FastAPI’s ASGI support permits high-concurrency requests, which is essential for asynchronous slip scanning and chat message streams.
- Python Ecosystem: Native integration with Python data science, OCR, and AI libraries.
- Auto-generated Documentation: Automatic OpenAPI and Swagger UI generation streamlines frontend integration.
- Strict Typing: Built on Pydantic, ensuring rigorous request/response data validation.