# 4geeksacademy/zepda_eco-logistics_finalproject architecture

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

- Interactive diagram: https://gitdiagram.com/4geeksacademy/zepda_eco-logistics_finalproject
- Repository: https://github.com/4geeksacademy/zepda_eco-logistics_finalproject

## Overview

##### Main Components Identification

Frontend Layer:
- React.js application (src/front)
- Component structure
- Store management (Flux pattern)
- Static assets

Backend Layer:
- Flask API (src/api)
- SQLAlchemy ORM
- Authentication system
- Route handlers

Database Layer:
- PostgreSQL (recommended)
- Database migrations
- Model definitions

**┌─ Client Browser ─┐**

- ▼
**┌─ React Frontend ─┐**
- Components
- Flux Store
- Routes

**┌─ Flask Backend API ─┐**
- Routes (/api/routes.py)
- Models (/api/models.py)
- Utils (/api/utils.py)
- Admin (/api/admin.py)

**┌─ PostgreSQL Database ─┐**
- User Tables
- Application Data

##### Component Relationships

- Frontend to Backend: RESTful API calls
- Backend to Database: SQLAlchemy ORM queries
- Store to Components: Flux pattern data flow
- Authentication flow between layers

##### Detailed Component Breakdown

Create sub-sections showing:

Frontend Components:
- NewsSection
- CompanyCard
- CompanyCarousel
- Navbar
- Footer
**etc.**

API Routes:
- User management
- Authentication
- Application-specific endpoints

##### Notes Section

Annotations for:
- Database URL configuration
- Environment setup requirements
- Deployment procedures
- Testing procedures

Remember to include development tools and deployment configurations as secondary elements, keeping the main focus on the core application architecture.

This structure will provide a clear visualization of how the full-stack application works while maintaining the necessary detail level for a principal software engineer to understand the system's complete architecture.

## Diagram (Mermaid)

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

    subgraph "Frontend Layer"
        React["React Application"]:::frontend
        click React "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/js"
        
        subgraph "React Components"
            Components["Component Library"]:::frontend
            click Components "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/js/component"
            Pages["Pages"]:::frontend
            click Pages "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/js/pages"
            Layout["Layout"]:::frontend
            click Layout "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/front/js/layout.js"
        end

        subgraph "State Management"
            Store["Flux Store"]:::frontend
            click Store "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/front/js/store/flux.js"
            Context["App Context"]:::frontend
            click Context "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/front/js/store/appContext.js"
        end

        subgraph "Frontend Assets"
            StaticAssets["Static Assets"]:::frontend
            click StaticAssets "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/img"
            Styles["CSS Styles"]:::frontend
            click Styles "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/styles"
            Utils["Frontend Utils"]:::frontend
            click Utils "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/src/front/utils"
        end
    end

    subgraph "Backend Layer"
        Flask["Flask Application"]:::backend
        click Flask "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/app.py"
        
        subgraph "API Components"
            Routes["API Routes"]:::backend
            click Routes "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/api/routes.py"
            Models["Data Models"]:::backend
            click Models "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/api/models.py"
            Admin["Admin Interface"]:::backend
            click Admin "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/api/admin.py"
            APIUtils["API Utilities"]:::backend
            click APIUtils "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/src/api/utils.py"
        end
    end

    subgraph "Development & Deployment"
        Docker["Docker Environment"]:::devops
        click Docker "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/.devcontainer"
        Webpack["Webpack Config"]:::devops
        click Webpack "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/webpack.common.js"
        RenderConfig["Render.com Config"]:::devops
        click RenderConfig "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/render.yaml"
    end

    subgraph "Database Layer"
        PostgreSQL["PostgreSQL Database"]:::database
    end

    subgraph "Documentation"
        Docs["Documentation"]:::docs
        click Docs "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/tree/main/docs"
        ChangeLog["Change Log"]:::docs
        click ChangeLog "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/docs/CHANGE_LOG.md"
        Help["Help Docs"]:::docs
        click Help "https://github.com/4GeeksAcademy/ZEPDA_eco-logistics_finalProject/blob/main/docs/HELP.md"
    end

    %% Relationships
    Browser --> React
    React --> Components
    React --> Pages
    React --> Layout
    Components --> Store
    Pages --> Store
    Store --> Context
    React --> StaticAssets
    React --> Styles
    React --> Utils
    React --> Flask
    Flask --> Routes
    Flask --> Models
    Flask --> Admin
    Flask --> APIUtils
    Models --> PostgreSQL
    
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef devops fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef docs fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Component"]:::backend
        DB["Database"]:::database
        DevOps["DevOps"]:::devops
        Documentation["Documentation"]:::docs
    end
```
