# 26wekesa/darasa-hub architecture

> Architecture diagram of the GitHub repository 26wekesa/darasa-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/26wekesa/darasa-hub
- Repository: https://github.com/26wekesa/darasa-hub

## Overview

ECDE Resource Hub is a Phase 1 foundation for a Kenya CBC-aligned resource platform, not yet a complete discovery or purchase workflow: the frontend is a welcome page, and the README says feature APIs arrive in later phases. The intended domain is represented by account, catalogue, library, and payment apps; sampled models show users, teaching materials, files, reviews, orders, and payments. Django settings select PostgreSQL (or SQLite for tests). The graph distinguishes this implemented foundation from planned API integration; unsampled feature behavior is not inferred.

Main entry points: [`backend/config/settings/base.py`](https://github.com/26wekesa/darasa-hub/blob/main/backend/config/settings/base.py) (Django configuration), [`backend/apps/payments/models.py`](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/payments/models.py) (Orders and payments), [`backend/apps/catalog/models.py`](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/catalog/models.py) (Materials and reviews), [`backend/apps/accounts/models.py`](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/accounts/models.py) (Accounts and profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_webapp["Welcome page<br/>[App.tsx]"]
  node_frontend_entry["React entry<br/>[main.tsx]"]
end

subgraph group_domain["Resource domains"]
  node_accounts["Accounts and profiles<br/>[models.py]"]
  node_catalog["Materials and reviews<br/>[models.py]"]
  node_library["Library domain<br/>[models.py]"]
  node_payments["Orders and payments<br/>[models.py]"]
  node_seed["Development seed data<br/>[seed_data.py]"]
end

subgraph group_runtime["Backend runtime"]
  node_django["Django configuration<br/>[base.py]"]
  node_database[("Configured database")]
end

node_teacher(("ECDE teacher"))

node_teacher -->|"opens"| node_frontend_entry
node_frontend_entry -->|"renders"| node_webapp
node_django -->|"installs app"| node_accounts
node_django -->|"installs app"| node_catalog
node_django -->|"installs app"| node_library
node_django -->|"installs app"| node_payments
node_django -->|"configures"| node_database
node_catalog -->|"references contributor"| node_accounts
node_payments -->|"references user"| node_accounts
node_payments -->|"orders materials"| node_catalog
node_payments -->|"records payment"| node_payments
node_seed -->|"creates contributor"| node_accounts
node_seed -->|"creates sample resources"| node_catalog
node_webapp -.->|"API integration planned"| node_django

click node_webapp "https://github.com/26wekesa/darasa-hub/blob/main/frontend/src/App.tsx"
click node_frontend_entry "https://github.com/26wekesa/darasa-hub/blob/main/frontend/src/main.tsx"
click node_accounts "https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/accounts/models.py"
click node_catalog "https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/catalog/models.py"
click node_library "https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/library/models.py"
click node_payments "https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/payments/models.py"
click node_django "https://github.com/26wekesa/darasa-hub/blob/main/backend/config/settings/base.py"
click node_seed "https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/catalog/management/commands/seed_data.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_webapp,node_frontend_entry toneBlue
class node_accounts,node_catalog,node_library,node_payments,node_seed toneAmber
class node_django,node_database toneMint
class node_teacher toneIndigo
```

## Components

### Web interface

- [Welcome page](https://github.com/26wekesa/darasa-hub/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [React entry](https://github.com/26wekesa/darasa-hub/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`

### Resource domains

- [Accounts and profiles](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/accounts/models.py): `backend/apps/accounts/models.py`
- [Materials and reviews](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/catalog/models.py): `backend/apps/catalog/models.py`
- [Library domain](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/library/models.py): `backend/apps/library/models.py`
- [Orders and payments](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/payments/models.py): `backend/apps/payments/models.py`
- [Development seed data](https://github.com/26wekesa/darasa-hub/blob/main/backend/apps/catalog/management/commands/seed_data.py): `backend/apps/catalog/management/commands/seed_data.py`

### Backend runtime

- [Django configuration](https://github.com/26wekesa/darasa-hub/blob/main/backend/config/settings/base.py): `backend/config/settings/base.py`
- **Configured database**

### Other components

- **ECDE teacher**

## Connections

- ECDE teacher → React entry: opens (evidence: `README.md`)
- React entry → Welcome page: renders (evidence: `frontend/src/main.tsx`)
- Django configuration → Accounts and profiles: installs app (evidence: `backend/config/settings/base.py`)
- Django configuration → Materials and reviews: installs app (evidence: `backend/config/settings/base.py`)
- Django configuration → Library domain: installs app (evidence: `backend/config/settings/base.py`)
- Django configuration → Orders and payments: installs app (evidence: `backend/config/settings/base.py`)
- Django configuration → Configured database: configures (evidence: `backend/config/settings/base.py`)
- Materials and reviews → Accounts and profiles: references contributor (evidence: `backend/apps/catalog/models.py`)
- Orders and payments → Accounts and profiles: references user (evidence: `backend/apps/payments/models.py`)
- Orders and payments → Materials and reviews: orders materials (evidence: `backend/apps/payments/models.py`)
- Orders and payments → Orders and payments: records payment (evidence: `backend/apps/payments/models.py`)
- Development seed data → Accounts and profiles: creates contributor (evidence: `backend/apps/catalog/management/commands/seed_data.py`)
- Development seed data → Materials and reviews: creates sample resources (evidence: `backend/apps/catalog/management/commands/seed_data.py`)
- Welcome page → Django configuration: API integration planned (evidence: `README.md`)
