# sid9879/quickhirehub architecture

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

- Interactive diagram: https://gitdiagram.com/sid9879/quickhirehub
- Repository: https://github.com/sid9879/quickhirehub

## Overview

##### Project Type and Purpose
- Full-stack freelancing platform where Clients post jobs and Freelancers apply.
- Role-based flows (Client vs. Freelancer).
- Key features: JWT auth, password reset, Google OAuth, job postings/applications, profile management, ratings.

##### File Structure (Frontend)
- src/
– Job/ (JobListing, JobDetails, Applications)
– Pages/ (Login, Signup, Profile, ManageProjects, ErrorBoundary…)
– Layout/ (common page wrappers, protected routes)
– Mycomponents/ (Navbar, Dashboard variants, LandingPage)
– store/ (Redux Toolkit store + userSlice)
- public/ contains index.html + favicon + manifest
- Config files: vite.config.js, tailwind.config.js, eslint.config.js
→ Indicates a component-based frontend with React Router for navigation and Redux for global state.

##### Extract Architecture Insights from README
- Frontend: React, Redux Toolkit, React Router, Axios, Tailwind CSS.
- Backend (not in this tree but part of overall system): Node.js + Express.js, MongoDB (Mongoose), JWT auth, bcrypt.js.
- External integrations: Google Authentication, Email for password reset.

##### Main Components & Interactions
a. Frontend (Browser)
- React SPA served from Vite dev server or static host (e.g., Vercel).
- React Router handles path-based navigation.
- Redux store holds authenticated user info and UI state.
- Axios issues REST calls to backend.
b. Backend (API Server)
- Express routes (Auth, Jobs, Users, Projects, Ratings).
- Controllers → Services → Data Access (Mongoose models).
- JWT issued on login/signup, validated on protected endpoints.
- Password-reset flow via email service.
- Google OAuth endpoints for third-party sign-in.
c. Database
- MongoDB Atlas (or self-hosted) storing Users, Jobs, Applications, Projects, Reviews.
d. External Services
- Google OAuth (OAuth2 provider)
- Email SMTP/SendGrid (for password reset links)

