# divyagoyal138/credimpact architecture

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

- Interactive diagram: https://gitdiagram.com/divyagoyal138/credimpact
- Repository: https://github.com/divyagoyal138/credimpact

## Overview

CredImpact is a student credit-management portal with an institutional admin console. Students authenticate, browse and apply to activities, track completion and CreditCoins, and manage their profile; administrators manage activities, review applicants, communicate, analyze institutional activity, and allocate credits. The Next.js client uses a shared API client to reach a Flask REST backend backed by PostgreSQL. README-documented capabilities are included where source excerpts were unavailable; those relationships are cited to the README rather than presented as inspected implementation details.

Main entry points: [`lib/api.ts`](https://github.com/divyagoyal138/credimpact/blob/main/lib/api.ts) (API Client), [`backend/app.py`](https://github.com/divyagoyal138/credimpact/blob/main/backend/app.py) (REST API), [`app/dashboard/layout.tsx`](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/layout.tsx) (Dashboard State), [`app/admin-dashboard/page.tsx`](https://github.com/divyagoyal138/credimpact/blob/main/app/admin-dashboard/page.tsx) (Admin Console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student Portal"]
  node_login["Student Login<br/>[page.tsx]"]
  node_dash["Dashboard State<br/>[layout.tsx]"]
  node_tasks["Task Tracking<br/>[page.jsx]"]
  node_taskcard["Task Actions<br/>[TaskCard.jsx]"]
  node_profile["Student Profile<br/>[page.tsx]"]
  node_wallet["CreditCoin Wallet<br/>[page.jsx]"]
  node_portfolio["Achievement Portfolio<br/>[page.jsx]"]
  node_campus["Events and Rankings<br/>[page.jsx]"]
  node_analytics["Student Analytics<br/>[page.jsx]"]
  node_chat["Student Messaging<br/>[page.jsx]"]
end

subgraph group_admin["Institutional Admin"]
  node_admin["Admin Console<br/>[page.tsx]"]
end

subgraph group_platform["Shared Client Platform"]
  node_api["API Client<br/>[api.ts]"]
  node_shell["Dashboard Shell<br/>[layout.tsx]"]
  node_navigation["Dashboard Navigation<br/>[Sidebar.jsx]"]
  node_theme["Theme State<br/>[theme-context.tsx]"]
  node_exports["Report Export<br/>[exportUtils.ts]"]
end

subgraph group_server["API and Persistence"]
  node_backend["REST API<br/>[app.py]"]
  node_database[("PostgreSQL<br/>[schema.sql]")]
end

node_student(("Student"))
node_adminactor(("Administrator"))

node_student -->|"authenticates through"| node_login
node_login -->|"requests verification"| node_api
node_api -->|"calls REST endpoints"| node_backend
node_backend -->|"reads and writes"| node_database
node_dash -->|"loads dashboard data"| node_api
node_dash -->|"renders navigation"| node_navigation
node_tasks -->|"renders task actions"| node_taskcard
node_taskcard -->|"invokes task handlers"| node_dash
node_dash -->|"submits applications"| node_api
node_profile -->|"updates profile"| node_api
node_analytics -->|"reads dashboard state"| node_dash
node_chat -->|"loads and sends messages"| node_api
node_adminactor -->|"manages institution"| node_admin
node_admin -->|"requests admin operations"| node_api
node_admin -->|"exports analytics"| node_exports
node_admin -->|"manages tasks and allocations"| node_backend
node_wallet -->|"views credit transactions"| node_backend
node_portfolio -->|"views verified achievements"| node_backend
node_campus -->|"loads events and rankings"| node_backend
node_theme -.-> node_database

click node_login "https://github.com/divyagoyal138/credimpact/blob/main/app/login/page.tsx"
click node_dash "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/layout.tsx"
click node_tasks "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/page.jsx"
click node_taskcard "https://github.com/divyagoyal138/credimpact/blob/main/components/TaskCard.jsx"
click node_profile "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/profile/page.tsx"
click node_wallet "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/cc-wallet/page.jsx"
click node_portfolio "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/my-portfolio/page.jsx"
click node_campus "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/events/page.jsx"
click node_analytics "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/analytics/page.jsx"
click node_chat "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/chat/page.jsx"
click node_admin "https://github.com/divyagoyal138/credimpact/blob/main/app/admin-dashboard/page.tsx"
click node_api "https://github.com/divyagoyal138/credimpact/blob/main/lib/api.ts"
click node_shell "https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/layout.tsx"
click node_navigation "https://github.com/divyagoyal138/credimpact/blob/main/components/Sidebar.jsx"
click node_theme "https://github.com/divyagoyal138/credimpact/blob/main/lib/theme-context.tsx"
click node_exports "https://github.com/divyagoyal138/credimpact/blob/main/lib/exportUtils.ts"
click node_backend "https://github.com/divyagoyal138/credimpact/blob/main/backend/app.py"
click node_database "https://github.com/divyagoyal138/credimpact/blob/main/backend/schema.sql"

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_login,node_dash,node_tasks,node_taskcard,node_profile,node_wallet,node_portfolio,node_campus,node_analytics,node_chat toneBlue
class node_admin toneAmber
class node_api,node_shell,node_navigation,node_theme,node_exports toneMint
class node_backend,node_database toneRose
class node_student,node_adminactor toneIndigo
```

## Components

### Student Portal

- [Student Login](https://github.com/divyagoyal138/credimpact/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Dashboard State](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/layout.tsx): `app/dashboard/layout.tsx`
- [Task Tracking](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/page.jsx): `app/dashboard/page.jsx`
- [Task Actions](https://github.com/divyagoyal138/credimpact/blob/main/components/TaskCard.jsx): `components/TaskCard.jsx`
- [Student Profile](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/profile/page.tsx): `app/dashboard/profile/page.tsx`
- [CreditCoin Wallet](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/cc-wallet/page.jsx): `app/dashboard/cc-wallet/page.jsx`
- [Achievement Portfolio](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/my-portfolio/page.jsx): `app/dashboard/my-portfolio/page.jsx`
- [Events and Rankings](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/events/page.jsx): `app/dashboard/events/page.jsx`
- [Student Analytics](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/analytics/page.jsx): `app/dashboard/analytics/page.jsx`
- [Student Messaging](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/chat/page.jsx): `app/dashboard/chat/page.jsx`

### Institutional Admin

- [Admin Console](https://github.com/divyagoyal138/credimpact/blob/main/app/admin-dashboard/page.tsx): `app/admin-dashboard/page.tsx`

### Shared Client Platform

- [API Client](https://github.com/divyagoyal138/credimpact/blob/main/lib/api.ts): `lib/api.ts`
- [Dashboard Shell](https://github.com/divyagoyal138/credimpact/blob/main/app/dashboard/layout.tsx): `app/dashboard/layout.tsx`
- [Dashboard Navigation](https://github.com/divyagoyal138/credimpact/blob/main/components/Sidebar.jsx): `components/Sidebar.jsx`
- [Theme State](https://github.com/divyagoyal138/credimpact/blob/main/lib/theme-context.tsx): `lib/theme-context.tsx`
- [Report Export](https://github.com/divyagoyal138/credimpact/blob/main/lib/exportUtils.ts): `lib/exportUtils.ts`

### API and Persistence

- [REST API](https://github.com/divyagoyal138/credimpact/blob/main/backend/app.py): `backend/app.py`
- [PostgreSQL](https://github.com/divyagoyal138/credimpact/blob/main/backend/schema.sql): `backend/schema.sql`

### Other components

- **Student**
- **Administrator**

## Connections

- Student → Student Login: authenticates through (evidence: `README.md`)
- Student Login → API Client: requests verification (evidence: `app/login/page.tsx`)
- API Client → REST API: calls REST endpoints (evidence: `README.md`)
- REST API → PostgreSQL: reads and writes (evidence: `README.md`)
- Dashboard State → API Client: loads dashboard data (evidence: `app/dashboard/layout.tsx`)
- Dashboard State → Dashboard Navigation: renders navigation (evidence: `app/dashboard/layout.tsx`)
- Task Tracking → Task Actions: renders task actions (evidence: `app/dashboard/page.jsx`)
- Task Actions → Dashboard State: invokes task handlers (evidence: `components/TaskCard.jsx`)
- Dashboard State → API Client: submits applications (evidence: `app/dashboard/layout.tsx`)
- Student Profile → API Client: updates profile (evidence: `app/dashboard/profile/page.tsx`)
- Student Analytics → Dashboard State: reads dashboard state (evidence: `app/dashboard/analytics/page.jsx`)
- Student Messaging → API Client: loads and sends messages (evidence: `app/dashboard/chat/page.jsx`)
- Administrator → Admin Console: manages institution (evidence: `README.md`)
- Admin Console → API Client: requests admin operations (evidence: `app/admin-dashboard/page.tsx`)
- Admin Console → Report Export: exports analytics
- Admin Console → REST API: manages tasks and allocations (evidence: `README.md`)
- CreditCoin Wallet → REST API: views credit transactions (evidence: `README.md`)
- Achievement Portfolio → REST API: views verified achievements (evidence: `README.md`)
- Events and Rankings → REST API: loads events and rankings (evidence: `README.md`)
- Theme State → PostgreSQL
