# prabhakar-trivedi-33/wealthera-api-playground architecture

> Architecture diagram of the GitHub repository prabhakar-trivedi-33/wealthera-api-playground, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prabhakar-trivedi-33/wealthera-api-playground
- Repository: https://github.com/prabhakar-trivedi-33/wealthera-api-playground

## Overview

##### Project type and purpose
- This is a single‐page React frontend application (“InWealthera API Playground”) intended to simulate the functionality of an external API testing UI (test-ui.inwealthera.com).
- It provides a mock authentication flow, lets users pick endpoints, edit JSON requests, send them, and display formatted JSON responses.

##### File structure
- Top‐level files
- .gitignore, README.md, package.json: standard project metadata
- .env (in README instructions): holds REACT_APP_API_BASE_URL and REACT_APP_DEFAULT_AUTH_TOKEN
- src/ directory
- index.js: React entry point, renders <App /> into the DOM
- App.js / App.css: main application component & global styling
- components/: UI building blocks
– ApiPlayground.js: wrapper for the playground interface
– EndpointSelector.js: dropdown to choose API endpoints
– RequestEditor.js: JSON editor with validation
– ResponseViewer.js: syntax‐highlighted display of JSON responses
- context/AuthContext.js: React Context provider for auth state (login/logout, token storage)
- No backend code here; this is purely client‐side and relies on an external API service.

##### Key architectural insights from README
- Technology stack: React (hooks + context), CSS for styling, Node.js/npm for build & dev server.
- Runtime configuration via environment variables (API_BASE_URL, DEFAULT_AUTH_TOKEN).
- Core features: authentication shim, endpoint selection, request/response tooling, error handling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Top-level Browser
    Browser["Browser\n(User Interface)"]:::ui

    %% Environment variables
    Env[".env\n(env vars)"]:::build

    %% HTTP Client and External API
    HTTPClient["HTTP Client\n(fetch/axios)"]:::network
    ExternalAPI["External API Service\n(REACT_APP_API_BASE_URL)"]:::external

    %% Build & Deployment Tools
    BuildTools["Build & Deployment\n(package.json, .gitignore, README.md)"]:::build

    %% React Application Container
    subgraph "React Application"
        ReactApp["Entry Point\n<index.js>"]:::ui
        AppComp["App Component\n< App.js >"]:::ui
        AppCSS["App Styles\n< App.css >"]:::ui
        GlobalCSS["Global Styles\n< index.css >"]:::ui
        AuthContext["AuthContext\n< AuthContext.js >"]:::state
        subgraph "ApiPlayground"
            APComp["ApiPlayground\n< ApiPlayground.js >"]:::ui
            APCSS["ApiPlayground Styles\n< ApiPlayground.css >"]:::ui
            ESComp["EndpointSelector\n< EndpointSelector.js >"]:::ui
            ESCSS["EndpointSelector Styles\n< EndpointSelector.css >"]:::ui
            REComp["RequestEditor\n< RequestEditor.js >"]:::ui
            RECSS["RequestEditor Styles\n< RequestEditor.css >"]:::ui
            RVComp["ResponseViewer\n< ResponseViewer.js >"]:::ui
            RVCSS["ResponseViewer Styles\n< ResponseViewer.css >"]:::ui
        end
    end

    %% Data Flows
    Browser --> ReactApp
    Env --> HTTPClient
    ReactApp --> AuthContext
    ReactApp --> AppComp
    ReactApp --> AppCSS
    ReactApp --> GlobalCSS
    AuthContext --> REComp
    AppComp --> APComp
    APComp --> ESComp
    APComp --> REComp
    APComp --> RVComp
    REComp --> HTTPClient
    HTTPClient --> ExternalAPI
    ExternalAPI --> RVComp
    BuildTools --> Browser

    %% Click Events
    click ReactApp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/index.js"
    click AppComp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/App.js"
    click AppCSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/App.css"
    click GlobalCSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/index.css"
    click AuthContext "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/context/AuthContext.js"
    click APComp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/ApiPlayground/ApiPlayground.js"
    click APCSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/ApiPlayground/ApiPlayground.css"
    click ESComp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/EndpointSelector/EndpointSelector.js"
    click ESCSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/EndpointSelector/EndpointSelector.css"
    click REComp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/RequestEditor/RequestEditor.js"
    click RECSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/RequestEditor/RequestEditor.css"
    click RVComp "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/ResponseViewer/ResponseViewer.js"
    click RVCSS "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/src/components/ResponseViewer/ResponseViewer.css"
    click BuildTools "https://github.com/prabhakar-trivedi-33/wealthera-api-playground/blob/main/package.json"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085,stroke-width:1px
    classDef state fill:#d4edda,stroke:#155724,color:#155724,stroke-width:1px
    classDef network fill:#fff3cd,stroke:#856404,color:#856404,stroke-width:1px
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d,stroke-width:1px
    classDef build fill:#f8f9fa,stroke:#6c757d,color:#6c757d,stroke-width:1px
```
