# charan300804/gigflow architecture

> Architecture diagram of the GitHub repository charan300804/gigflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/charan300804/gigflow
- Repository: https://github.com/charan300804/gigflow

## Overview

GigFlow is a two-sided freelance marketplace. Clients post gigs, review freelancer bids, and hire; freelancers browse open gigs and submit proposals. The frontend’s routed pages use an Axios client to reach the Express API, while Redux holds session and gig state. Backend route handlers enforce authentication where needed and coordinate MongoDB models; hiring also emits a socket notification to the selected freelancer. The README documents dashboards and real-time alerts; those capabilities are represented without assuming unsampled implementation details beyond the documented links.

Main entry points: [`frontend/src/App.jsx`](https://github.com/charan300804/gigflow/blob/main/frontend/src/App.jsx) (SPA Router), [`frontend/src/api/axios.js`](https://github.com/charan300804/gigflow/blob/main/frontend/src/api/axios.js) (HTTP Client), [`frontend/src/pages/GigDetail.jsx`](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/GigDetail.jsx) (Gig Detail), [`backend/src/server.js`](https://github.com/charan300804/gigflow/blob/main/backend/src/server.js) (Express Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace UI"]
  node_app["SPA Router<br/>[App.jsx]"]
  node_home["Gig Browse<br/>[Home.jsx]"]
  node_gigdetail["Gig Detail<br/>[GigDetail.jsx]"]
  node_creategig["Post Gig<br/>[CreateGig.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_authpages["Sign In / Up<br/>[Login.jsx]"]
  node_gigcard["Gig Card<br/>[GigCard.jsx]"]
  node_bidform["Bid Form<br/>[BidForm.jsx]"]
  node_bidlist["Bid List<br/>[BidList.jsx]"]
  node_axios["HTTP Client<br/>[axios.js]"]
  node_authstate["Auth State<br/>[authSlice.js]"]
  node_gigstate["Gig State<br/>[gigSlice.js]"]
end

subgraph group_api["API and Security"]
  node_server["Express Server<br/>[server.js]"]
  node_authroutes["Auth Routes<br/>[authRoutes.js]"]
  node_gigroutes["Gig Routes<br/>[gigRoutes.js]"]
  node_bidroutes["Bid Routes<br/>[bidRoutes.js]"]
  node_authctrl["Auth Logic<br/>[authController.js]"]
  node_gigctrl["Gig Logic<br/>[gigController.js]"]
  node_bidctrl["Bid and Hire<br/>[bidController.js]"]
  node_authmw["Cookie Auth<br/>[auth.js]"]
end

subgraph group_domain["Marketplace Data"]
  node_users[("User Records<br/>[User.js]")]
  node_gigs[("Gig Records<br/>[Gig.js]")]
  node_bids[("Bid Records<br/>[Bid.js]")]
end

subgraph group_realtime["Live Notifications"]
  node_socketconfig["Socket Setup<br/>[socket.js]"]
  node_socketclient["Socket Client<br/>[socket.js]"]
end

node_freelancer(("Freelancer"))
node_clientuser(("Client"))
node_mongodb[("MongoDB")]
node_socketio["Socket.io"]

node_freelancer -.->|"uses"| node_app
node_clientuser -.->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_gigdetail
node_app -->|"routes to"| node_creategig
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_authpages
node_app -->|"dispatches"| node_authstate
node_app -->|"connects via"| node_socketclient
node_home -->|"requests through"| node_axios
node_home -->|"updates"| node_gigstate
node_home -->|"renders"| node_gigcard
node_gigdetail -->|"requests through"| node_axios
node_gigdetail -->|"updates"| node_gigstate
node_gigdetail -->|"renders"| node_bidform
node_gigdetail -->|"renders"| node_bidlist
node_creategig -->|"requests through"| node_axios
node_creategig -->|"updates"| node_gigstate
node_dashboard -->|"requests through"| node_axios
node_dashboard -->|"updates"| node_gigstate
node_dashboard -->|"renders"| node_gigcard
node_authpages -->|"requests through"| node_axios
node_authpages -->|"updates"| node_authstate
node_axios -->|"sends API requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_gigroutes
node_server -->|"mounts"| node_bidroutes
node_server -->|"initializes"| node_socketconfig
node_authroutes -->|"routes to"| node_authctrl
node_authroutes -->|"protects routes"| node_authmw
node_gigroutes -->|"routes to"| node_gigctrl
node_gigroutes -->|"protects routes"| node_authmw
node_bidroutes -->|"routes to"| node_bidctrl
node_bidroutes -->|"protects routes"| node_authmw
node_authmw -->|"loads user"| node_users
node_authctrl -->|"reads and writes"| node_users
node_gigctrl -.->|"reads and writes"| node_gigs
node_bidctrl -->|"reads and updates"| node_gigs
node_bidctrl -->|"reads and updates"| node_bids
node_socketconfig -.->|"configures"| node_socketio
node_socketclient -.->|"connects to"| node_socketio
node_bidctrl -->|"gets socket"| node_socketconfig
node_socketio -.->|"notifies hire"| node_freelancer
node_mongodb -.->|"persists"| node_users
node_mongodb -.->|"persists"| node_gigs
node_mongodb -.->|"persists"| node_bids

click node_app "https://github.com/charan300804/gigflow/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Home.jsx"
click node_gigdetail "https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/GigDetail.jsx"
click node_creategig "https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/CreateGig.jsx"
click node_dashboard "https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Dashboard.jsx"
click node_authpages "https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Login.jsx"
click node_gigcard "https://github.com/charan300804/gigflow/blob/main/frontend/src/components/GigCard.jsx"
click node_bidform "https://github.com/charan300804/gigflow/blob/main/frontend/src/components/BidForm.jsx"
click node_bidlist "https://github.com/charan300804/gigflow/blob/main/frontend/src/components/BidList.jsx"
click node_axios "https://github.com/charan300804/gigflow/blob/main/frontend/src/api/axios.js"
click node_authstate "https://github.com/charan300804/gigflow/blob/main/frontend/src/store/slices/authSlice.js"
click node_gigstate "https://github.com/charan300804/gigflow/blob/main/frontend/src/store/slices/gigSlice.js"
click node_server "https://github.com/charan300804/gigflow/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/charan300804/gigflow/blob/main/backend/src/routes/authRoutes.js"
click node_gigroutes "https://github.com/charan300804/gigflow/blob/main/backend/src/routes/gigRoutes.js"
click node_bidroutes "https://github.com/charan300804/gigflow/blob/main/backend/src/routes/bidRoutes.js"
click node_authctrl "https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/authController.js"
click node_gigctrl "https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/gigController.js"
click node_bidctrl "https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/bidController.js"
click node_authmw "https://github.com/charan300804/gigflow/blob/main/backend/src/middleware/auth.js"
click node_users "https://github.com/charan300804/gigflow/blob/main/backend/src/models/User.js"
click node_gigs "https://github.com/charan300804/gigflow/blob/main/backend/src/models/Gig.js"
click node_bids "https://github.com/charan300804/gigflow/blob/main/backend/src/models/Bid.js"
click node_socketconfig "https://github.com/charan300804/gigflow/blob/main/backend/src/config/socket.js"
click node_socketclient "https://github.com/charan300804/gigflow/blob/main/frontend/src/socket.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_gigdetail,node_creategig,node_dashboard,node_authpages,node_gigcard,node_bidform,node_bidlist,node_axios,node_authstate,node_gigstate,node_clientuser toneBlue
class node_server,node_authroutes,node_gigroutes,node_bidroutes,node_authctrl,node_gigctrl,node_bidctrl,node_authmw,node_mongodb toneAmber
class node_users,node_gigs,node_bids toneMint
class node_socketconfig,node_socketclient toneRose
class node_freelancer,node_socketio toneIndigo
```

## Components

### Marketplace UI

- [SPA Router](https://github.com/charan300804/gigflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Gig Browse](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Gig Detail](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/GigDetail.jsx): `frontend/src/pages/GigDetail.jsx`
- [Post Gig](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/CreateGig.jsx): `frontend/src/pages/CreateGig.jsx`
- [Dashboard](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Sign In / Up](https://github.com/charan300804/gigflow/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Gig Card](https://github.com/charan300804/gigflow/blob/main/frontend/src/components/GigCard.jsx): `frontend/src/components/GigCard.jsx`
- [Bid Form](https://github.com/charan300804/gigflow/blob/main/frontend/src/components/BidForm.jsx): `frontend/src/components/BidForm.jsx`
- [Bid List](https://github.com/charan300804/gigflow/blob/main/frontend/src/components/BidList.jsx): `frontend/src/components/BidList.jsx`
- [HTTP Client](https://github.com/charan300804/gigflow/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [Auth State](https://github.com/charan300804/gigflow/blob/main/frontend/src/store/slices/authSlice.js): `frontend/src/store/slices/authSlice.js`
- [Gig State](https://github.com/charan300804/gigflow/blob/main/frontend/src/store/slices/gigSlice.js): `frontend/src/store/slices/gigSlice.js`

### API and Security

- [Express Server](https://github.com/charan300804/gigflow/blob/main/backend/src/server.js): `backend/src/server.js`
- [Auth Routes](https://github.com/charan300804/gigflow/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Gig Routes](https://github.com/charan300804/gigflow/blob/main/backend/src/routes/gigRoutes.js): `backend/src/routes/gigRoutes.js`
- [Bid Routes](https://github.com/charan300804/gigflow/blob/main/backend/src/routes/bidRoutes.js): `backend/src/routes/bidRoutes.js`
- [Auth Logic](https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Gig Logic](https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/gigController.js): `backend/src/controllers/gigController.js`
- [Bid and Hire](https://github.com/charan300804/gigflow/blob/main/backend/src/controllers/bidController.js): `backend/src/controllers/bidController.js`
- [Cookie Auth](https://github.com/charan300804/gigflow/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Marketplace Data

- [User Records](https://github.com/charan300804/gigflow/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Gig Records](https://github.com/charan300804/gigflow/blob/main/backend/src/models/Gig.js): `backend/src/models/Gig.js`
- [Bid Records](https://github.com/charan300804/gigflow/blob/main/backend/src/models/Bid.js): `backend/src/models/Bid.js`

### Live Notifications

- [Socket Setup](https://github.com/charan300804/gigflow/blob/main/backend/src/config/socket.js): `backend/src/config/socket.js`
- [Socket Client](https://github.com/charan300804/gigflow/blob/main/frontend/src/socket.js): `frontend/src/socket.js`

### Other components

- **Freelancer**
- **Client**
- **MongoDB**
- **Socket.io**

## Connections

- Freelancer → SPA Router: uses (evidence: `README.md`)
- Client → SPA Router: uses (evidence: `README.md`)
- SPA Router → Gig Browse: routes to (evidence: `frontend/src/App.jsx`)
- SPA Router → Gig Detail: routes to (evidence: `frontend/src/App.jsx`)
- SPA Router → Post Gig: routes to (evidence: `frontend/src/App.jsx`)
- SPA Router → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- SPA Router → Sign In / Up: routes to (evidence: `frontend/src/App.jsx`)
- SPA Router → Auth State: dispatches (evidence: `frontend/src/App.jsx`)
- SPA Router → Socket Client: connects via (evidence: `frontend/src/App.jsx`)
- Gig Browse → HTTP Client: requests through (evidence: `frontend/src/pages/Home.jsx`)
- Gig Browse → Gig State: updates (evidence: `frontend/src/pages/Home.jsx`)
- Gig Browse → Gig Card: renders (evidence: `frontend/src/pages/Home.jsx`)
- Gig Detail → HTTP Client: requests through (evidence: `frontend/src/pages/GigDetail.jsx`)
- Gig Detail → Gig State: updates (evidence: `frontend/src/pages/GigDetail.jsx`)
- Gig Detail → Bid Form: renders (evidence: `frontend/src/pages/GigDetail.jsx`)
- Gig Detail → Bid List: renders (evidence: `frontend/src/pages/GigDetail.jsx`)
- Post Gig → HTTP Client: requests through (evidence: `frontend/src/pages/CreateGig.jsx`)
- Post Gig → Gig State: updates (evidence: `frontend/src/pages/CreateGig.jsx`)
- Dashboard → HTTP Client: requests through (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard → Gig State: updates (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard → Gig Card: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Sign In / Up → HTTP Client: requests through (evidence: `frontend/src/pages/Login.jsx`)
- Sign In / Up → Auth State: updates (evidence: `frontend/src/pages/Login.jsx`)
- HTTP Client → Express Server: sends API requests (evidence: `frontend/src/api/axios.js`)
- Express Server → Auth Routes: mounts (evidence: `backend/src/server.js`)
- Express Server → Gig Routes: mounts (evidence: `backend/src/server.js`)
- Express Server → Bid Routes: mounts (evidence: `backend/src/server.js`)
- Express Server → Socket Setup: initializes (evidence: `backend/src/server.js`)
- Auth Routes → Auth Logic: routes to (evidence: `backend/src/routes/authRoutes.js`)
- Auth Routes → Cookie Auth: protects routes (evidence: `backend/src/routes/authRoutes.js`)
- Gig Routes → Gig Logic: routes to (evidence: `backend/src/routes/gigRoutes.js`)
- Gig Routes → Cookie Auth: protects routes (evidence: `backend/src/routes/gigRoutes.js`)
- Bid Routes → Bid and Hire: routes to (evidence: `backend/src/routes/bidRoutes.js`)
- Bid Routes → Cookie Auth: protects routes (evidence: `backend/src/routes/bidRoutes.js`)
- Cookie Auth → User Records: loads user (evidence: `backend/src/middleware/auth.js`)
- Auth Logic → User Records: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Gig Logic → Gig Records: reads and writes (evidence: `backend/src/controllers/gigController.js`)
- Bid and Hire → Gig Records: reads and updates (evidence: `backend/src/controllers/bidController.js`)
- Bid and Hire → Bid Records: reads and updates (evidence: `backend/src/controllers/bidController.js`)
- Socket Setup → Socket.io: configures (evidence: `README.md`)
- Socket Client → Socket.io: connects to (evidence: `README.md`)
- Bid and Hire → Socket Setup: gets socket (evidence: `backend/src/controllers/bidController.js`)
- Socket.io → Freelancer: notifies hire (evidence: `README.md`)
- MongoDB → User Records: persists (evidence: `README.md`)
- MongoDB → Gig Records: persists (evidence: `README.md`)
- MongoDB → Bid Records: persists (evidence: `README.md`)
