# 450gowsik/daycraft architecture

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

- Interactive diagram: https://gitdiagram.com/450gowsik/daycraft
- Repository: https://github.com/450gowsik/daycraft

## Overview

DayCraft is a bilingual local-labor marketplace. Workers register and verify their identity, discover nearby or recommended jobs, apply, and communicate; employers post jobs and manage applicants, while admins oversee platform activity. The React SPA calls an Express API whose domain routes and controllers coordinate MongoDB-backed records, matching, and marketplace services. The graph includes documented chat, notification, payment, and chatbot capabilities even where their implementation was not sampled; those links use README or API registration evidence rather than inferred internal calls.

Main entry points: [`backend/src/app.js`](https://github.com/450gowsik/daycraft/blob/master/backend/src/app.js) (Express API), [`frontend/src/App.jsx`](https://github.com/450gowsik/daycraft/blob/master/frontend/src/App.jsx) (React application), [`backend/src/controllers/auth.controller.js`](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/auth.controller.js) (Authentication), [`backend/src/models/User.js`](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/User.js) (User identity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_spa["React application<br/>[App.jsx]"]
  node_language["Bilingual UI"]
  node_home["Job discovery<br/>[Home.jsx]"]
  node_jobdetail["Job details<br/>[JobDetails.jsx]"]
  node_postjob["Job posting<br/>[PostJob.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_otp["OTP verification<br/>[otp.controller.js]"]
  node_authmiddleware["Access control<br/>[auth.js]"]
  node_refresh["Refresh tokens"]
  node_jwt["JWT utilities<br/>[jwt.js]"]
end

subgraph group_marketplace["Hiring marketplace"]
  node_jobs["Job management<br/>[job.controller.js]"]
  node_applications["Applications"]
  node_matching["Job matching<br/>[matchingService.js]"]
end

subgraph group_services["Platform services"]
  node_api["Express API<br/>[app.js]"]
  node_communication["Chat and notifications"]
  node_payments["Payments"]
  node_admin["Administration<br/>[adminController.js]"]
  node_chatbot["AI chatbot<br/>[groqService.js]"]
  node_queryservice["Chatbot data queries<br/>[dbQueryService.js]"]
  node_email["Email delivery<br/>[emailService.js]"]
  node_sms["SMS delivery<br/>[smsService.js]"]
end

subgraph group_data["Persistence"]
  node_users["User identity<br/>[User.js]"]
  node_workerprofile["Worker profiles<br/>[Worker.js]"]
  node_employerprofile["Employer profiles<br/>[Employer.js]"]
  node_jobrecords["Job records<br/>[Job.js]"]
  node_applicationrecords["Application records<br/>[Application.js]"]
  node_mongo[("MongoDB<br/>[db.js]")]
end

node_browser(("Marketplace users"))

node_browser -->|"uses"| node_spa
node_spa -->|"routes to"| node_home
node_spa -->|"routes to"| node_jobdetail
node_spa -->|"routes to"| node_postjob
node_spa -->|"routes to"| node_register
node_spa -->|"shares state"| node_language
node_spa -->|"calls REST API"| node_api
node_api -->|"routes requests"| node_auth
node_api -->|"routes requests"| node_jobs
node_api -->|"routes requests"| node_applications
node_api -->|"routes requests"| node_communication
node_api -->|"routes requests"| node_payments
node_api -->|"routes requests"| node_admin
node_api -->|"routes requests"| node_chatbot
node_auth -->|"creates and reads"| node_users
node_auth -->|"manages profile"| node_workerprofile
node_auth -->|"manages profile"| node_employerprofile
node_auth -->|"uses tokens"| node_refresh
node_auth -->|"sends email"| node_email
node_auth -->|"creates tokens"| node_jwt
node_otp -->|"checks identity"| node_users
node_otp -->|"sends codes"| node_sms
node_otp -->|"sends codes"| node_email
node_authmiddleware -->|"verifies tokens"| node_jwt
node_authmiddleware -->|"loads user"| node_users
node_jobs -->|"reads and writes"| node_jobrecords
node_jobs -->|"loads worker"| node_users
node_jobs -->|"requests recommendations"| node_matching
node_jobs -->|"creates notifications"| node_communication
node_applications -->|"reads and writes"| node_applicationrecords
node_applications -->|"loads job"| node_jobrecords
node_applications -->|"loads worker"| node_users
node_applications -->|"notifies users"| node_communication
node_chatbot -->|"requests live data"| node_queryservice
node_queryservice -->|"queries"| node_workerprofile
node_queryservice -->|"queries"| node_jobrecords
node_queryservice -->|"queries"| node_users
node_queryservice -->|"queries"| node_employerprofile
node_api -->|"connects to"| node_mongo
node_payments -.->|"persists payment data"| node_mongo

click node_spa "https://github.com/450gowsik/daycraft/blob/master/frontend/src/App.jsx"
click node_language "https://github.com/450gowsik/daycraft/blob/master/frontend/src/context/LanguageContext.jsx"
click node_home "https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/Home.jsx"
click node_jobdetail "https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/JobDetails.jsx"
click node_postjob "https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/PostJob.jsx"
click node_register "https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/auth/Register.jsx"
click node_api "https://github.com/450gowsik/daycraft/blob/master/backend/src/app.js"
click node_auth "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/auth.controller.js"
click node_otp "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/otp.controller.js"
click node_authmiddleware "https://github.com/450gowsik/daycraft/blob/master/backend/src/middleware/auth.js"
click node_users "https://github.com/450gowsik/daycraft/blob/master/backend/src/models/User.js"
click node_workerprofile "https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Worker.js"
click node_employerprofile "https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Employer.js"
click node_jobs "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/job.controller.js"
click node_jobrecords "https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Job.js"
click node_applications "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/application.controller.js"
click node_applicationrecords "https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Application.js"
click node_matching "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/matchingService.js"
click node_communication "https://github.com/450gowsik/daycraft/tree/master/backend/src/controllers"
click node_payments "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/paymentController.js"
click node_admin "https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/adminController.js"
click node_chatbot "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/groqService.js"
click node_queryservice "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/dbQueryService.js"
click node_mongo "https://github.com/450gowsik/daycraft/blob/master/backend/src/config/db.js"
click node_email "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/emailService.js"
click node_sms "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/smsService.js"
click node_refresh "https://github.com/450gowsik/daycraft/blob/master/backend/src/services/refreshTokenService.js"
click node_jwt "https://github.com/450gowsik/daycraft/blob/master/backend/src/utils/jwt.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_spa,node_language,node_home,node_jobdetail,node_postjob,node_register,node_browser toneBlue
class node_auth,node_otp,node_authmiddleware,node_refresh,node_jwt toneAmber
class node_jobs,node_applications,node_matching toneMint
class node_api,node_communication,node_payments,node_admin,node_chatbot,node_queryservice,node_email,node_sms toneRose
class node_users,node_workerprofile,node_employerprofile,node_jobrecords,node_applicationrecords,node_mongo toneIndigo
```

## Components

### Web experience

- [React application](https://github.com/450gowsik/daycraft/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Bilingual UI](https://github.com/450gowsik/daycraft/blob/master/frontend/src/context/LanguageContext.jsx): `frontend/src/context/LanguageContext.jsx`
- [Job discovery](https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Job details](https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/JobDetails.jsx): `frontend/src/pages/JobDetails.jsx`
- [Job posting](https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/PostJob.jsx): `frontend/src/pages/PostJob.jsx`
- [Registration](https://github.com/450gowsik/daycraft/blob/master/frontend/src/pages/auth/Register.jsx): `frontend/src/pages/auth/Register.jsx`

### Identity and profiles

- [Authentication](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [OTP verification](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/otp.controller.js): `backend/src/controllers/otp.controller.js`
- [Access control](https://github.com/450gowsik/daycraft/blob/master/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Refresh tokens](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/refreshTokenService.js): `backend/src/services/refreshTokenService.js`
- [JWT utilities](https://github.com/450gowsik/daycraft/blob/master/backend/src/utils/jwt.js): `backend/src/utils/jwt.js`

### Hiring marketplace

- [Job management](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/job.controller.js): `backend/src/controllers/job.controller.js`
- [Applications](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/application.controller.js): `backend/src/controllers/application.controller.js`
- [Job matching](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/matchingService.js): `backend/src/services/matchingService.js`

### Platform services

- [Express API](https://github.com/450gowsik/daycraft/blob/master/backend/src/app.js): `backend/src/app.js`
- [Chat and notifications](https://github.com/450gowsik/daycraft/tree/master/backend/src/controllers): `backend/src/controllers`
- [Payments](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/paymentController.js): `backend/src/controllers/paymentController.js`
- [Administration](https://github.com/450gowsik/daycraft/blob/master/backend/src/controllers/adminController.js): `backend/src/controllers/adminController.js`
- [AI chatbot](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/groqService.js): `backend/src/services/groqService.js`
- [Chatbot data queries](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/dbQueryService.js): `backend/src/services/dbQueryService.js`
- [Email delivery](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/emailService.js): `backend/src/services/emailService.js`
- [SMS delivery](https://github.com/450gowsik/daycraft/blob/master/backend/src/services/smsService.js): `backend/src/services/smsService.js`

### Persistence

- [User identity](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/User.js): `backend/src/models/User.js`
- [Worker profiles](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Worker.js): `backend/src/models/Worker.js`
- [Employer profiles](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Employer.js): `backend/src/models/Employer.js`
- [Job records](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Job.js): `backend/src/models/Job.js`
- [Application records](https://github.com/450gowsik/daycraft/blob/master/backend/src/models/Application.js): `backend/src/models/Application.js`
- [MongoDB](https://github.com/450gowsik/daycraft/blob/master/backend/src/config/db.js): `backend/src/config/db.js`

### Other components

- **Marketplace users**

## Connections

- Marketplace users → React application: uses
- React application → Job discovery: routes to (evidence: `frontend/src/App.jsx`)
- React application → Job details: routes to (evidence: `frontend/src/App.jsx`)
- React application → Job posting: routes to (evidence: `frontend/src/App.jsx`)
- React application → Registration: routes to (evidence: `frontend/src/App.jsx`)
- React application → Bilingual UI: shares state (evidence: `frontend/src/main.jsx`)
- React application → Express API: calls REST API
- Express API → Authentication: routes requests (evidence: `backend/src/app.js`)
- Express API → Job management: routes requests (evidence: `backend/src/app.js`)
- Express API → Applications: routes requests (evidence: `backend/src/app.js`)
- Express API → Chat and notifications: routes requests (evidence: `backend/src/app.js`)
- Express API → Payments: routes requests (evidence: `backend/src/app.js`)
- Express API → Administration: routes requests (evidence: `backend/src/app.js`)
- Express API → AI chatbot: routes requests (evidence: `backend/src/app.js`)
- Authentication → User identity: creates and reads (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → Worker profiles: manages profile (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → Employer profiles: manages profile (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → Refresh tokens: uses tokens (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → Email delivery: sends email (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → JWT utilities: creates tokens (evidence: `backend/src/controllers/auth.controller.js`)
- OTP verification → User identity: checks identity (evidence: `backend/src/controllers/otp.controller.js`)
- OTP verification → SMS delivery: sends codes (evidence: `backend/src/controllers/otp.controller.js`)
- OTP verification → Email delivery: sends codes (evidence: `backend/src/controllers/otp.controller.js`)
- Access control → JWT utilities: verifies tokens (evidence: `backend/src/middleware/auth.js`)
- Access control → User identity: loads user (evidence: `backend/src/middleware/auth.js`)
- Job management → Job records: reads and writes (evidence: `backend/src/controllers/job.controller.js`)
- Job management → User identity: loads worker (evidence: `backend/src/controllers/job.controller.js`)
- Job management → Job matching: requests recommendations (evidence: `backend/src/controllers/job.controller.js`)
- Job management → Chat and notifications: creates notifications (evidence: `backend/src/controllers/job.controller.js`)
- Applications → Application records: reads and writes (evidence: `backend/src/controllers/application.controller.js`)
- Applications → Job records: loads job (evidence: `backend/src/controllers/application.controller.js`)
- Applications → User identity: loads worker (evidence: `backend/src/controllers/application.controller.js`)
- Applications → Chat and notifications: notifies users (evidence: `backend/src/controllers/application.controller.js`)
- AI chatbot → Chatbot data queries: requests live data (evidence: `backend/src/services/groqService.js`)
- Chatbot data queries → Worker profiles: queries (evidence: `backend/src/services/dbQueryService.js`)
- Chatbot data queries → Job records: queries (evidence: `backend/src/services/dbQueryService.js`)
- Chatbot data queries → User identity: queries (evidence: `backend/src/services/dbQueryService.js`)
- Chatbot data queries → Employer profiles: queries (evidence: `backend/src/services/dbQueryService.js`)
- Express API → MongoDB: connects to (evidence: `backend/src/app.js`)
- Payments → MongoDB: persists payment data
