# swayam7702/drf_project architecture

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

- Interactive diagram: https://gitdiagram.com/swayam7702/drf_project
- Repository: https://github.com/swayam7702/drf_project

## Overview

Card Wise is a credit-card and personal-finance management web app. The visible user journey is registration or login, authenticated dashboard access, and profile/card/financial-profile management through a React frontend and Django REST backend. Dashboard content is currently hard-coded rather than loaded from the API. Source evidence is incomplete: backend routing, card/profile views, and several frontend actions/loaders/services were not excerpted, so uncertain runtime links are omitted or marked unverified.

Main entry points: [`frontend/src/router/router.jsx`](https://github.com/swayam7702/drf_project/blob/main/frontend/src/router/router.jsx) (Route configuration), [`backend/backend/urls.py`](https://github.com/swayam7702/drf_project/blob/main/backend/backend/urls.py) (Django REST API), [`backend/cards/views.py`](https://github.com/swayam7702/drf_project/blob/main/backend/cards/views.py) (Card endpoints), [`frontend/src/App.jsx`](https://github.com/swayam7702/drf_project/blob/main/frontend/src/App.jsx) (React app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web frontend"]
  node_react_app["React app<br/>[App.jsx]"]
  node_route_config["Route configuration<br/>[router.jsx]"]
  node_auth_routes["Auth loaders and actions"]
  node_registration_page["Registration page<br/>[Register.jsx]"]
  node_login_page["Login page<br/>[LogInPage.jsx]"]
  node_main_layout["Main layout<br/>[MainLayout.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_profile_page["Profile page<br/>[Profile.jsx]"]
  node_api_client["API client<br/>[api.jsx]"]
end

subgraph group_identity["Identity and profile"]
  node_django_api["Django REST API<br/>[urls.py]"]
  node_user_endpoints["Account endpoints<br/>[views.py]"]
  node_user_serializers["Account validation<br/>[serializers.py]"]
  node_user_store[("User records<br/>[models.py]")]
end

subgraph group_finance["Financial data"]
  node_profile_endpoints["Financial profile endpoints<br/>[views.py]"]
  node_profile_validation["Financial profile validation<br/>[serializers.py]"]
  node_profile_store[("Financial profile records<br/>[models.py]")]
  node_card_endpoints["Card endpoints<br/>[views.py]"]
  node_card_validation["Card validation<br/>[serializers.py]"]
  node_card_store[("Credit card records<br/>[models.py]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_react_app
node_react_app -->|"provides routes"| node_route_config
node_route_config -->|"routes to"| node_main_layout
node_route_config -->|"runs loaders"| node_auth_routes
node_route_config -->|"routes to"| node_dashboard
node_route_config -->|"routes to"| node_profile_page
node_route_config -->|"routes to"| node_login_page
node_route_config -->|"routes to"| node_registration_page
node_registration_page -->|"posts registration"| node_django_api
node_login_page -.->|"submits login"| node_django_api
node_profile_page -.->|"requests profile"| node_api_client
node_dashboard -.->|"links to cards"| node_card_endpoints
node_api_client -.->|"calls API"| node_django_api
node_django_api -.->|"routes requests"| node_user_endpoints
node_django_api -.->|"routes requests"| node_card_endpoints
node_django_api -.->|"routes requests"| node_profile_endpoints
node_user_endpoints -->|"validates with"| node_user_serializers
node_user_serializers -->|"creates users"| node_user_store
node_profile_endpoints -.->|"serializes profile"| node_profile_validation
node_profile_validation -->|"validates records"| node_profile_store
node_card_endpoints -.->|"serializes cards"| node_card_validation
node_card_validation -->|"checks duplicates"| node_card_store

click node_react_app "https://github.com/swayam7702/drf_project/blob/main/frontend/src/App.jsx"
click node_route_config "https://github.com/swayam7702/drf_project/blob/main/frontend/src/router/router.jsx"
click node_auth_routes "https://github.com/swayam7702/drf_project/tree/main/frontend/src/router"
click node_registration_page "https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/Register.jsx"
click node_login_page "https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/LogInPage.jsx"
click node_main_layout "https://github.com/swayam7702/drf_project/blob/main/frontend/src/layouts/MainLayout.jsx"
click node_dashboard "https://github.com/swayam7702/drf_project/blob/main/frontend/src/dashboard/Dashboard.jsx"
click node_profile_page "https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/Profile.jsx"
click node_api_client "https://github.com/swayam7702/drf_project/blob/main/frontend/src/services/api.jsx"
click node_django_api "https://github.com/swayam7702/drf_project/blob/main/backend/backend/urls.py"
click node_user_endpoints "https://github.com/swayam7702/drf_project/blob/main/backend/users/views.py"
click node_user_serializers "https://github.com/swayam7702/drf_project/blob/main/backend/users/serializers.py"
click node_user_store "https://github.com/swayam7702/drf_project/blob/main/backend/users/models.py"
click node_profile_endpoints "https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/views.py"
click node_profile_validation "https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/serializers.py"
click node_profile_store "https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/models.py"
click node_card_endpoints "https://github.com/swayam7702/drf_project/blob/main/backend/cards/views.py"
click node_card_validation "https://github.com/swayam7702/drf_project/blob/main/backend/cards/serializers.py"
click node_card_store "https://github.com/swayam7702/drf_project/blob/main/backend/cards/models.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_react_app,node_route_config,node_auth_routes,node_registration_page,node_login_page,node_main_layout,node_dashboard,node_profile_page,node_api_client toneBlue
class node_django_api,node_user_endpoints,node_user_serializers,node_user_store toneAmber
class node_profile_endpoints,node_profile_validation,node_profile_store,node_card_endpoints,node_card_validation,node_card_store toneMint
class node_visitor toneIndigo
```

## Components

### Web frontend

- [React app](https://github.com/swayam7702/drf_project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Route configuration](https://github.com/swayam7702/drf_project/blob/main/frontend/src/router/router.jsx): `frontend/src/router/router.jsx`
- [Auth loaders and actions](https://github.com/swayam7702/drf_project/tree/main/frontend/src/router): `frontend/src/router`
- [Registration page](https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Login page](https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/LogInPage.jsx): `frontend/src/pages/LogInPage.jsx`
- [Main layout](https://github.com/swayam7702/drf_project/blob/main/frontend/src/layouts/MainLayout.jsx): `frontend/src/layouts/MainLayout.jsx`
- [Dashboard](https://github.com/swayam7702/drf_project/blob/main/frontend/src/dashboard/Dashboard.jsx): `frontend/src/dashboard/Dashboard.jsx`
- [Profile page](https://github.com/swayam7702/drf_project/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [API client](https://github.com/swayam7702/drf_project/blob/main/frontend/src/services/api.jsx): `frontend/src/services/api.jsx`

### Identity and profile

- [Django REST API](https://github.com/swayam7702/drf_project/blob/main/backend/backend/urls.py): `backend/backend/urls.py`
- [Account endpoints](https://github.com/swayam7702/drf_project/blob/main/backend/users/views.py): `backend/users/views.py`
- [Account validation](https://github.com/swayam7702/drf_project/blob/main/backend/users/serializers.py): `backend/users/serializers.py`
- [User records](https://github.com/swayam7702/drf_project/blob/main/backend/users/models.py): `backend/users/models.py`

### Financial data

- [Financial profile endpoints](https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/views.py): `backend/financial_profiles/views.py`
- [Financial profile validation](https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/serializers.py): `backend/financial_profiles/serializers.py`
- [Financial profile records](https://github.com/swayam7702/drf_project/blob/main/backend/financial_profiles/models.py): `backend/financial_profiles/models.py`
- [Card endpoints](https://github.com/swayam7702/drf_project/blob/main/backend/cards/views.py): `backend/cards/views.py`
- [Card validation](https://github.com/swayam7702/drf_project/blob/main/backend/cards/serializers.py): `backend/cards/serializers.py`
- [Credit card records](https://github.com/swayam7702/drf_project/blob/main/backend/cards/models.py): `backend/cards/models.py`

### Other components

- **Visitor**

## Connections

- Visitor → React app: opens
- React app → Route configuration: provides routes (evidence: `frontend/src/App.jsx`)
- Route configuration → Main layout: routes to (evidence: `frontend/src/router/router.jsx`)
- Route configuration → Auth loaders and actions: runs loaders (evidence: `frontend/src/router/router.jsx`)
- Route configuration → Dashboard: routes to (evidence: `frontend/src/router/router.jsx`)
- Route configuration → Profile page: routes to (evidence: `frontend/src/router/router.jsx`)
- Route configuration → Login page: routes to (evidence: `frontend/src/router/router.jsx`)
- Route configuration → Registration page: routes to (evidence: `frontend/src/router/router.jsx`)
- Registration page → Django REST API: posts registration (evidence: `frontend/src/pages/Register.jsx`)
- Login page → Django REST API: submits login
- Profile page → API client: requests profile
- Dashboard → Card endpoints: links to cards
- API client → Django REST API: calls API
- Django REST API → Account endpoints: routes requests
- Django REST API → Card endpoints: routes requests
- Django REST API → Financial profile endpoints: routes requests
- Account endpoints → Account validation: validates with (evidence: `backend/users/views.py`)
- Account validation → User records: creates users (evidence: `backend/users/serializers.py`)
- Financial profile endpoints → Financial profile validation: serializes profile
- Financial profile validation → Financial profile records: validates records (evidence: `backend/financial_profiles/serializers.py`)
- Card endpoints → Card validation: serializes cards
- Card validation → Credit card records: checks duplicates (evidence: `backend/cards/serializers.py`)
