# adilsiraju/ecovest architecture

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

- Interactive diagram: https://gitdiagram.com/adilsiraju/ecovest
- Repository: https://github.com/adilsiraju/ecovest

## Overview

##### Project Type & Purpose
- The project is a full-stack web application built with Django. Its role is to connect environmentally conscious investors with sustainable initiatives.
- The README and file tree show a focus on user management, initiatives browsing, investment tracking, and real-time impact metrics.

##### Key Components
a. Frontend Layer:
- Client Browsers: Represent the HTML/CSS/JavaScript interfaces served to users.
- Templates & Static Files: Located in the “templates” and “static” directories; these utilize Bootstrap 5 for UI and Chart.js for data visualization.
- Media: Represented by the “media” folder, which stores user-uploaded images and initiative-related graphics.

b. Backend Application:
- Core Django Project: Highlight the “ecovest” directory (with settings, URL configurations, WSGI/ASGI files) that orchestrates the overall project.
- Django Apps:
- Users App: Manages authentication, profile management (with image uploads), and dashboard functionalities.
- Initiatives App: Handles sustainable projects, detailed views, progress updates, and environmental impact metrics.
- Investments App: Manages investment processing, tracking, and related financial interactions for the platform.
- Django Admin & Business Logic: Note that administrative control of projects and progress updates is provided through Django’s admin interface.

c. Data Persistence:
- Database: The project uses SQLite3 (db.sqlite3) as its primary data store. Represent the database entity and how the Django models from various apps interact with it.
- Migrations: The numerous migration files (under initiatives, investments, and users) indicate a structured evolution of data models that you might want to annotate.

##### Architectural Relationships & Interactions
- The client makes a request, which the front controller (ecovest/urls.py) routes to a specific app (e.g., initiatives/views.py, users/views.py).
- The apps process the request (possibly interacting with forms and models) and render HTML via templates.
- The processing might include retrieving/updating data in the SQLite database.
- After actions (such as investments or profile updates), the response, along with any dynamic data (via Chart.js, for example), is sent back to the client.
- Client and Web Server
- Web Server and Database
- Web Server and Static/Media resource folders

##### Important Architectural Patterns & Design Principles
- MVC (or MVT in Django): Represent the separation of concerns – Models (data layer), Views (business logic), and Templates (presentation layer).
- Modular Design: Each app (users, initiatives, investments) acts as a standalone module handling its own domain functionality.
- Separation between static content, media, and dynamic data processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        C["Client Browser"]:::client
    end

    subgraph "Frontend Assets"
        T["Templates"]:::frontend
        S["Static Files"]:::frontend
        M["Media Files"]:::frontend
    end

    subgraph "Django Web Server"
        Core["Core Django Project"]:::backend
        U["Users App"]:::backend
        I["Initiatives App"]:::backend
        Inv["Investments App"]:::backend
    end

    D["Database - SQLite3"]:::database

    %% Data Flow
    C -->|"HTTP_Request"| Core
    Core -->|"Routes_to"| U
    Core -->|"Routes_to"| I
    Core -->|"Routes_to"| Inv

    U -->|"CRUD"| D
    I -->|"CRUD"| D
    Inv -->|"CRUD"| D

    Core -->|"Renders_with"| T
    Core -->|"Serves_with"| S
    Core -->|"Accesses"| M

    T -->|"Delivers_HTML"| C
    S -->|"Delivers_CSS_JS"| C
    M -->|"Provides_Images"| C

    %% Click Events
    click T "https://github.com/adilsiraju/ecovest/tree/main//templates"
    click S "https://github.com/adilsiraju/ecovest/tree/main//static"
    click M "https://github.com/adilsiraju/ecovest/tree/main//media"
    click Core "https://github.com/adilsiraju/ecovest/tree/main//ecovest"
    click U "https://github.com/adilsiraju/ecovest/tree/main//users"
    click I "https://github.com/adilsiraju/ecovest/tree/main//initiatives"
    click Inv "https://github.com/adilsiraju/ecovest/tree/main//investments"
    click D "https://github.com/adilsiraju/ecovest/blob/main//db.sqlite3"

    %% Styles
    classDef client fill:#aaffaa,stroke:#333,stroke-width:2px;
    classDef frontend fill:#ccf,stroke:#333,stroke-width:2px;
    classDef backend fill:#cfc,stroke:#333,stroke-width:2px;
    classDef database fill:#fcc,stroke:#333,stroke-width:2px;
```
