# haraprasadgouda/subtrack-odoo architecture

> Architecture diagram of the GitHub repository haraprasadgouda/subtrack-odoo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/haraprasadgouda/subtrack-odoo
- Repository: https://github.com/haraprasadgouda/subtrack-odoo

## Overview

SubTrack manages subscription setup through lifecycle operations, invoicing, payments and customer self-service. The React application routes role-specific users to management and portal screens; FastAPI registers the corresponding API domains, with SQLAlchemy-backed state. The graph preserves documented capabilities even where implementation excerpts were unavailable; those relationships are shown as unverified rather than asserted. Sampled service code confirms subscription-to-invoice and portal-to-payment behavior, while most router/service wiring was not sampled.

Main entry points: [`backend/app/main.py`](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/models`](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/backend/app/models) (Domain models), [`backend/app/services/invoice_service.py`](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/invoice_service.py) (Invoices, GST, PDF), [`backend/app/services/subscription_service.py`](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/subscription_service.py) (Subscription lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Role-based routes<br/>[App.jsx]"]
  node_management["Management screens"]
  node_portal_ui["Customer portal screens"]
  node_web_api["API clients"]
end

subgraph group_api["API and identity"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_auth_service["JWT and account service<br/>[auth_service.py]"]
  node_schemas["Request and response schemas"]
end

subgraph group_lifecycle["Subscription lifecycle"]
  node_catalog["Products and plans<br/>[product_service.py]"]
  node_quotes["Quotation templates"]
  node_subscriptions["Subscription lifecycle"]
  node_customers["Customer and risk<br/>[contact_service.py]"]
end

subgraph group_billing["Billing operations"]
  node_invoices["Invoices, GST, PDF<br/>[invoice_service.py]"]
  node_payments["Payment recording<br/>[invoice_service.py]"]
  node_dunning["Dunning reminders<br/>[dunning_service.py]"]
  node_analytics["Dashboard and analytics"]
  node_portal["Portal operations<br/>[portal_service.py]"]
end

subgraph group_storage["Persistence"]
  node_models["Domain models"]
  node_database[("SQLite database<br/>[database.py]")]
end

node_user(("Admin, staff, customer"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_management
node_app -->|"routes to"| node_portal_ui
node_management -.->|"requests"| node_web_api
node_portal_ui -.->|"requests"| node_web_api
node_web_api -.->|"calls API"| node_api_entry
node_api_entry -->|"registers"| node_auth_api
node_api_entry -.->|"registers routes"| node_catalog
node_api_entry -.->|"registers routes"| node_quotes
node_api_entry -.->|"registers routes"| node_subscriptions
node_api_entry -.->|"registers routes"| node_invoices
node_api_entry -.->|"registers routes"| node_dunning
node_api_entry -.->|"registers routes"| node_analytics
node_api_entry -.->|"registers routes"| node_portal
node_auth_api -->|"delegates"| node_auth_service
node_auth_service -->|"queries users"| node_models
node_subscriptions -->|"creates invoices"| node_invoices
node_portal -->|"records payments"| node_invoices
node_invoices -->|"reads and writes"| node_models
node_subscriptions -->|"reads and writes"| node_models
node_dunning -->|"reads invoice state"| node_models
node_portal -->|"reads portal state"| node_models
node_database -->|"provides ORM base"| node_models
node_invoices -->|"records"| node_payments
node_catalog -.->|"persists catalog"| node_models
node_quotes -.->|"starts subscription"| node_subscriptions
node_customers -.->|"manages contacts"| node_models
node_analytics -.->|"aggregates metrics"| node_models
node_schemas -.->|"validates payloads"| node_auth_api

click node_app "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/frontend/src/App.jsx"
click node_management "https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/pages"
click node_portal_ui "https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/pages/portal"
click node_web_api "https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/api"
click node_api_entry "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/main.py"
click node_auth_api "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/routers/auth.py"
click node_auth_service "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/auth_service.py"
click node_catalog "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/product_service.py"
click node_quotes "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/template_service.py"
click node_subscriptions "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/subscription_service.py"
click node_customers "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/contact_service.py"
click node_invoices "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/invoice_service.py"
click node_payments "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/invoice_service.py"
click node_dunning "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/dunning_service.py"
click node_analytics "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/dashboard_service.py"
click node_portal "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/portal_service.py"
click node_models "https://github.com/haraprasadgouda/subtrack-odoo/tree/main/backend/app/models"
click node_schemas "https://github.com/haraprasadgouda/subtrack-odoo/tree/main/backend/app/schemas"
click node_database "https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/core/database.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_management,node_portal_ui,node_web_api toneBlue
class node_api_entry,node_auth_api,node_auth_service,node_schemas toneAmber
class node_catalog,node_quotes,node_subscriptions,node_customers toneMint
class node_invoices,node_payments,node_dunning,node_analytics,node_portal toneRose
class node_models,node_database,node_user toneIndigo
```

## Components

### Web client

- [Role-based routes](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Management screens](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/pages): `frontend/src/pages`
- [Customer portal screens](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/pages/portal): `frontend/src/pages/portal`
- [API clients](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/frontend/src/api): `frontend/src/api`

### API and identity

- [FastAPI app](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication API](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [JWT and account service](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Request and response schemas](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/backend/app/schemas): `backend/app/schemas`

### Subscription lifecycle

- [Products and plans](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/product_service.py): `backend/app/services/product_service.py`
- [Quotation templates](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/template_service.py): `backend/app/services/template_service.py`
- [Subscription lifecycle](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/subscription_service.py): `backend/app/services/subscription_service.py`
- [Customer and risk](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/contact_service.py): `backend/app/services/contact_service.py`

### Billing operations

- [Invoices, GST, PDF](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/invoice_service.py): `backend/app/services/invoice_service.py`
- [Payment recording](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/invoice_service.py): `backend/app/services/invoice_service.py`
- [Dunning reminders](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/dunning_service.py): `backend/app/services/dunning_service.py`
- [Dashboard and analytics](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/dashboard_service.py): `backend/app/services/dashboard_service.py`
- [Portal operations](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/services/portal_service.py): `backend/app/services/portal_service.py`

### Persistence

- [Domain models](https://github.com/haraprasadgouda/subtrack-odoo/tree/main/backend/app/models): `backend/app/models`
- [SQLite database](https://github.com/haraprasadgouda/subtrack-odoo/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **Admin, staff, customer**

## Connections

- Admin, staff, customer → Role-based routes: uses (evidence: `frontend/src/App.jsx`)
- Role-based routes → Management screens: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Customer portal screens: routes to (evidence: `frontend/src/App.jsx`)
- Management screens → API clients: requests
- Customer portal screens → API clients: requests
- API clients → FastAPI app: calls API
- FastAPI app → Authentication API: registers (evidence: `backend/app/main.py`)
- FastAPI app → Products and plans: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Quotation templates: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Subscription lifecycle: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Invoices, GST, PDF: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Dunning reminders: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Dashboard and analytics: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Portal operations: registers routes (evidence: `backend/app/main.py`)
- Authentication API → JWT and account service: delegates (evidence: `backend/app/routers/auth.py`)
- JWT and account service → Domain models: queries users (evidence: `backend/app/services/auth_service.py`)
- Subscription lifecycle → Invoices, GST, PDF: creates invoices (evidence: `backend/app/services/subscription_service.py`)
- Portal operations → Invoices, GST, PDF: records payments (evidence: `backend/app/services/portal_service.py`)
- Invoices, GST, PDF → Domain models: reads and writes (evidence: `backend/app/services/invoice_service.py`)
- Subscription lifecycle → Domain models: reads and writes (evidence: `backend/app/services/subscription_service.py`)
- Dunning reminders → Domain models: reads invoice state (evidence: `backend/app/services/dunning_service.py`)
- Portal operations → Domain models: reads portal state (evidence: `backend/app/services/portal_service.py`)
- SQLite database → Domain models: provides ORM base (evidence: `backend/app/models/invoice.py`)
- Invoices, GST, PDF → Payment recording: records (evidence: `backend/app/services/invoice_service.py`)
- Products and plans → Domain models: persists catalog
- Quotation templates → Subscription lifecycle: starts subscription
- Customer and risk → Domain models: manages contacts
- Dashboard and analytics → Domain models: aggregates metrics
- Request and response schemas → Authentication API: validates payloads (evidence: `backend/app/routers/auth.py`)
