# chal0326/nkengegranttool architecture

> Architecture diagram of the GitHub repository chal0326/nkengegranttool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chal0326/nkengegranttool
- Repository: https://github.com/chal0326/nkengegranttool

## Overview

##### Main Components

A. Frontend Layer:
- React Application (TypeScript)
- Key Module Groups:
- Grant Management
- Finance Management
- Project Management
- Team Management
- Template System

B. Backend Layer:
- Supabase Services:
- Database
- Storage
- Authentication (implied by structure)

**[Client Layer]**
- ↕
**[Service Layer]**
- ↕
**[Data Layer]**

##### Detailed Component Breakdown

Client Layer (Top):

- React Frontend|

- Pages        |
- Components   |
- Hooks        |

Service Layer (Middle):

- Service Layer   |

- Grant Services |
- Storage Service|

Data Layer (Bottom):

- Supabase Backend |

- Database       |
- File Storage   |

##### Key Relationships to Highlight

- Data flow between frontend components and hooks
- Service calls from hooks to Supabase services
- Database operations and storage interactions

##### Component Grouping

Related components into logical modules:
**[Grant Management Module]**
- GrantApplicationForm
- GrantSectionList
- GrantList

**[Finance Module]**
- TransactionList
- TransactionForm
- TransactionFilters

**[Project Module]**
- ProjectList
- ProjectForm
- ProjectFilters

**[Team Module]**
- TeamMemberList
- TeamMemberForm
- TeamFilters

##### Important Details

- Type definitions and interfaces (from /types directory)
- Custom hooks and their relationships
- Template system architecture
- Form handling patterns
- File upload flow

##### Technical Stack Callouts

- TypeScript
- React
- Supabase
- Tailwind CSS
- Vite

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE[React Frontend]
        
        subgraph Modules
            GM["Grant Management"]:::module
            FM["Finance Management"]:::module
            PM["Project Management"]:::module
            TM["Team Management"]:::module
            TS["Template System"]:::module
        end
        
        subgraph Components
            FC["Form Components"]:::component
            UC["UI Components"]:::component
        end
        
        subgraph Pages
            GP["Grants Page"]:::page
            FP["Finance Page"]:::page
            PP["Projects Page"]:::page
            TP["Team Page"]:::page
            TMP["Templates Page"]:::page
        end
        
        subgraph Hooks
            GH["Grant Hooks"]:::hook
            FH["Finance Hooks"]:::hook
            PH["Project Hooks"]:::hook
            TH["Team Hooks"]:::hook
            TMH["Template Hooks"]:::hook
        end
    end
    
    subgraph Service
        GS["Grant Services"]:::service
        SS["Storage Service"]:::service
        SC["Supabase Client"]:::service
    end
    
    subgraph Data
        DB[(Database)]:::database
        ST[(Storage)]:::storage
        
        subgraph Types
            DT["Database Types"]:::type
            FT["Finance Types"]:::type
            GT["Grant Types"]:::type
            PT["Project Types"]:::type
            TT["Team Types"]:::type
        end
    end
    
    %% Relationships
    GM --> GH
    FM --> FH
    PM --> PH
    TM --> TH
    TS --> TMH
    
    GH --> GS
    FH --> GS
    PH --> GS
    TH --> GS
    TMH --> GS
    
    GS --> SC
    SS --> SC
    
    SC --> DB
    SC --> ST
    
    %% Click Events
    click GM "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/grant-form/"
    click FM "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/finance/"
    click PM "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/projects/"
    click TM "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/team/"
    click TS "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/templates/"
    
    click GH "https://github.com/chal0326/NkengeGrantTool/blob/main/src/hooks/useGrants.ts"
    click FH "https://github.com/chal0326/NkengeGrantTool/blob/main/src/hooks/useFinance.ts"
    click PH "https://github.com/chal0326/NkengeGrantTool/blob/main/src/hooks/useProjects.ts"
    click TH "https://github.com/chal0326/NkengeGrantTool/blob/main/src/hooks/useTeam.ts"
    click TMH "https://github.com/chal0326/NkengeGrantTool/blob/main/src/hooks/useTemplates.ts"
    
    click GP "https://github.com/chal0326/NkengeGrantTool/blob/main/src/pages/Grants.tsx"
    click FP "https://github.com/chal0326/NkengeGrantTool/blob/main/src/pages/Finance.tsx"
    click PP "https://github.com/chal0326/NkengeGrantTool/blob/main/src/pages/Projects.tsx"
    click TP "https://github.com/chal0326/NkengeGrantTool/blob/main/src/pages/Team.tsx"
    click TMP "https://github.com/chal0326/NkengeGrantTool/blob/main/src/pages/Templates.tsx"
    
    click GS "https://github.com/chal0326/NkengeGrantTool/blob/main/src/lib/grant-services.ts"
    click SS "https://github.com/chal0326/NkengeGrantTool/blob/main/src/lib/supabase-storage.ts"
    click SC "https://github.com/chal0326/NkengeGrantTool/blob/main/src/lib/supabase.ts"
    
    click DT "https://github.com/chal0326/NkengeGrantTool/blob/main/src/types/database.types.ts"
    click FT "https://github.com/chal0326/NkengeGrantTool/blob/main/src/types/finance.ts"
    click GT "https://github.com/chal0326/NkengeGrantTool/blob/main/src/types/grant.ts"
    click PT "https://github.com/chal0326/NkengeGrantTool/blob/main/src/types/project.ts"
    click TT "https://github.com/chal0326/NkengeGrantTool/blob/main/src/types/team.ts"
    
    click FC "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/form/"
    click UC "https://github.com/chal0326/NkengeGrantTool/tree/main/src/components/ui/"
    
    %% Styles
    classDef module fill:#a8dadc,stroke:#457b9d
    classDef component fill:#bde0fe,stroke:#457b9d
    classDef page fill:#cdb4db,stroke:#457b9d
    classDef hook fill:#bee1e6,stroke:#457b9d
    classDef service fill:#ffd6a5,stroke:#457b9d
    classDef database fill:#ffafcc,stroke:#457b9d
    classDef storage fill:#ffc8dd,stroke:#457b9d
    classDef type fill:#bde0fe,stroke:#457b9d
```
