# danielthatu47/connectingngo architecture

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

- Interactive diagram: https://gitdiagram.com/danielthatu47/connectingngo
- Repository: https://github.com/danielthatu47/connectingngo

## Overview

##### Project Type Analysis
This is a Django web application focused on user authentication and management, with social login integration. It's a monolithic application following Django's MVT (Model-View-Template) architecture.

##### Main Components

A. Client Layer:
- Web Browser
- Static Files (CSS, JavaScript, Media)

B. Application Layer:
- Django Web Server
- Authentication System
- User Management Module
- Social Authentication (GitHub, Google)
- Media Handler

C. Data Layer:
- Database (Django ORM)
- File Storage (Media files, PDFs, Images)

**Top Layer (Client):**
**┌─────────────────────────────────────────┐**
- Web Browser / Frontend                   │
- (Bootstrap-based Templates)              │
- ┘
- ↕ HTTP/HTTPS
**Middle Layer (Application):**
**┌─────────────────────────────────────────┐**
- Django Application Server                │
- ┬──────────────┬───────────┤
- User Auth   │ Profile      │ Media     │
- Module      │ Management   │ Handler   │
- ┴──────────────┴───────────┤
- Social Authentication Services          │
- (GitHub, Google)                        │
- ┘
- ↕
**Bottom Layer (Data):**
**┌─────────────────────┐  ┌──────────────┐**
- Database            │  │ File Storage  │
- User Data         │  │ - Avatars    │
- Profile Info      │  │ - PDFs       │
- NGO Data          │  │ - Images     │
- ┘  └──────────────┘

##### Key Components Detail

A. Templates Layer (users/templates/):
- Major template groups (auth, profile, NGO)
- Static file serving

B. Views Layer (users/views.py):
- Authentication views
- Profile management
- NGO management
- Payment handling

C. Models Layer (users/models.py):
- Profile model
- NGO model
- Related data structures

D. Media Handling:
- Separate paths for different media types
- PDF and image storage

##### Important Architectural Elements

- Django's built-in authentication system
- Custom user profile extension
- Social authentication integration
- Media file handling system
- Payment integration (as indicated by payment.html)
- Password reset flow
- Admin interface

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        Static["Static Files"]:::static
    end

    subgraph Application["Django Application Server"]
        DjangoCore["Django Core"]:::core
        
        subgraph Auth["Authentication System"]
            Login["Login"]:::auth
            Register["Registration"]:::auth
            PassReset["Password Reset"]:::auth
            Logout["Logout"]:::auth
            SocialAuth["Social Auth<br/>(GitHub, Google)"]:::auth
        end
        
        subgraph UserMgmt["User Management"]
            Models["Data Models"]:::models
            Views["Views Handler"]:::views
            Forms["Forms Processing"]:::forms
            Admin["Admin Interface"]:::admin
        end
        
        subgraph ProfileMgmt["Profile Management"]
            Profile["Profile Handler"]:::profile
            ProfileMigrations["Profile Migrations"]:::migrations
        end
        
        subgraph NGOMgmt["NGO Management"]
            NGOList["NGO List"]:::ngo
            NGOModel["NGO Model"]:::ngo
            NGOMigration["NGO Migration"]:::migrations
        end
        
        Payment["Payment System"]:::payment
    end

    subgraph Storage["Data Layer"]
        DB[(Database)]
        
        subgraph MediaStorage["Media Storage"]
            Images["Images"]:::storage
            PDFs["PDFs"]:::storage
            ProfileImages["Profile Images"]:::storage
        end
    end

    Browser --> DjangoCore
    Static --> Browser
    DjangoCore --> Auth
    DjangoCore --> UserMgmt
    DjangoCore --> ProfileMgmt
    DjangoCore --> NGOMgmt
    DjangoCore --> Payment
    Auth --> DB
    UserMgmt --> DB
    ProfileMgmt --> DB
    NGOMgmt --> DB
    ProfileMgmt --> MediaStorage
    NGOMgmt --> MediaStorage

    %% Click Events
    click Static "https://github.com/DanielThatu47/connectingngo/tree/main/users/static/"
    click Login "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/login.html"
    click Register "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/register.html"
    click PassReset "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/password_reset.html"
    click Logout "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/logout.html"
    click Models "https://github.com/DanielThatu47/connectingngo/blob/main/users/models.py"
    click Views "https://github.com/DanielThatu47/connectingngo/blob/main/users/views.py"
    click Forms "https://github.com/DanielThatu47/connectingngo/blob/main/users/forms.py"
    click Admin "https://github.com/DanielThatu47/connectingngo/blob/main/users/admin.py"
    click Profile "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/profile.html"
    click ProfileMigrations "https://github.com/DanielThatu47/connectingngo/tree/main/users/migrations/"
    click NGOList "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/ngo_list.html"
    click NGOModel "https://github.com/DanielThatu47/connectingngo/blob/main/users/models.py"
    click NGOMigration "https://github.com/DanielThatu47/connectingngo/blob/main/users/migrations/0005_ngo.py"
    click Payment "https://github.com/DanielThatu47/connectingngo/blob/main/users/templates/users/payment.html"
    click Images "https://github.com/DanielThatu47/connectingngo/tree/main/media/images/"
    click PDFs "https://github.com/DanielThatu47/connectingngo/tree/main/media/pdf_files/"
    click ProfileImages "https://github.com/DanielThatu47/connectingngo/tree/main/media/profile_images/"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef auth fill:#FFE5CC,stroke:#FF9933
    classDef core fill:#CCE5FF,stroke:#3399FF
    classDef models fill:#E5FFCC,stroke:#66CC33
    classDef views fill:#FFE5E5,stroke:#FF6666
    classDef forms fill:#E5E5FF,stroke:#6666FF
    classDef admin fill:#FFE5FF,stroke:#FF66FF
    classDef profile fill:#E5FFFF,stroke:#66FFFF
    classDef ngo fill:#FFF0E5,stroke:#FF9966
    classDef payment fill:#F0E5FF,stroke:#9966FF
    classDef storage fill:#E5E5E5,stroke:#666666
    classDef migrations fill:#FFE5F0,stroke:#FF6699
    classDef static fill:#F0F0F0,stroke:#999999
```
