Skip to content

Production-grade Python backend for subscription billing, orders, and access control, designed with clean architecture and real-world trade-offs.

Notifications You must be signed in to change notification settings

rfransozo/Python-Subscription-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Subscription Platform

Production-grade backend service for managing subscriptions, billing, and order lifecycles in a SaaS-like environment.

Overview

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.

Core Features

  • 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

Architecture

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

Tech Stack

  • Python
  • FastAPI
  • PostgreSQL
  • SQLAlchemy
  • JWT / OAuth2
  • Pytest

Design Decisions

  • 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

Testing Strategy

  • Unit tests for domain logic
  • Focus on business rules rather than framework behavior

Non-Goals

  • Microservices architecture
  • Frontend application
  • Real payment provider integration

Future Improvements

  • Async task processing
  • Rate limiting
  • Audit logs

About

Production-grade Python backend for subscription billing, orders, and access control, designed with clean architecture and real-world trade-offs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages