# xanf-code/afcai-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/xanf-code/afcai-frontend
- Repository: https://github.com/xanf-code/afcai-frontend

## Overview

##### Main Components

A. Frontend Layer:
- Client-Side Components (React/Next.js)
- Public Pages (/pages directory)
- Admin Dashboard (/pages/backend/admin)
- UI Components (/components/UI)
- Layout Components (/components/Layout)
- Admin Components (/components/Admin)

B. Data Management Layer:
- GraphQL Layer
- Queries (/graphql/queries)
- Mutations (/graphql/mutations)
- State Management
- Store Components (/store)

C. Static Assets:
- Public Resources
- Data Files (JSON)
- Whitepaper
- Fonts

**┌─────────────────────────────────────────────┐**
- Client Layer                 │
- ┌─────────┐ ┌─────────┐ ┌───────────────┐ │
- Pages  │ │   UI    │ │    Admin      │ │
- ┘ └─────────┘ └───────────────┘ │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- Data Access Layer              │
- ┌─────────┐ ┌─────────┐ ┌───────────────┐ │
- GraphQL │ │ Stores  │ │    Static     │ │
- Layer   │ │         │ │    Assets     │ │
- ┘ └─────────┘ └───────────────┘ │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- External Services              │
- ┌─────────────────────────────────────────┐ │
- GraphQL Backend               │ │
- ┘ │
- ┘

##### Component Relationships to Highlight

a. Client Layer:
- How pages connect to UI components
- Admin dashboard structure
- Relationship between Layout and other components

b. Data Layer:
- GraphQL queries/mutations flow
- Store integration with components
- Static asset usage

##### Additional Elements

- Authentication flow for admin dashboard
- File upload/download mechanisms (CSV downloads)
- Static file serving (whitepaper, images)
- State management flow

##### Technical Stack Indicators

- Next.js
- GraphQL
- TailwindCSS
- React

##### External service integration

Remember to:
- Use consistent styling
- Brief descriptions for complex flows
- Both synchronous and asynchronous operations

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef data fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#e67e22,stroke:#d35400,color:white
    classDef static fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        %% Public Pages
        PublicPages["Public Pages"]
        HomePage["Home Page"]:::frontend
        AboutPage["About Page"]:::frontend
        RegPage["Registration"]:::frontend
        PrivacyPage["Privacy Policy"]:::frontend

        %% Admin Pages
        AdminPages["Admin Pages"]
        DashHome["Dashboard Home"]:::frontend
        LoginPage["Login Page"]:::frontend
        AllTeamsPage["All Teams"]:::frontend
        VerifiedTeamsPage["Verified Teams"]:::frontend

        %% UI Components
        UIComponents["UI Components"]
        Navbar["Navigation"]:::frontend
        Footer["Footer"]:::frontend
        Hero["Hero Section"]:::frontend
        Testimonials["Testimonials"]:::frontend

        %% Admin Components
        AdminComponents["Admin Components"]
        TeamsManagement["Teams Management"]:::frontend
        VerifiedTeams["Verified Teams"]:::frontend
        TeamContent["Team Content"]:::frontend

        %% Layout
        MainLayout["Main Layout"]:::frontend
    end

    %% Data Management Layer
    subgraph DataLayer["Data Management Layer"]
        %% GraphQL
        GraphQLLayer["GraphQL Layer"]
        Queries["Queries"]:::data
        Mutations["Mutations"]:::data

        %% State Management
        StateManagement["State Management"]
        BlogStore["Blog Store"]:::data
        NavStore["Navbar Store"]:::data

        %% Static Assets
        StaticAssets["Static Assets"]
        DataFiles["Data Files"]:::static
        Whitepaper["Whitepaper"]:::static
        Changelog["Changelog"]:::static
    end

    %% External Services Layer
    subgraph ExternalLayer["External Services"]
        GraphQLBackend["GraphQL Backend"]:::external
    end

    %% Relationships
    PublicPages --> MainLayout
    AdminPages --> MainLayout
    MainLayout --> UIComponents
    MainLayout --> AdminComponents
    GraphQLLayer --> GraphQLBackend
    StateManagement --> UIComponents
    StaticAssets --> PublicPages
    StaticAssets --> AdminPages

    %% Click events
    click HomePage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/index.js"
    click AboutPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/about.js"
    click RegPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/registration.js"
    click PrivacyPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/privacy-policy.js"
    click DashHome "https://github.com/xanf-code/afcai-frontend/blob/main/pages/backend/admin/dashboard.js"
    click LoginPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/backend/admin/login.js"
    click AllTeamsPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/backend/admin/all.js"
    click VerifiedTeamsPage "https://github.com/xanf-code/afcai-frontend/blob/main/pages/backend/admin/verified.js"
    click Navbar "https://github.com/xanf-code/afcai-frontend/blob/main/components/UI/Navbar.js"
    click Footer "https://github.com/xanf-code/afcai-frontend/blob/main/components/UI/Footer.js"
    click Hero "https://github.com/xanf-code/afcai-frontend/blob/main/components/UI/HeroSection.js"
    click Testimonials "https://github.com/xanf-code/afcai-frontend/blob/main/components/UI/TestimonialSection.js"
    click TeamsManagement "https://github.com/xanf-code/afcai-frontend/blob/main/components/Admin/AllTeams.js"
    click VerifiedTeams "https://github.com/xanf-code/afcai-frontend/blob/main/components/Admin/VerifiedTeams.js"
    click TeamContent "https://github.com/xanf-code/afcai-frontend/blob/main/components/Admin/TeamContent.js"
    click MainLayout "https://github.com/xanf-code/afcai-frontend/blob/main/components/Layout/Layout.js"
    click Queries "https://github.com/xanf-code/afcai-frontend/tree/main/graphql/queries"
    click Mutations "https://github.com/xanf-code/afcai-frontend/tree/main/graphql/mutations"
    click BlogStore "https://github.com/xanf-code/afcai-frontend/blob/main/store/BlogStore.js"
    click NavStore "https://github.com/xanf-code/afcai-frontend/blob/main/store/NavBarStore.js"
    click DataFiles "https://github.com/xanf-code/afcai-frontend/tree/main/public/data"
    click Whitepaper "https://github.com/xanf-code/afcai-frontend/blob/main/public/whitepaper/paper_1.pdf"
    click Changelog "https://github.com/xanf-code/afcai-frontend/blob/main/public/data/changelog.md"
```
