# ramhali/elco-accounting architecture

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

- Interactive diagram: https://gitdiagram.com/ramhali/elco-accounting
- Repository: https://github.com/ramhali/elco-accounting

## Overview

This repository is an administrative web application: a React dashboard presents sign-in/sign-up and operational pages, while a Django backend exposes user and master-data functionality. The main business workflow is maintaining suppliers, employees, departments, and chart-of-account records through frontend service calls and backend model-backed creation logic. The dashboard also includes calendar, charts, profiles, and reusable UI pages. Source evidence is limited to the supplied excerpts and SOURCE INDEX; unshown page-to-service and backend routing links are not asserted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/App.tsx) (Page routing), [`frontend/src/api/axios.ts`](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/api/axios.ts) (HTTP client), [`frontend/src/main.tsx`](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/main.tsx) (App bootstrap), [`backend/mdsetup/views.py`](https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/views.py) (Master-data handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_entry["App bootstrap<br/>[main.tsx]"]
  node_router["Page routing<br/>[App.tsx]"]
  node_layout["Dashboard layout<br/>[AppLayout.tsx]"]
  node_sidebarstate["Sidebar state<br/>[SidebarContext.tsx]"]
  node_themestate["Theme state<br/>[ThemeContext.tsx]"]
  node_dashboard["Dashboard and tools"]
  node_calendar["Calendar<br/>[Calendar.tsx]"]
  node_ui["UI element pages"]
end

subgraph group_master["Master data"]
  node_masterpages["Master-data pages"]
  node_supplierui["Supplier service<br/>[supplierService.ts]"]
  node_employeeui["Employee service<br/>[employeeService.ts]"]
  node_departmentui["Department service"]
  node_accountui["Account service<br/>[accountService.ts]"]
  node_http["HTTP client<br/>[axios.ts]"]
end

subgraph group_backend["Django backend"]
  node_api{{"Backend API"}}
  node_views["Master-data handlers<br/>[views.py]"]
  node_serializers["Data serializers<br/>[serializers.py]"]
  node_services["Master-data operations<br/>[services.py]"]
  node_models[("Master-data records<br/>[models.py]")]
end

subgraph group_identity["Identity"]
  node_authpages["Sign-in and sign-up"]
  node_authapi["Authentication API"]
  node_users["User handlers<br/>[views.py]"]
  node_usermodel[("User records<br/>[models.py]")]
end

node_user(("Dashboard user"))

node_user -->|"opens"| node_entry
node_entry -->|"renders"| node_router
node_entry -->|"provides theme"| node_themestate
node_router -->|"routes through"| node_layout
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_calendar
node_router -->|"routes to"| node_ui
node_router -->|"routes to"| node_masterpages
node_router -->|"routes to"| node_authpages
node_layout -->|"uses state"| node_sidebarstate
node_supplierui -->|"calls"| node_http
node_employeeui -->|"calls"| node_http
node_departmentui -->|"calls"| node_http
node_accountui -->|"calls"| node_http
node_http -.->|"sends requests"| node_api
node_api -.->|"dispatches"| node_views
node_views -->|"calls"| node_services
node_views -->|"uses"| node_serializers
node_services -->|"queries and creates"| node_models
node_authpages -.->|"uses"| node_authapi
node_authapi -->|"uses client"| node_http
node_users -.->|"uses records"| node_usermodel
node_models -->|"references user"| node_usermodel

click node_entry "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/main.tsx"
click node_router "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/App.tsx"
click node_layout "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/layout/AppLayout.tsx"
click node_sidebarstate "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/context/SidebarContext.tsx"
click node_themestate "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/context/ThemeContext.tsx"
click node_dashboard "https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages"
click node_calendar "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/pages/Calendar.tsx"
click node_ui "https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/UiElements"
click node_masterpages "https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/MasterData"
click node_supplierui "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/suppliers/supplierService.ts"
click node_employeeui "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/employees/employeeService.ts"
click node_departmentui "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/departments/departmentService.ts"
click node_accountui "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/chartofaccounts/accountService.ts"
click node_http "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/api/axios.ts"
click node_views "https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/views.py"
click node_serializers "https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/serializers.py"
click node_services "https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/services.py"
click node_models "https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/models.py"
click node_authpages "https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/AuthPages"
click node_authapi "https://github.com/ramhali/elco-accounting/blob/main/frontend/src/api/apiAuthentication.ts"
click node_users "https://github.com/ramhali/elco-accounting/blob/main/backend/users/views.py"
click node_usermodel "https://github.com/ramhali/elco-accounting/blob/main/backend/users/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_entry,node_router,node_layout,node_sidebarstate,node_themestate,node_dashboard,node_calendar,node_ui,node_user toneBlue
class node_masterpages,node_supplierui,node_employeeui,node_departmentui,node_accountui,node_http toneAmber
class node_api,node_views,node_serializers,node_services,node_models toneMint
class node_authpages,node_authapi,node_users,node_usermodel toneRose
```

## Components

### Web application

- [App bootstrap](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Page routing](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard layout](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/layout/AppLayout.tsx): `frontend/src/layout/AppLayout.tsx`
- [Sidebar state](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/context/SidebarContext.tsx): `frontend/src/context/SidebarContext.tsx`
- [Theme state](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/context/ThemeContext.tsx): `frontend/src/context/ThemeContext.tsx`
- [Dashboard and tools](https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages): `frontend/src/pages`
- [Calendar](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/pages/Calendar.tsx): `frontend/src/pages/Calendar.tsx`
- [UI element pages](https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/UiElements): `frontend/src/pages/UiElements`

### Master data

- [Master-data pages](https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/MasterData): `frontend/src/pages/MasterData`
- [Supplier service](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/suppliers/supplierService.ts): `frontend/src/components/suppliers/supplierService.ts`
- [Employee service](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/employees/employeeService.ts): `frontend/src/components/employees/employeeService.ts`
- [Department service](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/departments/departmentService.ts): `frontend/src/components/departments/departmentService.ts`
- [Account service](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/components/chartofaccounts/accountService.ts): `frontend/src/components/chartofaccounts/accountService.ts`
- [HTTP client](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/api/axios.ts): `frontend/src/api/axios.ts`

### Django backend

- **Backend API**
- [Master-data handlers](https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/views.py): `backend/mdsetup/views.py`
- [Data serializers](https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/serializers.py): `backend/mdsetup/serializers.py`
- [Master-data operations](https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/services.py): `backend/mdsetup/services.py`
- [Master-data records](https://github.com/ramhali/elco-accounting/blob/main/backend/mdsetup/models.py): `backend/mdsetup/models.py`

### Identity

- [Sign-in and sign-up](https://github.com/ramhali/elco-accounting/tree/main/frontend/src/pages/AuthPages): `frontend/src/pages/AuthPages`
- [Authentication API](https://github.com/ramhali/elco-accounting/blob/main/frontend/src/api/apiAuthentication.ts): `frontend/src/api/apiAuthentication.ts`
- [User handlers](https://github.com/ramhali/elco-accounting/blob/main/backend/users/views.py): `backend/users/views.py`
- [User records](https://github.com/ramhali/elco-accounting/blob/main/backend/users/models.py): `backend/users/models.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → App bootstrap: opens
- App bootstrap → Page routing: renders (evidence: `frontend/src/main.tsx`)
- App bootstrap → Theme state: provides theme (evidence: `frontend/src/main.tsx`)
- Page routing → Dashboard layout: routes through (evidence: `frontend/src/App.tsx`)
- Page routing → Dashboard and tools: routes to (evidence: `frontend/src/App.tsx`)
- Page routing → Calendar: routes to (evidence: `frontend/src/App.tsx`)
- Page routing → UI element pages: routes to (evidence: `frontend/src/App.tsx`)
- Page routing → Master-data pages: routes to (evidence: `frontend/src/App.tsx`)
- Page routing → Sign-in and sign-up: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard layout → Sidebar state: uses state (evidence: `frontend/src/layout/AppLayout.tsx`)
- Supplier service → HTTP client: calls (evidence: `frontend/src/components/suppliers/supplierService.ts`)
- Employee service → HTTP client: calls (evidence: `frontend/src/components/employees/employeeService.ts`)
- Department service → HTTP client: calls (evidence: `frontend/src/components/departments/departmentService.ts`)
- Account service → HTTP client: calls (evidence: `frontend/src/components/chartofaccounts/accountService.ts`)
- HTTP client → Backend API: sends requests
- Backend API → Master-data handlers: dispatches
- Master-data handlers → Master-data operations: calls (evidence: `backend/mdsetup/views.py`)
- Master-data handlers → Data serializers: uses (evidence: `backend/mdsetup/views.py`)
- Master-data operations → Master-data records: queries and creates (evidence: `backend/mdsetup/services.py`)
- Sign-in and sign-up → Authentication API: uses
- Authentication API → HTTP client: uses client (evidence: `frontend/src/api/apiAuthentication.ts`)
- User handlers → User records: uses records
- Master-data records → User records: references user (evidence: `backend/mdsetup/models.py`)
