# saptarshi-chakraborty/arcade-progress-tracker architecture

> Architecture diagram of the GitHub repository saptarshi-chakraborty/arcade-progress-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saptarshi-chakraborty/arcade-progress-tracker
- Repository: https://github.com/saptarshi-chakraborty/arcade-progress-tracker

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js that serves both static and server-rendered React pages.
- It uses Appwrite as its backend (authentication, database, storage) and is intended to track Google Cloud Arcade participants’ progress, offering dashboards and reports for participants and facilitators.

##### File structure
- Top-level: package.json, next.config.mjs, public (static assets), src (React code), .env for secrets.
- src/pages: Next.js page routes (/_app, /login, /admin, /facilitator, /example, /my-account, /index).
- src/components: All UI broken down into common, page-specific, and low-level ui/ controls (ShadCN & Tailwind).
- src/contexts: React Context providers for global state and theme.
- src/lib/appwrite.js: Appwrite client configuration for API calls.
- src/data: Static routes list and mock data.
- src/styles: Tailwind global styles.
- No custom backend code beyond next.js API surface; Appwrite handles backend.

##### README
- Appwrite is the backend & database.
- Features for participants vs facilitators with dashboards, chart visualizations, and CRUD-style operations via Appwrite.

##### Main components & interactions
a. Frontend (Browser)
- Next.js rendering (SSR & CSR)
- React pages & components (pages → components → UI)
- React Context for global state & theme
b. Next.js Hosting Layer
- Vercel (or any Next.js-capable host) managing SSR, static builds, and caching
- /.app and /.document customizations
c. Appwrite Backend
- Auth endpoint (signup/login tokens)
- Database collections (participants, progress records, facilitators)
- Storage (if report uploads are stored)
d. Third-party Services & Libraries
- React Hot Toast (notifications)
- Google Cloud Arcade external links (Skill Boost profile)
- Fonts via next/font (Geist)
e. Data Flow
- User interacts via browser → Next.js pages.
- Next.js uses lib/appwrite.js to call Appwrite REST or SDK.
- Appwrite returns data → React Context or page state → UI updates.
- Optional report file uploads → Appwrite storage.

##### Architectural patterns & design principles
- Component-based architecture (common ← page-specific ← pages).
- Separation of concerns: UI components vs data-fetching and Appwrite client config.
- CSR + SSR hybrid (Next.js).
- Context API for global state.
- Tailwind + design system (ShadCN) for styling consistency.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Browser["Browser (User Agent)"]:::frontend
    Browser -->|"HTTP GET/POST"| CDN["CDN / Vercel"]:::hosting

    %% Hosting / Next.js Layer
    subgraph "Next.js Hosting Layer" 
        direction TB
        CDN -->|"Serve SSR HTML / Static Files"| NextJS["Next.js SSR & CSR"]:::hosting
        NextJS -->|"Wrap with Context Providers"| Context["React Context Providers"]:::frontend
        Context -->|"Render Pages & Components"| PagesSubgraph
        NextJS -->|"Import Appwrite SDK"| AppwriteClient["appwrite.js"]:::backend
    end

    subgraph "Pages & Components" 
        direction TB
        PagesSubgraph["Pages (src/pages)"]:::hosting
        ComponentsSubgraph["UI Components (src/components)"]:::frontend
        PagesSubgraph --> ComponentsSubgraph
        click PagesSubgraph "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/tree/master/src/pages"
        click ComponentsSubgraph "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/tree/master/src/components"
    end

    %% Appwrite Backend
    subgraph "Appwrite Backend" 
        direction TB
        Auth["Auth Service"]:::backend
        Database["Database Collections"]:::backend
        Storage["Storage Service"]:::backend
        NextJS -->|"Appwrite SDK/API Calls"| Auth
        NextJS -->|"Appwrite SDK/API Calls"| Database
        NextJS -->|"Appwrite SDK/API Calls"| Storage
    end

    %% External Libraries & Services
    subgraph "Third-party Services & Libraries"
        direction TB
        Toast["React Hot Toast"]:::external
        Icons["Lucide React Icons"]:::external
        Fonts["Geist Font (next/font)"]:::external
        GCA["Google Cloud Arcade"]:::external
        NextJS --> Toast
        NextJS --> Icons
        NextJS --> Fonts
        PagesSubgraph --> GCA
    end

    %% Data Flow to Backend
    Browser -->|"CSR JSON"| NextJS
    NextJS -->|"JSON Response"| Browser

    %% Static Assets
    CDN -->|"Serve Static Assets"| Assets["public/*"]:::hosting
    click Assets "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/tree/master/public"

    %% Context Providers click
    click Context "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/blob/master/src/contexts/GlobalProvider.js"
    click Context "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/blob/master/src/contexts/theme-provider.js"

    %% Appwrite client click
    click AppwriteClient "https://github.com/saptarshi-chakraborty/arcade-progress-tracker/blob/master/src/lib/appwrite.js"

    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef hosting fill:#d4edda,stroke:#155724,color:#155724
    classDef backend fill:#fff3cd,stroke:#856404,color:#856404
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24
```