##### Architectural Patterns & Design Principles
- Client-Server (SPA frontend + RESTful backend).
- MVC-style layering on server: Routes → Controllers → Services → Models.
- Component-based UI on frontend with container (Pages) vs. presentational components (Mycomponents).
- State management via Redux Toolkit slice patterns.
- Protected routes (role-based access) using HOC/Route guards.
- Token-based stateless authentication (JWT).

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef user fill:#eeeeee,stroke:#333,stroke-width:1px;
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:1px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:1px;
    classDef db fill:#fff3cd,stroke:#856404,stroke-width:1px;
    classDef external fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;

    User("User (Client/Freelancer)"):::user

    subgraph "Frontend (Browser)"
      direction TB
      SPA["React SPA"]:::frontend
      App["App Component"]:::frontend
      RouterDef["Router & Routes"]:::frontend
      StoreCfg["Redux Store"]:::frontend
      UserSlice["User Slice"]:::frontend
      Protected["ProtectedRoute"]:::frontend
      LayoutW["Layout Wrapper"]:::frontend
      ViewProfile["ViewUserProfile"]:::frontend
      Landing["LandingPage"]:::frontend
      Navbar["Navbar"]:::frontend
      ClientDash["ClientDashboard"]:::frontend
      Dash["Dashboard"]:::frontend
      JobList["JoblistingsPage"]:::frontend
      JobDetails["JobDetailsPage"]:::frontend
      JobComp["Job Component"]:::frontend
      Application["Application Component"]:::frontend
      ClientPosted["ClientPosted"]:::frontend
      Login["Login Page"]:::frontend
      Signup["Signup Page"]:::frontend
      ForgetPW["ForgetPassword"]:::frontend
      ChooseRole["ChooseRole Page"]:::frontend
      ProfilePage["Profile Page"]:::frontend
      ManageProj["ManageProjects Page"]:::frontend
      ErrorBound["ErrorBoundary"]:::frontend
      NotFound["NotFoundPage"]:::frontend
      About["About Page"]:::frontend
      Contact["Contact Page"]:::frontend
      Styles["Global Stylesheet"]:::frontend
      ViteCfg["Vite Config"]:::frontend
      TailwindCfg["Tailwind Config"]:::frontend
      HTMLTemplate["index.html"]:::frontend
    end

    subgraph "Backend API Server"
      direction TB
      Express["Express App"]:::backend
      AuthRoutes["Auth Routes"]:::backend
      JobRoutes["Jobs Routes"]:::backend
      UserRoutes["User Routes"]:::backend
      ProjRoutes["Projects Routes"]:::backend
      RatingRoutes["Ratings Routes"]:::backend
      Controllers["Controllers"]:::backend
      Services["Service Layer"]:::backend
      Models["Mongoose Models"]:::backend
    end

    subgraph "Database"
      direction TB
      Mongo["MongoDB"]:::db
      UsersC["Users Collection"]:::db
      JobsC["Jobs Collection"]:::db
      AppsC["Applications Collection"]:::db
      ProjC["Projects Collection"]:::db
      RevC["Reviews Collection"]:::db
    end

    subgraph "External Services"
      direction TB
      OAuth["Google OAuth"]:::external
      Email["Email Service (SMTP/SendGrid)"]:::external
    end

    User -->|"interacts with"| SPA
    SPA -->|"renders"| App
    App -->|"uses"| RouterDef
    App -->|"provides state"| StoreCfg
    App -->|"applies styles from"| Styles
    App -->|"serves template"| HTMLTemplate
    RouterDef -->|"guards via"| Protected
    RouterDef --> AuthRoutes
    RouterDef --> JobRoutes
    RouterDef --> UserRoutes
    RouterDef --> ProjRoutes
    RouterDef --> RatingRoutes
    StoreCfg --> UserSlice
    UserSlice -->|"manages auth state"| StoreCfg
    SPA -->|"API calls"| Axios["Axios HTTP Client"]:::frontend

    Axios -->|"HTTP requests"| Express
    Express --> AuthRoutes
    Express --> JobRoutes
    Express --> UserRoutes
    Express --> ProjRoutes
    Express --> RatingRoutes
    AuthRoutes --> Controllers
    JobRoutes --> Controllers
    UserRoutes --> Controllers
    ProjRoutes --> Controllers
    RatingRoutes --> Controllers
    Controllers --> Services
    Services --> Models
    Express -->|"CRUD operations"| Mongo
    Mongo --> UsersC
    Mongo --> JobsC
    Mongo --> AppsC
    Mongo --> ProjC
    Mongo --> RevC
    Express -->|"OAuth2 flow"| OAuth
    Express -->|"send emails"| Email

    click SPA "https://github.com/sid9879/quickhirehub/blob/main/src/main.jsx"
    click App "https://github.com/sid9879/quickhirehub/blob/main/src/App.jsx"
    click RouterDef "https://github.com/sid9879/quickhirehub/blob/main/src/App.jsx"
    click StoreCfg "https://github.com/sid9879/quickhirehub/blob/main/src/store/store.jsx"
    click UserSlice "https://github.com/sid9879/quickhirehub/blob/main/src/store/userSlice.jsx"
    click Protected "https://github.com/sid9879/quickhirehub/blob/main/src/Mycomponents/ProtectedRoute.jsx"
    click LayoutW "https://github.com/sid9879/quickhirehub/blob/main/src/Layout/Layout.jsx"
    click ViewProfile "https://github.com/sid9879/quickhirehub/blob/main/src/Layout/ViewUserProfile.jsx"
    click Landing "https://github.com/sid9879/quickhirehub/blob/main/src/Mycomponents/LandingPage.jsx"
    click Navbar "https://github.com/sid9879/quickhirehub/blob/main/src/Mycomponents/Navbar.jsx"
    click ClientDash "https://github.com/sid9879/quickhirehub/blob/main/src/Mycomponents/ClientDashboard.jsx"
    click Dash "https://github.com/sid9879/quickhirehub/blob/main/src/Mycomponents/Dashboard.jsx"
    click JobList "https://github.com/sid9879/quickhirehub/blob/main/src/Job/JoblistingsPage.jsx"
    click JobDetails "https://github.com/sid9879/quickhirehub/blob/main/src/Job/JobDetailsPage.jsx"
    click JobComp "https://github.com/sid9879/quickhirehub/blob/main/src/Job/Job.jsx"
    click Application "https://github.com/sid9879/quickhirehub/blob/main/src/Job/Application.jsx"
    click ClientPosted "https://github.com/sid9879/quickhirehub/blob/main/src/Job/ClientPosted.jsx"
    click Login "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/Login.jsx"
    click Signup "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/Signup.jsx"
    click ForgetPW "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/ForgetPassword.jsx"
    click ChooseRole "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/ChooseRole.jsx"
    click ProfilePage "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/Profile.jsx"
    click ManageProj "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/ManageProjects.jsx"
    click ErrorBound "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/ErrorBoundary.jsx"
    click NotFound "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/NotFoundPage.jsx"
    click About "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/About.jsx"
    click Contact "https://github.com/sid9879/quickhirehub/blob/main/src/Pages/Contact.jsx"
    click Styles "https://github.com/sid9879/quickhirehub/blob/main/src/index.css"
    click ViteCfg "https://github.com/sid9879/quickhirehub/blob/main/vite.config.js"
    click TailwindCfg "https://github.com/sid9879/quickhirehub/blob/main/tailwind.config.js"
    click HTMLTemplate "https://github.com/sid9879/quickhirehub/blob/main/public/index.html"
```
