# jayjaychukwu/expense-tracker-api architecture

> Architecture diagram of the GitHub repository jayjaychukwu/expense-tracker-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jayjaychukwu/expense-tracker-api
- Repository: https://github.com/jayjaychukwu/expense-tracker-api

## Overview

##### Project type and purpose
- This is a Django-based RESTful API (backend-only) for an expense-tracking application.
- It exposes endpoints for user authentication, expense management, income tracking, and user statistics.

##### File structure
Top-level:
- expense_project/ – the Django project root (settings.py, URLs, ASGI/WSGI)
- manage.py – Django CLI entry point
- db.sqlite3 – development database
- requirements.txt, runtime.txt – dependency/runtime specs
- .circleci/config.yml – CI/CD pipeline configuration

Django apps (each encapsulates one domain):
- authentication/ – signup, login, token/session management
- expenses/ – create/read/update/delete expense records
- income/ – create/read/update/delete income records
- userstats/ – aggregated user metrics (e.g., monthly spend)
- utils/ – shared exception handlers and view mixins

Each app follows the Django‐REST‐Framework pattern:
- models.py – data schema (ORM)
- serializers.py – request/response validation & formatting
- views.py – API view logic
- urls.py – routing to views
- tests/ – unit and integration tests
- migrations/ – DB schema versioning

##### README
- Minimal README (just the project name).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer" 
        direction TB
        Client["User Interface (Web/Mobile)"]:::client
    end

    %% API Layer
    subgraph "API/Application Layer"
        direction TB
        WebServer["Gunicorn/Uvicorn (WSGI/ASGI Server)"]:::api

        subgraph "Django Project Configuration"
            direction TB
            Settings["settings.py"]:::config
            URLs["urls.py"]:::config
            ASGI["asgi.py"]:::config
            WSGI["wsgi.py"]:::config
        end

        CLI["manage.py"]:::config

        subgraph "Django Apps" 
            direction TB
            AuthApp["Authentication App"]:::app
            ExpensesApp["Expenses App"]:::app
            IncomeApp["Income App"]:::app
            StatsApp["UserStats App"]:::app
            UtilsApp["Utils (Exception & View Mixins)"]:::app
        end
    end

    %% Data Layer
    Database[(SQLite / Postgres DB)]:::db

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        direction TB
        CI["CircleCI Pipeline"]:::infra
        Deploy["Deployment (Docker / Heroku / AWS)"]:::infra
    end

    %% Connections
    Client -->|"HTTP(S) Request"| WebServer
    WebServer -->|"Route via urls.py"| URLs
    URLs --> AuthApp
    URLs --> ExpensesApp
    URLs --> IncomeApp
    URLs --> StatsApp
    AuthApp --> UtilsApp
    ExpensesApp --> UtilsApp
    IncomeApp --> UtilsApp
    StatsApp --> ExpensesApp
    StatsApp --> IncomeApp
    AuthApp --> Database
    ExpensesApp --> Database
    IncomeApp --> Database
    StatsApp --> Database
    WebServer --> CLI
    CLI --> Settings
    CLI --> URLs
    CLI --> ASGI
    CLI --> WSGI
    CI -->|Runs Tests & Lint| AuthApp
    CI -->|Runs Tests & Lint| ExpensesApp
    CI -->|Runs Tests & Lint| IncomeApp
    CI -->|Runs Tests & Lint| StatsApp
    CI -->|Runs Tests & Lint| UtilsApp
    CI --> Deploy

    Database -->|"Data Response"| StatsApp
    WebServer -->|"HTTP Response"| Client

    %% Click Events
    click Settings "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/expense_project/settings.py"
    click URLs "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/expense_project/urls.py"
    click ASGI "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/expense_project/asgi.py"
    click WSGI "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/expense_project/wsgi.py"
    click CLI "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/manage.py"
    click CI "https://github.com/jayjaychukwu/expense-tracker-api/blob/master/.circleci/config.yml"
    click AuthApp "https://github.com/jayjaychukwu/expense-tracker-api/tree/master/authentication/"
    click ExpensesApp "https://github.com/jayjaychukwu/expense-tracker-api/tree/master/expenses/"
    click IncomeApp "https://github.com/jayjaychukwu/expense-tracker-api/tree/master/income/"
    click StatsApp "https://github.com/jayjaychukwu/expense-tracker-api/tree/master/userstats/"
    click UtilsApp "https://github.com/jayjaychukwu/expense-tracker-api/tree/master/utils/"

    %% Styles
    classDef client fill:#cce5ff,stroke:#004085,color:#004085;
    classDef api fill:#d4edda,stroke:#155724,color:#155724;
    classDef config fill:#fff3cd,stroke:#856404,color:#856404;
    classDef app fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef db fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef infra fill:#d1ecf1,stroke:#0c5460,color:#0c5460;
```
