Production-grade backend service for managing subscriptions, billing, and order lifecycles in a SaaS-like environment.
This project simulates a real-world backend responsible for subscription management, billing workflows, and access control.
The focus is on clean architecture, business-oriented modeling, and explicit trade-offs, rather than CRUD-only APIs.
- User and account management
- Subscription plans and lifecycle handling
- Billing and payment workflows (mocked external provider)
- Role-based access control (RBAC)
- Webhook ingestion with idempotency
- Input validation and structured error handling
The system follows a layered architecture inspired by DDD, without overengineering:
- domain → business rules and entities
- application → use cases and orchestration
- infrastructure → database, auth, and web frameworks
This separation allows:
- Business logic to remain framework-agnostic
- Easier testing of domain rules
- Clear ownership of responsibilities
- Python
- FastAPI
- PostgreSQL
- SQLAlchemy
- JWT / OAuth2
- Pytest
- Monolithic architecture: chosen for simplicity and operational clarity
- FastAPI: async support and strong OpenAPI integration
- PostgreSQL: transactional consistency and mature ecosystem
- Explicit use cases instead of fat controllers
- Unit tests for domain logic
- Focus on business rules rather than framework behavior
- Microservices architecture
- Frontend application
- Real payment provider integration
- Async task processing
- Rate limiting
- Audit logs