# dewgong5/poketask architecture

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

- Interactive diagram: https://gitdiagram.com/dewgong5/poketask
- Repository: https://github.com/dewgong5/poketask

## Overview

##### Overall Project Type and Purpose
- The project is a full-stack, gamified math learning tool that uses Pokemon themes.
- The frontend is built with React (JavaScript) using Tailwind, and it interacts with a separate Node.js/Express backend connected to MongoDB.

- Frontend Application:
- Core: Developed in React, with main entry points like index.html and main.jsx.
- Pages: Home, Login, Play, PokeGarden, Shop, and SignUp. These represent the different “screens” or sections that users navigate through.
- Components: Smaller reusable parts (e.g., Footer, Habitat, Pokemon, Pokeshop, Questions) that make up the pages.
- Assets & Styles: Including static assets (images, credits.txt in the images folder), CSS via TailWind configuration (tailwind.config.js) and custom styles (index.css).
- External Backend Service:
- Backend API (Node.js/Express) repository located separately, which handles data storage, business logic, and database interactions (MongoDB/Mongoose).
- External Services / Deployment:
- Vercel (for deployment of the React app).
- Other tools like Postman can be noted as part of testing and API integration.

##### Relationships and Data Flow
- That the React UI is composed of various pages, each pulling in reusable components (like Footer, Pokemon, etc.), indicating a component-based architecture.
- That state management (if any, not explicit here) flows from the main App.jsx component to its child components.

##### Architectural Patterns and Technologies
- Modular and Component-Based Architecture: Emphasize separation of concerns by showing how different directories (pages, components, assets) work together.
- Frontend-to-Backend Communication: Indicate RESTful API calls from the frontend to the backend service.
- Tech Stack: Clearly annotate components with React, Tailwind, and Vite. Also note that the backend uses Node.js/Express and MongoDB (though it’s in another repository).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Application Container
    subgraph "Frontend Application"
        %% Frontend Core
        subgraph "Frontend Core"
            FC_Index["index.html"]:::core
            FC_Main["main.jsx"]:::core
            FC_App["App.jsx"]:::core
        end

        %% Pages
        subgraph "Pages"
            P_Home["Home Page"]:::pages
            P_Login["Login Page"]:::pages
            P_Play["Play Page"]:::pages
            P_PokeGarden["PokeGarden Page"]:::pages
            P_Shop["Shop Page"]:::pages
            P_SignUp["SignUp Page"]:::pages
        end

        %% Components
        subgraph "Components"
            C_Footer["Footer Component"]:::components
            C_Habitat["Habitat Component"]:::components
            C_Pokemon["Pokemon Component"]:::components
            C_Pokeshop["Pokeshop Component"]:::components
            C_Questions["Questions Component"]:::components
        end

        %% Assets & Styles
        subgraph "Assets & Styles"
            A_Folder["Assets Folder"]:::assets
            A_Images["Images & Static Files"]:::assets
            A_CSS["index.css"]:::assets
            A_Tailwind["Tailwind Config"]:::assets
            A_Vite["Vite Config"]:::assets
        end

        %% Environment & Linting
        subgraph "Environment & Linting"
            E_Env[".env"]:::env
            E_ESLint["ESLint Config"]:::env
        end
    end

    %% External Services
    Backend_API["Backend API (Node.js/Express + MongoDB)"]:::external
    Vercel["Vercel Deployment"]:::deployment

    %% Relationships and Data Flow
    %% Pages calling Backend API
    P_Home -->|"callsAPI"| Backend_API
    P_Login -->|"callsAPI"| Backend_API
    P_Play -->|"callsAPI"| Backend_API
    P_PokeGarden -->|"callsAPI"| Backend_API
    P_Shop -->|"callsAPI"| Backend_API
    P_SignUp -->|"callsAPI"| Backend_API

    %% Components interaction with Backend API
    C_Questions -->|"fetchesData"| Backend_API

    %% Assets & Styles influence Frontend Core
    A_Vite -->|"builds"| FC_App
    A_Tailwind -->|"styles"| FC_App

    %% Environment configuration for Frontend Core
    E_Env -->|"config"| FC_App
    E_ESLint -->|"lint"| FC_App

    %% Frontend App is deployed to Vercel
    FC_App -->|"deployedTo"| Vercel

    %% Pages use common components (example connection)
    P_Home -->|"uses"| C_Footer
    P_Play -->|"uses"| C_Pokeshop

    %% Click Events for Frontend Core
    click FC_Index "https://github.com/dewgong5/poketask/blob/main/poketask/index.html"
    click FC_Main "https://github.com/dewgong5/poketask/blob/main/poketask/src/main.jsx"
    click FC_App "https://github.com/dewgong5/poketask/blob/main/poketask/src/App.jsx"

    %% Click Events for Pages
    click P_Home "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/Home.jsx"
    click P_Login "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/Login.jsx"
    click P_Play "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/Play.jsx"
    click P_PokeGarden "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/PokeGarden.jsx"
    click P_Shop "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/Shop.jsx"
    click P_SignUp "https://github.com/dewgong5/poketask/blob/main/poketask/src/pages/SignUp.jsx"

    %% Click Events for Components
    click C_Footer "https://github.com/dewgong5/poketask/blob/main/poketask/src/components/Footer.jsx"
    click C_Habitat "https://github.com/dewgong5/poketask/blob/main/poketask/src/components/Habitat.jsx"
    click C_Pokemon "https://github.com/dewgong5/poketask/blob/main/poketask/src/components/Pokemon.jsx"
    click C_Pokeshop "https://github.com/dewgong5/poketask/blob/main/poketask/src/components/Pokeshop.jsx"
    click C_Questions "https://github.com/dewgong5/poketask/blob/main/poketask/src/components/Questions.jsx"

    %% Click Events for Assets & Styles
    click A_Folder "https://github.com/dewgong5/poketask/tree/main/poketask/src/assets"
    click A_Images "https://github.com/dewgong5/poketask/tree/main/poketask/src/images"
    click A_CSS "https://github.com/dewgong5/poketask/blob/main/poketask/src/index.css"
    click A_Tailwind "https://github.com/dewgong5/poketask/blob/main/poketask/tailwind.config.js"
    click A_Vite "https://github.com/dewgong5/poketask/blob/main/poketask/vite.config.js"

    %% Click Events for Environment & Linting
    click E_Env "https://github.com/dewgong5/poketask/blob/main/poketask/.env"
    click E_ESLint "https://github.com/dewgong5/poketask/blob/main/poketask/.eslintrc.cjs"

    %% Styles
    classDef core fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef pages fill:#a2d2ff,stroke:#333,stroke-width:2px;
    classDef components fill:#bde0fe,stroke:#333,stroke-width:2px;
    classDef assets fill:#ffefc6,stroke:#333,stroke-width:2px;
    classDef env fill:#ffe066,stroke:#333,stroke-width:2px;
    classDef external fill:#ffadad,stroke:#333,stroke-width:2px;
    classDef deployment fill:#ffcc80,stroke:#333,stroke-width:2px;
```
