How avinashcreates/billsphere works
BillSphere is a subscription-billing platform with customer and administrator experiences. Customers register, choose a plan, subscribe, pay, and receive invoices and billing updates; recurring billing and failed-payment recovery run in the background. The graph shows the documented lifecycle and the sampled API, billing, payment, persistence, and worker layers. Several service-to-route and browser-to-API connections are not established by the excerpts, so they are omitted rather than inferred.
Main entry points: router.py Versioned API router · billing_cycle_service.py Recurring billing · payment_service.py Payment processing · App.tsx Web application
Components 24
User experiences
- Web application
INFY/frontend/src/App.tsx - Customer billing pages
INFY/frontend/src/pages - Admin dashboard
INFY/frontend/src/pages/AdminDashboard.tsx - Frontend authentication
INFY/frontend/src/contexts/AuthContext.tsx - Frontend API client
INFY/frontend/src/services/api.ts
API and access
- FastAPI application
INFY/backend/app/main.py - Versioned API router
INFY/backend/app/api/v1/router.py - Authentication service
INFY/backend/app/services/auth_service.py - Subscription endpoints
INFY/backend/app/api/v1/subscriptions.py - Billing endpoints
INFY/backend/app/api/v1/billing_cycles.py - Payment endpoints
INFY/backend/app/api/v1/payments.py - Analytics and reporting
INFY/backend/app/api/v1/analytics.py - Notifications
INFY/backend/app/api/v1/notifications.py - Webhook endpoints
INFY/backend/app/api/v1/webhooks.py
Billing operations
- Subscription lifecycle
INFY/backend/app/services/subscription_service.py - Recurring billing
INFY/backend/app/services/billing_cycle_service.py - Payment processing
INFY/backend/app/services/payment_service.py - Invoice generation
INFY/backend/app/services/invoice_service.py - Failed-payment recovery
INFY/backend/app/services/payment_service.py
Persistence and background
- Billing records
INFY/backend/app/models - PostgreSQL
- Background billing tasks
INFY/backend/app/workers/tasks.py
Other components
- Customer
- Administrator
Connections 30
- Customer → Web application: uses
README.md - Administrator → Web application: uses
README.md - Web application → Customer billing pages: routes to
INFY/frontend/src/App.tsx - Web application → Admin dashboard: routes to
INFY/frontend/src/App.tsx - Web application → Frontend authentication: provides access
- Customer billing pages → Frontend API client: requests data
- Admin dashboard → Frontend API client: requests data
- Frontend API client → FastAPI application: calls API
- FastAPI application → Versioned API router: mounts routes
INFY/backend/app/main.py - Versioned API router → Subscription endpoints: registers
INFY/backend/app/api/v1/router.py - Versioned API router → Billing endpoints: registers
INFY/backend/app/api/v1/router.py - Versioned API router → Payment endpoints: registers
INFY/backend/app/api/v1/router.py - Versioned API router → Analytics and reporting: registers
INFY/backend/app/api/v1/router.py - Versioned API router → Notifications: registers
INFY/backend/app/api/v1/router.py - Versioned API router → Webhook endpoints: registers
INFY/backend/app/api/v1/router.py - Subscription lifecycle → Recurring billing: delegates billing
INFY/backend/app/services/subscription_service.py - Subscription lifecycle → Payment processing: calls payment
INFY/backend/app/services/subscription_service.py - Recurring billing → Invoice generation: uses invoicing
INFY/backend/app/services/billing_cycle_service.py - Payment processing → Invoice generation: uses invoices
INFY/backend/app/services/payment_service.py - Recurring billing → Billing records: reads and writes
INFY/backend/app/services/billing_cycle_service.py - Payment processing → Billing records: reads and writes
INFY/backend/app/services/payment_service.py - Billing records → PostgreSQL: persists records
- Background billing tasks → Recurring billing: runs billing
INFY/backend/app/workers/tasks.py - Background billing tasks → Payment processing: runs retries
INFY/backend/app/workers/tasks.py - Customer → Subscription endpoints: selects plan
README.md - Subscription endpoints → Subscription lifecycle: handles lifecycle
- Billing endpoints → Recurring billing: handles cycles
- Payment endpoints → Payment processing: handles payments
- Recurring billing → Invoice generation: generates invoices
README.md - Payment processing → Failed-payment recovery: schedules recovery
README.md