# gunasekhar7093/localhire architecture

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

- Interactive diagram: https://gitdiagram.com/gunasekhar7093/localhire
- Repository: https://github.com/gunasekhar7093/localhire

## Overview

LocalHire is a social hiring platform: users register or sign in, publish skill-seeker or vacancy posts, browse and filter opportunities, then contact one another through conversations and messaging. The graph includes the documented admin, profile, privacy, and password-recovery capabilities alongside the main workflow. Some frontend pages and server integrations are unsampled; their documented product roles are retained, but unverified connections are omitted or marked dashed.

Main entry points: [`server/controllers/authController.js`](https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/authController.js) (Account operations), [`client/src/context/AuthContext.jsx`](https://github.com/gunasekhar7093/localhire/blob/main/client/src/context/AuthContext.jsx) (Session context), [`server/server.js`](https://github.com/gunasekhar7093/localhire/blob/main/server/server.js) (Express API and sockets), [`server/routes/postRoutes.js`](https://github.com/gunasekhar7093/localhire/blob/main/server/routes/postRoutes.js) (Post routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Application shell<br/>[App.jsx]"]
  node_authctx["Session context<br/>[AuthContext.jsx]"]
  node_theme["Theme context<br/>[ThemeContext.jsx]"]
  node_config["API configuration<br/>[config.js]"]
  node_skeleton["Loading skeletons<br/>[Skeleton.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_accountpages["Account screens<br/>[Register.jsx]"]
  node_profilepages["Profile screens<br/>[Profile.jsx]"]
  node_adminpages["Admin screens<br/>[AdminDashboard.jsx]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Account operations<br/>[authController.js]"]
  node_authmiddleware["JWT protection<br/>[authMiddleware.js]"]
end

subgraph group_marketplace["Hiring marketplace"]
  node_createpost["Create skill or vacancy<br/>[CreatePost.jsx]"]
  node_explore["Explore and search<br/>[Explore.jsx]"]
  node_postdetails["Post details<br/>[PostDetails.jsx]"]
  node_postprofile["Post cards<br/>[PostCard.jsx]"]
  node_home["Home feed<br/>[Home.jsx]"]
  node_postroutes["Post routes<br/>[postRoutes.js]"]
  node_postcontroller["Post operations<br/>[postController.js]"]
end

subgraph group_messaging["Messaging"]
  node_messagespage["Chat interface<br/>[Messages.jsx]"]
  node_messageroutes["Message routes<br/>[messageRoutes.js]"]
  node_messagecontroller["Conversation operations"]
end

subgraph group_data["Persistence and services"]
  node_users[("User records<br/>[User.js]")]
  node_otps[("OTP records<br/>[OTP.js]")]
  node_posts[("Hiring posts<br/>[Post.js]")]
  node_conversations[("Conversations<br/>[Conversation.js]")]
  node_messages[("Messages<br/>[Message.js]")]
  node_api["Express API and sockets<br/>[server.js]"]
  node_mongodb[("MongoDB")]
  node_email["EmailJS"]
end

node_user(("Platform user"))

node_user -->|"uses"| node_app
node_app -.->|"provides session"| node_authctx
node_app -.->|"uses theme"| node_theme
node_app -.->|"shows feed"| node_home
node_user -->|"registers or signs in"| node_accountpages
node_accountpages -.->|"uses session actions"| node_authctx
node_authctx -->|"uses API URL"| node_config
node_authctx -->|"requests account endpoints"| node_authroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_users
node_authcontroller -->|"stores verification codes"| node_otps
node_authcontroller -->|"deletes user posts"| node_posts
node_authcontroller -->|"cleans up conversations"| node_conversations
node_authcontroller -->|"cleans up messages"| node_messages
node_authmiddleware -->|"loads account"| node_users
node_authcontroller -->|"sends OTP email"| node_email
node_user -->|"publishes listing"| node_createpost
node_user -->|"browses listings"| node_explore
node_createpost -->|"uses API URL"| node_config
node_createpost -->|"uses signed-in user"| node_authctx
node_createpost -.->|"submits listing"| node_postroutes
node_explore -.->|"searches listings"| node_postroutes
node_postroutes -->|"dispatches"| node_postcontroller
node_postroutes -->|"protects writes"| node_authmiddleware
node_postcontroller -->|"queries and saves"| node_posts
node_user -->|"contacts users"| node_messagespage
node_messagespage -->|"uses API URL"| node_config
node_messagespage -->|"uses session and socket"| node_authctx
node_authctx -->|"connects for realtime chat"| node_api
node_messagespage -.->|"uses messaging API"| node_messageroutes
node_messageroutes -->|"dispatches"| node_messagecontroller
node_messageroutes -->|"protects routes"| node_authmiddleware
node_messagecontroller -->|"reads and updates"| node_conversations
node_messagecontroller -->|"reads and writes"| node_messages
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_postroutes
node_api -->|"mounts"| node_messageroutes
node_api -.->|"connects database"| node_mongodb
node_users -.->|"persists records"| node_mongodb
node_posts -.->|"persists records"| node_mongodb
node_messages -.->|"persists records"| node_mongodb
node_conversations -.->|"persists records"| node_mongodb

click node_app "https://github.com/gunasekhar7093/localhire/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/gunasekhar7093/localhire/blob/main/client/src/context/AuthContext.jsx"
click node_theme "https://github.com/gunasekhar7093/localhire/blob/main/client/src/context/ThemeContext.jsx"
click node_config "https://github.com/gunasekhar7093/localhire/blob/main/client/src/config.js"
click node_skeleton "https://github.com/gunasekhar7093/localhire/blob/main/client/src/components/Skeleton.jsx"
click node_accountpages "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Register.jsx"
click node_profilepages "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Profile.jsx"
click node_adminpages "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/AdminDashboard.jsx"
click node_authroutes "https://github.com/gunasekhar7093/localhire/blob/main/server/routes/authRoutes.js"
click node_authcontroller "https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/authController.js"
click node_authmiddleware "https://github.com/gunasekhar7093/localhire/blob/main/server/middleware/authMiddleware.js"
click node_users "https://github.com/gunasekhar7093/localhire/blob/main/server/models/User.js"
click node_otps "https://github.com/gunasekhar7093/localhire/blob/main/server/models/OTP.js"
click node_createpost "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/CreatePost.jsx"
click node_explore "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Explore.jsx"
click node_postdetails "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/PostDetails.jsx"
click node_postprofile "https://github.com/gunasekhar7093/localhire/blob/main/client/src/components/PostCard.jsx"
click node_home "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Home.jsx"
click node_postroutes "https://github.com/gunasekhar7093/localhire/blob/main/server/routes/postRoutes.js"
click node_postcontroller "https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/postController.js"
click node_posts "https://github.com/gunasekhar7093/localhire/blob/main/server/models/Post.js"
click node_messagespage "https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Messages.jsx"
click node_messageroutes "https://github.com/gunasekhar7093/localhire/blob/main/server/routes/messageRoutes.js"
click node_messagecontroller "https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/messageController.js"
click node_conversations "https://github.com/gunasekhar7093/localhire/blob/main/server/models/Conversation.js"
click node_messages "https://github.com/gunasekhar7093/localhire/blob/main/server/models/Message.js"
click node_api "https://github.com/gunasekhar7093/localhire/blob/main/server/server.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_authctx,node_theme,node_config,node_skeleton,node_user toneBlue
class node_accountpages,node_profilepages,node_adminpages,node_authroutes,node_authcontroller,node_authmiddleware toneAmber
class node_createpost,node_explore,node_postdetails,node_postprofile,node_home,node_postroutes,node_postcontroller toneMint
class node_messagespage,node_messageroutes,node_messagecontroller toneRose
class node_users,node_otps,node_posts,node_conversations,node_messages,node_api,node_mongodb,node_email toneIndigo
```

## Components

### Web application

- [Application shell](https://github.com/gunasekhar7093/localhire/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session context](https://github.com/gunasekhar7093/localhire/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Theme context](https://github.com/gunasekhar7093/localhire/blob/main/client/src/context/ThemeContext.jsx): `client/src/context/ThemeContext.jsx`
- [API configuration](https://github.com/gunasekhar7093/localhire/blob/main/client/src/config.js): `client/src/config.js`
- [Loading skeletons](https://github.com/gunasekhar7093/localhire/blob/main/client/src/components/Skeleton.jsx): `client/src/components/Skeleton.jsx`

### Identity and profiles

- [Account screens](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Profile screens](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Profile.jsx): `client/src/pages/Profile.jsx`
- [Admin screens](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/AdminDashboard.jsx): `client/src/pages/AdminDashboard.jsx`
- [Auth routes](https://github.com/gunasekhar7093/localhire/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Account operations](https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [JWT protection](https://github.com/gunasekhar7093/localhire/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`

### Hiring marketplace

- [Create skill or vacancy](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/CreatePost.jsx): `client/src/pages/CreatePost.jsx`
- [Explore and search](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Explore.jsx): `client/src/pages/Explore.jsx`
- [Post details](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/PostDetails.jsx): `client/src/pages/PostDetails.jsx`
- [Post cards](https://github.com/gunasekhar7093/localhire/blob/main/client/src/components/PostCard.jsx): `client/src/components/PostCard.jsx`
- [Home feed](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Post routes](https://github.com/gunasekhar7093/localhire/blob/main/server/routes/postRoutes.js): `server/routes/postRoutes.js`
- [Post operations](https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/postController.js): `server/controllers/postController.js`

### Messaging

- [Chat interface](https://github.com/gunasekhar7093/localhire/blob/main/client/src/pages/Messages.jsx): `client/src/pages/Messages.jsx`
- [Message routes](https://github.com/gunasekhar7093/localhire/blob/main/server/routes/messageRoutes.js): `server/routes/messageRoutes.js`
- [Conversation operations](https://github.com/gunasekhar7093/localhire/blob/main/server/controllers/messageController.js): `server/controllers/messageController.js`

### Persistence and services

- [User records](https://github.com/gunasekhar7093/localhire/blob/main/server/models/User.js): `server/models/User.js`
- [OTP records](https://github.com/gunasekhar7093/localhire/blob/main/server/models/OTP.js): `server/models/OTP.js`
- [Hiring posts](https://github.com/gunasekhar7093/localhire/blob/main/server/models/Post.js): `server/models/Post.js`
- [Conversations](https://github.com/gunasekhar7093/localhire/blob/main/server/models/Conversation.js): `server/models/Conversation.js`
- [Messages](https://github.com/gunasekhar7093/localhire/blob/main/server/models/Message.js): `server/models/Message.js`
- [Express API and sockets](https://github.com/gunasekhar7093/localhire/blob/main/server/server.js): `server/server.js`
- **MongoDB**
- **EmailJS**

### Other components

- **Platform user**

## Connections

- Platform user → Application shell: uses (evidence: `README.md`)
- Application shell → Session context: provides session
- Application shell → Theme context: uses theme
- Application shell → Home feed: shows feed
- Platform user → Account screens: registers or signs in (evidence: `README.md`)
- Account screens → Session context: uses session actions
- Session context → API configuration: uses API URL (evidence: `client/src/context/AuthContext.jsx`)
- Session context → Auth routes: requests account endpoints (evidence: `client/src/context/AuthContext.jsx`)
- Auth routes → Account operations: dispatches (evidence: `server/routes/authRoutes.js`)
- Auth routes → JWT protection: protects routes (evidence: `server/routes/authRoutes.js`)
- Account operations → User records: reads and writes (evidence: `server/controllers/authController.js`)
- Account operations → OTP records: stores verification codes (evidence: `server/controllers/authController.js`)
- Account operations → Hiring posts: deletes user posts (evidence: `server/controllers/authController.js`)
- Account operations → Conversations: cleans up conversations (evidence: `server/controllers/authController.js`)
- Account operations → Messages: cleans up messages (evidence: `server/controllers/authController.js`)
- JWT protection → User records: loads account (evidence: `server/middleware/authMiddleware.js`)
- Account operations → EmailJS: sends OTP email (evidence: `server/controllers/authController.js`)
- Platform user → Create skill or vacancy: publishes listing (evidence: `README.md`)
- Platform user → Explore and search: browses listings (evidence: `README.md`)
- Create skill or vacancy → API configuration: uses API URL (evidence: `client/src/pages/CreatePost.jsx`)
- Create skill or vacancy → Session context: uses signed-in user (evidence: `client/src/pages/CreatePost.jsx`)
- Create skill or vacancy → Post routes: submits listing
- Explore and search → Post routes: searches listings
- Post routes → Post operations: dispatches (evidence: `server/routes/postRoutes.js`)
- Post routes → JWT protection: protects writes (evidence: `server/routes/postRoutes.js`)
- Post operations → Hiring posts: queries and saves (evidence: `server/controllers/postController.js`)
- Platform user → Chat interface: contacts users (evidence: `README.md`)
- Chat interface → API configuration: uses API URL (evidence: `client/src/pages/Messages.jsx`)
- Chat interface → Session context: uses session and socket (evidence: `client/src/pages/Messages.jsx`)
- Session context → Express API and sockets: connects for realtime chat (evidence: `client/src/context/AuthContext.jsx`)
- Chat interface → Message routes: uses messaging API
- Message routes → Conversation operations: dispatches (evidence: `server/routes/messageRoutes.js`)
- Message routes → JWT protection: protects routes (evidence: `server/routes/messageRoutes.js`)
- Conversation operations → Conversations: reads and updates (evidence: `server/controllers/messageController.js`)
- Conversation operations → Messages: reads and writes (evidence: `server/controllers/messageController.js`)
- Express API and sockets → Auth routes: mounts (evidence: `server/server.js`)
- Express API and sockets → Post routes: mounts (evidence: `server/server.js`)
- Express API and sockets → Message routes: mounts (evidence: `server/server.js`)
- Express API and sockets → MongoDB: connects database
- User records → MongoDB: persists records
- Hiring posts → MongoDB: persists records
- Messages → MongoDB: persists records
- Conversations → MongoDB: persists records
