# poorvaja-v/jobby-app architecture

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

- Interactive diagram: https://gitdiagram.com/poorvaja-v/jobby-app
- Repository: https://github.com/poorvaja-v/jobby-app

## Overview

##### Project type and purpose
- This is a **single-page React application** (“Jobby App”) that provides user authentication and job‐search functionality by consuming external REST APIs.
- Users can log in, view a profile, browse and filter jobs, view job details, and handle not-found or error states—all within a client‐side SPA.

##### File structure
- Top-level config: ESLint, Prettier, PNPM lock, package.json—standard JS project.
- public/: static assets (index.html, manifest, images) served by a static host (e.g., S3, Netlify).
- src/: React source code
- App.js, index.js – entry points, Router setup
- components/ – folder per UI view or widget (Login, Home, Jobs, JobCard, JobItemDetails, ProfileDetails, FiltersGroup, SimilarJobCard, Header, ProtectedRoute, NotFound)
- CSS files colocated with each component
- setupTests.js – test harness

##### README for additional insights
- Describes routes (Login, Home, Jobs, Job Details, Not Found) with responsive-UI mockups.
- Lists four external APIs: POST /login, GET /profile, GET /jobs, GET /jobs/:id.
- API responses include a JWT token and JSON data.

##### Detail without over-splitting
- Related UI components under a single “React SPA” container but call out major views (Login, Home, Jobs, JobDetails).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User and Hosting
    User["User"]:::external
    StaticHost["Static Host (S3/CDN)\nserves index.html + JS/CSS"]:::infra
    click StaticHost "https://github.com/poorvaja-v/jobby-app/blob/master/public/index.html"
    
    %% Browser and Storage
    Browser["Browser"]:::infra
    Storage["JWT Storage\n(localStorage or Cookies)"]:::storage

    User -->|opens app| Browser
    Browser -->|fetch index.html & bundle| StaticHost
    Browser -->|loads bundle| ReactSPA

    %% React SPA Container
    subgraph "React SPA" 
        direction TB
        IndexJS["src/index.js"]:::frontend
        click IndexJS "https://github.com/poorvaja-v/jobby-app/blob/master/src/index.js"
        AppJS["src/App.js\n(Router Setup)"]:::frontend
        click AppJS "https://github.com/poorvaja-v/jobby-app/blob/master/src/App.js"
        IndexJS --> AppJS

        subgraph "Routing"
            direction TB
            ProtectedRoute["ProtectedRoute\nAuth Guard"]:::frontend
            click ProtectedRoute "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/ProtectedRoute/index.js"
            Login["Login View\nPOST /login"]:::frontend
            click Login "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/Login/index.js"
            NotFound["NotFound\nUnknown routes / errors"]:::frontend
            click NotFound "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/NotFound/index.js"
            
            AppJS -->|route /login| Login
            AppJS -->|route /*| ProtectedRoute
            AppJS -->|unknown route| NotFound
            ProtectedRoute -->|if no token| Login
            ProtectedRoute -->|if token present| SecuredRoutes
        end

        subgraph "SecuredRoutes"
            direction TB
            Header["Header\nNavigation"]:::frontend
            click Header "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/Header/index.js"

            Home["Home View\nGET /profile"]:::frontend
            click Home "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/Home/index.js"
            ProfileDetails["ProfileDetails\nGET /profile"]:::frontend
            click ProfileDetails "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/ProfileDetails/index.js"
            
            Jobs["Jobs View\nGET /jobs"]:::frontend
            click Jobs "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/Jobs/index.js"
            FiltersGroup["FiltersGroup\nFilter controls"]:::frontend
            click FiltersGroup "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/FiltersGroup/index.js"
            JobCard["JobCard\nJob listing item"]:::frontend
            click JobCard "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/JobCard/index.js"
            
            JobItemDetails["JobItemDetails\nGET /jobs/:id"]:::frontend
            click JobItemDetails "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/JobItemDetails/index.js"
            SimilarJobCard["SimilarJobCard\nRelated jobs"]:::frontend
            click SimilarJobCard "https://github.com/poorvaja-v/jobby-app/blob/master/src/components/SimilarJobCard/index.js"
            
            Header --> Home
            Header --> Jobs
            Header --> JobItemDetails
            
            Home --> ProfileDetails
            
            Jobs --> FiltersGroup
            Jobs --> JobCard
            
            JobItemDetails --> SimilarJobCard
        end
    end

    %% Storage usage
    ProtectedRoute -->|reads token| Storage
    Login -->|stores token| Storage

    %% External API Services
    subgraph "External API (apis.ccbp.in)"
        direction TB
        AuthService["POST /login"]:::api
        ProfileService["GET /profile"]:::api
        JobsService["GET /jobs"]:::api
        JobDetailService["GET /jobs/:id"]:::api
    end

    %% API Interactions
    Login -->|POST /login| AuthService
    Home -->|GET /profile| ProfileService
    ProfileDetails -->|GET /profile| ProfileService
    Jobs -->|GET /jobs| JobsService
    JobItemDetails -->|GET /jobs/:id| JobDetailService

    %% Test Setup (optional harness)
    SetupTests["Test Harness\nsetupTests.js"]:::infra
    click SetupTests "https://github.com/poorvaja-v/jobby-app/blob/master/src/setupTests.js"
    
    %% Styles
    classDef frontend fill:#E3F2FD,stroke:#2196F3,color:#0D47A1;
    classDef api fill:#E8F5E9,stroke:#4CAF50,color:#1B5E20;
    classDef infra fill:#F5F5F5,stroke:#9E9E9E,color:#424242;
    classDef storage fill:#FFF3E0,stroke:#FFB300,color:#E65100;
    classDef external fill:#E1F5FE,stroke:#03A9F4,color:#01579B;
```
