# simplyolga/group5marathon2 architecture

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

- Interactive diagram: https://gitdiagram.com/simplyolga/group5marathon2
- Repository: https://github.com/simplyolga/group5marathon2

## Overview

React Jobs Project provides two React frontends: a simplified CRUD experience and a fuller version with sign-up and login. Users browse job listings and details; the fuller version also supports authenticated job creation, editing, and deletion. The repository includes a mock-server option and a separate Express/Mongoose API with job and user routes. Several frontend/API connections are not shown in sampled source, so those links are marked unverified rather than asserted as direct calls.

Main entry points: [`frontend/src/App.jsx`](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/App.jsx) (Routes and job actions), [`frontend-simplified/src/App.jsx`](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/App.jsx) (Simplified routes), [`backend/api-server-starter/app.js`](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/app.js) (Express entry point), [`backend/api-server-starter/routes/jobRouter.js`](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/routes/jobRouter.js) (Job routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simple["Simplified frontend"]
  node_simple_app["Simplified routes<br/>[App.jsx]"]
  node_simple_home["Home and listings<br/>[HomePage.jsx]"]
  node_simple_list["Job list UI<br/>[JobListings.jsx]"]
  node_simple_detail["Job details<br/>[JobPage.jsx]"]
  node_simple_add["Create job form<br/>[AddJobPage.jsx]"]
  node_simple_edit["Edit job form<br/>[EditJobPage.jsx]"]
end

subgraph group_full["Full frontend"]
  node_full_app["Routes and job actions<br/>[App.jsx]"]
  node_full_layout["Navigation layout<br/>[MainLayout.jsx]"]
  node_full_home["Home and listings<br/>[HomePage.jsx]"]
  node_full_list["Job list UI<br/>[JobListings.jsx]"]
  node_full_detail["Job details<br/>[JobPage.jsx]"]
  node_full_add["Create job form<br/>[AddJobPage.jsx]"]
  node_full_edit["Edit job form<br/>[EditJobPage.jsx]"]
  node_full_auth["Sign-in and signup<br/>[Login.jsx]"]
end

subgraph group_api["API server"]
  node_api_app["Express entry point<br/>[app.js]"]
  node_job_routes["Job routes<br/>[jobRouter.js]"]
  node_user_routes["User routes<br/>[userRouter.js]"]
  node_auth_middleware["Token authorization<br/>[requireAuth.js]"]
  node_db_config["Database connection setup<br/>[db.js]"]
end

subgraph group_domain["Job and user domain"]
  node_job_logic["Job operations<br/>[jobControllers.js]"]
  node_user_logic["User operations<br/>[userControllers.js]"]
  node_job_model[("Job records<br/>[jobModel.js]")]
  node_user_model[("User records<br/>[userModel.js]")]
end

node_visitor(("Job seeker / poster"))
node_mock_server["Mock JSON server"]

node_visitor -->|"uses"| node_simple_app
node_visitor -->|"uses"| node_full_app
node_simple_app -->|"routes to"| node_simple_home
node_simple_app -.->|"routes via"| node_simple_list
node_simple_app -->|"routes to"| node_simple_detail
node_simple_app -->|"routes to"| node_simple_add
node_simple_app -->|"routes to"| node_simple_edit
node_simple_home -->|"uses"| node_simple_list
node_full_app -->|"renders"| node_full_layout
node_full_app -->|"routes to"| node_full_home
node_full_app -->|"routes to"| node_full_detail
node_full_app -->|"routes to"| node_full_add
node_full_app -->|"routes to"| node_full_edit
node_full_app -->|"routes to"| node_full_auth
node_full_home -->|"uses"| node_full_list
node_full_app -.->|"requests API"| node_api_app
node_simple_app -.->|"uses API"| node_mock_server
node_full_app -.->|"uses API"| node_mock_server
node_api_app -->|"mounts routes"| node_job_routes
node_api_app -->|"mounts routes"| node_user_routes
node_api_app -->|"connects database"| node_db_config
node_job_routes -->|"dispatches to"| node_job_logic
node_job_routes -->|"guards writes"| node_auth_middleware
node_user_routes -->|"dispatches to"| node_user_logic
node_user_routes -->|"guards profile"| node_auth_middleware
node_job_logic -->|"reads and writes"| node_job_model
node_user_logic -->|"reads and writes"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model

click node_simple_app "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/App.jsx"
click node_simple_home "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/HomePage.jsx"
click node_simple_list "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/components/JobListings.jsx"
click node_simple_detail "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/JobPage.jsx"
click node_simple_add "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/AddJobPage.jsx"
click node_simple_edit "https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/EditJobPage.jsx"
click node_full_app "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/App.jsx"
click node_full_layout "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/layouts/MainLayout.jsx"
click node_full_home "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/HomePage.jsx"
click node_full_list "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/components/JobListings.jsx"
click node_full_detail "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/JobPage.jsx"
click node_full_add "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/AddJobPage.jsx"
click node_full_edit "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/EditJobPage.jsx"
click node_full_auth "https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/Login.jsx"
click node_api_app "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/app.js"
click node_job_routes "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/routes/jobRouter.js"
click node_user_routes "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/routes/userRouter.js"
click node_auth_middleware "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/middleware/requireAuth.js"
click node_job_logic "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/controllers/jobControllers.js"
click node_user_logic "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/controllers/userControllers.js"
click node_job_model "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/models/jobModel.js"
click node_user_model "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/models/userModel.js"
click node_db_config "https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/config/db.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_simple_app,node_simple_home,node_simple_list,node_simple_detail,node_simple_add,node_simple_edit toneBlue
class node_full_app,node_full_layout,node_full_home,node_full_list,node_full_detail,node_full_add,node_full_edit,node_full_auth toneAmber
class node_api_app,node_job_routes,node_user_routes,node_auth_middleware,node_db_config,node_mock_server toneMint
class node_job_logic,node_user_logic,node_job_model,node_user_model toneRose
class node_visitor toneIndigo
```

## Components

### Simplified frontend

- [Simplified routes](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/App.jsx): `frontend-simplified/src/App.jsx`
- [Home and listings](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/HomePage.jsx): `frontend-simplified/src/pages/HomePage.jsx`
- [Job list UI](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/components/JobListings.jsx): `frontend-simplified/src/components/JobListings.jsx`
- [Job details](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/JobPage.jsx): `frontend-simplified/src/pages/JobPage.jsx`
- [Create job form](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/AddJobPage.jsx): `frontend-simplified/src/pages/AddJobPage.jsx`
- [Edit job form](https://github.com/simplyolga/group5marathon2/blob/main/frontend-simplified/src/pages/EditJobPage.jsx): `frontend-simplified/src/pages/EditJobPage.jsx`

### Full frontend

- [Routes and job actions](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation layout](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/layouts/MainLayout.jsx): `frontend/src/layouts/MainLayout.jsx`
- [Home and listings](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Job list UI](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/components/JobListings.jsx): `frontend/src/components/JobListings.jsx`
- [Job details](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/JobPage.jsx): `frontend/src/pages/JobPage.jsx`
- [Create job form](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/AddJobPage.jsx): `frontend/src/pages/AddJobPage.jsx`
- [Edit job form](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/EditJobPage.jsx): `frontend/src/pages/EditJobPage.jsx`
- [Sign-in and signup](https://github.com/simplyolga/group5marathon2/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`

### API server

- [Express entry point](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/app.js): `backend/api-server-starter/app.js`
- [Job routes](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/routes/jobRouter.js): `backend/api-server-starter/routes/jobRouter.js`
- [User routes](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/routes/userRouter.js): `backend/api-server-starter/routes/userRouter.js`
- [Token authorization](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/middleware/requireAuth.js): `backend/api-server-starter/middleware/requireAuth.js`
- [Database connection setup](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/config/db.js): `backend/api-server-starter/config/db.js`

### Job and user domain

- [Job operations](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/controllers/jobControllers.js): `backend/api-server-starter/controllers/jobControllers.js`
- [User operations](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/controllers/userControllers.js): `backend/api-server-starter/controllers/userControllers.js`
- [Job records](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/models/jobModel.js): `backend/api-server-starter/models/jobModel.js`
- [User records](https://github.com/simplyolga/group5marathon2/blob/main/backend/api-server-starter/models/userModel.js): `backend/api-server-starter/models/userModel.js`

### Other components

- **Job seeker / poster**
- **Mock JSON server**

## Connections

- Job seeker / poster → Simplified routes: uses
- Job seeker / poster → Routes and job actions: uses
- Simplified routes → Home and listings: routes to (evidence: `frontend-simplified/src/App.jsx`)
- Simplified routes → Job list UI: routes via
- Simplified routes → Job details: routes to (evidence: `frontend-simplified/src/App.jsx`)
- Simplified routes → Create job form: routes to (evidence: `frontend-simplified/src/App.jsx`)
- Simplified routes → Edit job form: routes to (evidence: `frontend-simplified/src/App.jsx`)
- Home and listings → Job list UI: uses (evidence: `frontend-simplified/src/pages/HomePage.jsx`)
- Routes and job actions → Navigation layout: renders (evidence: `frontend/src/App.jsx`)
- Routes and job actions → Home and listings: routes to (evidence: `frontend/src/App.jsx`)
- Routes and job actions → Job details: routes to (evidence: `frontend/src/App.jsx`)
- Routes and job actions → Create job form: routes to (evidence: `frontend/src/App.jsx`)
- Routes and job actions → Edit job form: routes to (evidence: `frontend/src/App.jsx`)
- Routes and job actions → Sign-in and signup: routes to (evidence: `frontend/src/App.jsx`)
- Home and listings → Job list UI: uses (evidence: `frontend/src/pages/HomePage.jsx`)
- Routes and job actions → Express entry point: requests API
- Simplified routes → Mock JSON server: uses API
- Routes and job actions → Mock JSON server: uses API
- Express entry point → Job routes: mounts routes (evidence: `backend/api-server-starter/app.js`)
- Express entry point → User routes: mounts routes (evidence: `backend/api-server-starter/app.js`)
- Express entry point → Database connection setup: connects database (evidence: `backend/api-server-starter/app.js`)
- Job routes → Job operations: dispatches to (evidence: `backend/api-server-starter/routes/jobRouter.js`)
- Job routes → Token authorization: guards writes (evidence: `backend/api-server-starter/routes/jobRouter.js`)
- User routes → User operations: dispatches to (evidence: `backend/api-server-starter/routes/userRouter.js`)
- User routes → Token authorization: guards profile (evidence: `backend/api-server-starter/routes/userRouter.js`)
- Job operations → Job records: reads and writes (evidence: `backend/api-server-starter/controllers/jobControllers.js`)
- User operations → User records: reads and writes (evidence: `backend/api-server-starter/controllers/userControllers.js`)
- Token authorization → User records: loads user (evidence: `backend/api-server-starter/middleware/requireAuth.js`)
