# hyphaapp/hypha architecture

> Architecture diagram of the GitHub repository hyphaapp/hypha, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hyphaapp/hypha
- Repository: https://github.com/hyphaapp/hypha

## Overview

##### Main Components

a. Frontend Layer:
- Static assets (JavaScript, SASS/CSS, images)
- Templates (Django templates)
- Public-facing interfaces
- Admin interfaces

b. Backend Layer:
- Django applications
- Wagtail CMS integration
- Authentication system
- API endpoints

c. Core Modules:
- Applications management
- Review system
- Activity tracking
- Project management
- User management
- Categories system

d. External Services Integration:
- Slack integration
- Email services (Mailgun)
- Translation services
- File storage

##### Architecture Pattern Representation

**[Client Layer]**
- ↑↓
**[Web Layer (Django/Wagtail)]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Data Layer]**

##### Key Relationships to Highlight

a. Application Flow:
**User → Public Interface → Forms → Applications → Review System → Determinations**

b. Data Flow:
**Submissions → Activity Tracking → Notifications → External Services**

##### Detailed Component Breakdown

a. Apply Module:
- Funds management
- Review system
- Activity tracking
- Project management
- User management

b. Public Module:
- Forms
- News
- Projects
- People
- Standard pages

c. Core Infrastructure:
- Authentication
- Permissions
- File handling
- Translation system

##### Integration Points

Clear connection points for:
- External authentication
- Email services
- Slack notifications
- File storage systems
- Translation services

##### Key Technical Elements

Specific technical components:
- Django REST framework endpoints
- Wagtail CMS integration
- Stream forms
- Workflow engine
- Search functionality

##### Specific Implementation Details

- Modular architecture (separate apps)
- Workflow management
- Form building capabilities
- Review and determination processes
- Project tracking

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Frontend Layer"
        StaticAssets["Static Assets"]:::frontend
        Templates["Templates"]:::frontend
        PublicUI["Public Interface"]:::frontend
        AdminUI["Admin Interface"]:::frontend
    end

    subgraph "Backend Layer"
        DjangoApps["Django Apps"]:::backend
        WagtailCMS["Wagtail CMS"]:::backend
        APIEndpoints["API Endpoints"]:::backend
        Auth["Authentication"]:::backend
    end

    subgraph "Core Modules"
        AppManage["Applications Management"]:::core
        ReviewSys["Review System"]:::core
        Activity["Activity Tracking"]:::core
        Projects["Project Management"]:::core
        Users["User Management"]:::core
        Categories["Categories System"]:::core
        Forms["Forms System"]:::core
        Search["Search"]:::core
        Determinations["Determinations"]:::core
    end

    subgraph "External Services"
        Slack["Slack Integration"]:::external
        Email["Email Services"]:::external
        Translation["Translation Services"]:::external
        Storage["File Storage"]:::external
    end

    %% Relationships
    Browser --> StaticAssets
    Browser --> Templates
    Browser --> PublicUI
    Browser --> AdminUI

    PublicUI --> DjangoApps
    AdminUI --> DjangoApps
    DjangoApps --> WagtailCMS
    DjangoApps --> APIEndpoints
    DjangoApps --> Auth

    DjangoApps --> AppManage
    DjangoApps --> ReviewSys
    DjangoApps --> Activity
    DjangoApps --> Projects
    DjangoApps --> Users
    DjangoApps --> Categories
    DjangoApps --> Forms
    DjangoApps --> Search
    DjangoApps --> Determinations

    Activity --> Slack
    Activity --> Email
    Forms --> Storage
    DjangoApps --> Translation

    %% Click Events
    click StaticAssets "https://github.com/hyphaapp/hypha/tree/main/hypha/static_src/"
    click Templates "https://github.com/hyphaapp/hypha/tree/main/hypha/templates/"
    click PublicUI "https://github.com/hyphaapp/hypha/tree/main/hypha/public/"
    click AdminUI "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/funds/templates/funds/admin/"
    click DjangoApps "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/"
    click APIEndpoints "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/api/"
    click Auth "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/users/"
    click WagtailCMS "https://github.com/hyphaapp/hypha/tree/main/hypha/core/wagtail/"
    click AppManage "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/funds/"
    click ReviewSys "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/review/"
    click Activity "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/activity/"
    click Projects "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/projects/"
    click Users "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/users/"
    click Categories "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/categories/"
    click Slack "https://github.com/hyphaapp/hypha/blob/main/hypha/apply/activity/adapters/slack.py"
    click Email "https://github.com/hyphaapp/hypha/blob/main/hypha/apply/activity/adapters/emails.py"
    click Translation "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/translate/"
    click Storage "https://github.com/hyphaapp/hypha/blob/main/hypha/apply/stream_forms/files.py"
    click Forms "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/stream_forms/"
    click Search "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/search/"
    click Determinations "https://github.com/hyphaapp/hypha/tree/main/hypha/apply/determinations/"

    %% Styles
    classDef frontend fill:#2196F3,color:white
    classDef backend fill:#4CAF50,color:white
    classDef core fill:#FF9800,color:white
    classDef external fill:#9C27B0,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Component"]:::backend
        CoreMod["Core Module"]:::core
        ExtService["External Service"]:::external
    end
```
