# navikareddy/gamifiedlearninglabs architecture

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

- Interactive diagram: https://gitdiagram.com/navikareddy/gamifiedlearninglabs
- Repository: https://github.com/navikareddy/gamifiedlearninglabs

## Overview

##### Project type and purpose
- This is a full-stack web application bootstrapped with Create React App on the front end and an Express/Node.js server on the back end.
- It hosts multiple Unity WebGL games, a React-based algorithm/DSA learning environment, and a code-compiler feature, plus user authentication and leaderboard functionality.

##### File structure
- Top-level directories/files:
- public/ – static assets including three Unity WebGL game builds (BSWebBuild, Game_WebGL, basketGame) and the main index.html
- src/ – React application source code, organized by feature components (CodeCompiler, DSA, games, SignIn/SignUp, LeaderBoard, etc.)
- APIs/ – Express route handlers for compileApi.js (code compilation) and usersApi.js (user auth & profiles)
- server.js – Express server entry point that serves the React app, static files, and mounts the APIs
- tailwind.config.js – Tailwind CSS configuration
- Patterns:
- Client-server separation (SPA + REST APIs)
- Feature-based component structure in React (each game/algorithm is its own module)
- Static file hosting for Unity WebGL builds

##### README for additional insights
- Standard Create React App scripts (start, build, test, eject)
- No built-in DB mentioned—assume usersApi may rely on an external database or in-memory store

##### Detail
- Separate Unity WebGL builds into distinct static asset nodes
- How tailwind.config feeds into the build process (optional annotation)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client (Browser/React SPA)"
        IndexHTML["public/index.html"]:::frontend
        IndexJS["src/index.js"]:::frontend
        App["src/App.js"]:::frontend
        CodeCompiler["CodeCompiler UI"]:::frontend
        DSA["DSA Environment"]:::frontend
        DemoBS["DemoBinarySearch"]:::frontend
        PlayBS["PlayBS"]:::frontend
        DemoDij["DemoDijkstra"]:::frontend
        PlayDij["PlayDijkstra"]:::frontend
        PostfixUI["Postfix UI"]:::frontend
        PostfixLogic["postfixEvaluator"]:::frontend
        SignIn["SignIn UI"]:::frontend
        SignUp["SignUp UI"]:::frontend
        LeaderBoard["LeaderBoard UI"]:::frontend
    end

    subgraph "Server (Node.js/Express)"
        Server["Express Server (server.js)"]:::backend
        Tailwind["tailwind.config.js"]:::backend
        subgraph "Services"
            Compile["compileApi"]:::backend
            Users["usersApi"]:::backend
        end
        subgraph "Static Asset Hosting"
            BSWeb["BSWebBuild"]:::static
            GameWeb["Game_WebGL"]:::static
            Basket["basketGame"]:::static
        end
        DB["Database"]:::db
    end

    %% Client flows
    IndexHTML -->|loads React SPA| IndexJS
    IndexJS -->|initializes| App
    App --> CodeCompiler
    App --> DSA
    DSA --> DemoBS
    DSA --> DemoDij
    DSA --> PostfixUI
    DemoBS --> PlayBS
    DemoDij --> PlayDij
    App --> SignIn
    App --> SignUp
    App --> LeaderBoard

    %% API interactions
    CodeCompiler -->|POST /api/compile| Compile
    SignIn -->|POST /api/users/signin| Users
    SignUp -->|POST /api/users/signup| Users
    LeaderBoard -->|GET /api/users/leaderboard| Users

    %% Unity asset loading
    App -->|fetch WASM assets| BSWeb
    App -->|fetch WASM assets| GameWeb
    App -->|fetch WASM assets| Basket

    %% Server responsibilities
    Server -->|serves index.html & static| IndexHTML
    Server -->|serves static builds| BSWeb
    Server -->|serves static builds| GameWeb
    Server -->|serves static builds| Basket
    Server -->|mounts| Compile
    Server -->|mounts| Users
    Users -->|reads/writes| DB

    %% Click Events
    click IndexHTML "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/public/index.html"
    click IndexJS "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/index.js"
    click App "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/App.js"
    click CodeCompiler "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/CodeCompiler/CodeCompiler.js"
    click DSA "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/DSA/DSA.js"
    click DemoBS "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/DemoBS/DemoBinarySearch.js"
    click PlayBS "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/PlayBS/PlayBS.js"
    click DemoDij "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/DemoDijkstra/DemoDijkstra.js"
    click PlayDij "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/PlayDijkstra/PlayDijkstra.js"
    click PostfixUI "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/Postfix/Postfix.js"
    click PostfixLogic "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/Postfix/postfixEvaluator.js"
    click SignIn "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/SignIn/SignIn.js"
    click SignUp "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/SignUp/SignUp.js"
    click LeaderBoard "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/src/Components/LeaderBoard/LeaderBoard.js"
    click Server "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/server.js"
    click Compile "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/APIs/compileApi.js"
    click Users "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/APIs/usersApi.js"
    click BSWeb "https://github.com/navikareddy/gamifiedlearninglabs/tree/main/public/BSWebBuild/"
    click GameWeb "https://github.com/navikareddy/gamifiedlearninglabs/tree/main/public/Game_WebGL/"
    click Basket "https://github.com/navikareddy/gamifiedlearninglabs/tree/main/public/basketGame/"
    click Tailwind "https://github.com/navikareddy/gamifiedlearninglabs/blob/main/tailwind.config.js"

    classDef frontend fill:#cce5ff,stroke:#004085
    classDef backend fill:#d4edda,stroke:#155724
    classDef static fill:#e2e3e5,stroke:#6c757d
    classDef db fill:#fff3cd,stroke:#856404
```
