# jasonlin1993/ganttchart architecture

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

- Interactive diagram: https://gitdiagram.com/jasonlin1993/ganttchart
- Repository: https://github.com/jasonlin1993/ganttchart

## Overview

##### High-Level Architecture Overview

a) Client-Side (Frontend):
- Next.js Application Layer
- Redux State Management
- UI Components Layer
- Custom Hooks Layer

b) Backend Services:
- Firebase Authentication
- Firebase Firestore

##### Detailed Component Breakdown

A. Frontend Layer (Top Section):
**┌─ User Interface Layer ─────────────────────┐**
- Main Page Components                     │
- Gantt Chart Components                   │
- Authentication Forms                     │
- History View                            │
- ┘

B. Application Logic Layer (Middle Section):
**┌─ State Management ─┐  ┌─ Custom Hooks ────┐**
- Redux Store      │  │ - useAuth         │
- Task Actions     │  │ - useFirestore    │
- Date Actions     │  │ - useProjectData  │
- ┘  └─────────────────────┘

C. Backend Services (Bottom Section):
**┌─ Firebase Services ───────────────────────┐**
- Authentication                          │
- Firestore Database                      │
- ┘

##### Data Flow Indicators

- User interactions → UI Components
- UI Components → Redux Actions
- Redux Store → Components (for state updates)
- Custom Hooks → Firebase Services
- Firebase Services → Custom Hooks (data responses)

##### Special Features to Highlight

- Drag & Drop functionality
- PDF Export capability
- Project history management

##### Component Relationships

Specific interactions between:
- Authentication flow (SigninForm/SignupForm → useAuth → Firebase Auth)
- Data management flow (TaskInput → Redux → Firestore)
- Project management flow (SaveToFirestore → Firestore Database)

##### Technical Stack Indicators

- Next.js
- Redux Toolkit
- Styled Components
- Firebase
- React Hooks

##### Deployment Flow

A section showing the deployment process:
- Local Development
- Vercel Deployment
- Firebase Configuration

Remember to:
- Use consistent symbols and notation
- Both synchronous and asynchronous operations
- Error handling paths
- Security boundaries

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Layer"
        UI["User Interface"]
        MainPage["Main Page"]:::ui
        GanttChart["Gantt Chart"]:::ui
        AuthForms["Auth Forms"]:::ui
        HistoryView["History View"]:::ui
        
        subgraph "UI Components"
            Calendar["Calendar Component"]:::ui
            TaskInput["Task Input"]:::ui
            TaskDuration["Task Duration"]:::ui
            SignIn["Sign In Form"]:::ui
            SignUp["Sign Up Form"]:::ui
            SavePopup["Save Popup"]:::ui
        end
    end

    subgraph "Application Logic"
        subgraph "State Management"
            ReduxStore["Redux Store"]:::redux
            TaskActions["Task Actions"]:::redux
            DateActions["Date Actions"]:::redux
            TaskReducer["Task Reducer"]:::redux
            DateReducer["Date Reducer"]:::redux
        end

        subgraph "Custom Hooks"
            UseAuth["useAuth"]:::hooks
            UseFirestore["useFirestore"]:::hooks
            UseProjectData["useProjectData"]:::hooks
            UseSignIn["useFirebaseSignIn"]:::hooks
            UseSignUp["useFirebaseSignUp"]:::hooks
        end
    end

    subgraph "Backend Services"
        Firebase["Firebase Config"]:::firebase
        Auth["Firebase Auth"]:::firebase
        Firestore["Firestore DB"]:::firebase
    end

    %% Relationships
    UI --> MainPage
    UI --> GanttChart
    UI --> AuthForms
    UI --> HistoryView
    
    GanttChart --> Calendar
    GanttChart --> TaskInput
    GanttChart --> TaskDuration
    AuthForms --> SignIn
    AuthForms --> SignUp
    
    TaskInput --> TaskActions
    Calendar --> DateActions
    TaskActions --> ReduxStore
    DateActions --> ReduxStore
    ReduxStore --> TaskReducer
    ReduxStore --> DateReducer
    
    SignIn --> UseSignIn
    SignUp --> UseSignUp
    UseSignIn --> UseAuth
    UseSignUp --> UseAuth
    UseAuth --> Auth
    
    SavePopup --> UseFirestore
    UseFirestore --> Firestore
    UseProjectData --> Firestore

    %% Click Events
    click MainPage "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/MainPage.js"
    click GanttChart "https://github.com/jasonlin1993/GanttChart/blob/main/src/pages/ganttchart/GanttChartPage.js"
    click Calendar "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/Calendar.js"
    click TaskInput "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/TaskInput.js"
    click TaskDuration "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/TaskDurationComponent.js"
    click SignIn "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/SigninForm.js"
    click SignUp "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/SignupForm.js"
    click HistoryView "https://github.com/jasonlin1993/GanttChart/blob/main/src/pages/history/HistoryPage.js"
    click ReduxStore "https://github.com/jasonlin1993/GanttChart/blob/main/src/redux/store.js"
    click TaskActions "https://github.com/jasonlin1993/GanttChart/blob/main/src/redux/action/taskAction.js"
    click DateActions "https://github.com/jasonlin1993/GanttChart/blob/main/src/redux/action/dateAction.js"
    click TaskReducer "https://github.com/jasonlin1993/GanttChart/blob/main/src/redux/reducers/taskReducer.js"
    click DateReducer "https://github.com/jasonlin1993/GanttChart/blob/main/src/redux/reducers/dateReducer.js"
    click UseAuth "https://github.com/jasonlin1993/GanttChart/blob/main/src/hooks/useAuth.js"
    click UseFirestore "https://github.com/jasonlin1993/GanttChart/blob/main/src/hooks/useFirestoreData.js"
    click UseProjectData "https://github.com/jasonlin1993/GanttChart/blob/main/src/hooks/useProjectData.js"
    click UseSignIn "https://github.com/jasonlin1993/GanttChart/blob/main/src/hooks/useFirebaseSigninAuth.js"
    click UseSignUp "https://github.com/jasonlin1993/GanttChart/blob/main/src/hooks/useFirebaseSignupAuth.js"
    click Firebase "https://github.com/jasonlin1993/GanttChart/blob/main/src/lib/firebase.js"
    click SavePopup "https://github.com/jasonlin1993/GanttChart/blob/main/src/components/SaveToFirestorePopup.js"

    %% Styling
    classDef ui fill:#2196F3,color:white
    classDef redux fill:#4CAF50,color:white
    classDef hooks fill:#FFC107,color:black
    classDef firebase fill:#F44336,color:white
    
    %% Legend
    subgraph Legend
        UI_Legend["UI Components"]:::ui
        Redux_Legend["Redux"]:::redux
        Hooks_Legend["Custom Hooks"]:::hooks
        Firebase_Legend["Firebase Services"]:::firebase
    end
```
