# ayus-10/project-ib architecture

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

- Interactive diagram: https://gitdiagram.com/ayus-10/project-ib
- Repository: https://github.com/ayus-10/project-ib

## Overview

This is a job-listing and application web app with user accounts, job discovery, favorites, applications, and admin job management. The intended workflow spans browsing jobs, favoriting or applying, and admins creating or managing listings; the sampled code confirms the API-side stages and authentication state flow. The UI-to-API wiring and several page/component implementations were not sampled, so those connections are not asserted. Prisma-backed persistence is shown as a shared store.

Main entry points: [`src/app/api/helpers.ts`](https://github.com/ayus-10/project-ib/blob/main/src/app/api/helpers.ts) (Request helpers), [`src/hooks/useAuthentication.ts`](https://github.com/ayus-10/project-ib/blob/main/src/hooks/useAuthentication.ts) (Authentication hook), [`src/app/api/application/route.ts`](https://github.com/ayus-10/project-ib/blob/main/src/app/api/application/route.ts) (Applications), [`src/app/api/user/route.ts`](https://github.com/ayus-10/project-ib/blob/main/src/app/api/user/route.ts) (User registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_home["Home and discovery<br/>[page.tsx]"]
  node_job_browse["Job browsing<br/>[page.tsx]"]
  node_admin["Admin management<br/>[page.tsx]"]
  node_signin["Sign in<br/>[page.tsx]"]
  node_signup["Sign up<br/>[page.tsx]"]
  node_job_card["Job cards<br/>[JobCard.tsx]"]
  node_job_form["Job form<br/>[JobForm.tsx]"]
  node_user_form["User form<br/>[UserForm.tsx]"]
end

subgraph group_identity["Identity"]
  node_auth_hook["Authentication hook"]
  node_auth_request["Get user request"]
  node_refresh_request["Refresh request<br/>[refreshTokens.ts]"]
  node_user_api["User registration<br/>[route.ts]"]
  node_auth_api["Login and profile<br/>[route.ts]"]
  node_refresh_api["Token refresh<br/>[route.ts]"]
  node_logout_api["Logout<br/>[route.ts]"]
  node_logout_request["Logout request<br/>[logoutUser.ts]"]
end

subgraph group_jobs["Job workflows"]
  node_job_api["Job management<br/>[route.ts]"]
  node_all_jobs["Browse listings<br/>[route.ts]"]
  node_created_jobs["Admin listings<br/>[route.ts]"]
  node_favorites_api["Favorite listings<br/>[route.ts]"]
  node_favorite_jobs["Favorite listing view<br/>[route.ts]"]
  node_application_api["Applications<br/>[route.ts]"]
end

subgraph group_api_support["API support"]
  node_helpers["Request helpers<br/>[helpers.ts]"]
  node_validation["Detail validation"]
  node_responses["HTTP responses<br/>[httpResponses.ts]"]
  node_redux_auth["Auth state"]
end

node_visitor(("Visitor"))
node_database[("Application database")]

node_visitor -->|"visits"| node_home
node_visitor -->|"browses"| node_job_browse
node_visitor -->|"signs in"| node_signin
node_visitor -->|"registers"| node_signup
node_visitor -->|"manages listings"| node_admin
node_auth_hook -->|"requests profile"| node_auth_request
node_auth_hook -->|"refreshes after failure"| node_refresh_request
node_auth_hook -->|"updates state"| node_redux_auth
node_user_api -->|"creates user"| node_database
node_auth_api -->|"reads user"| node_database
node_job_api -->|"reads and writes jobs"| node_database
node_all_jobs -->|"reads jobs and favorites"| node_database
node_created_jobs -->|"reads jobs"| node_database
node_favorites_api -->|"writes favorites"| node_database
node_favorite_jobs -->|"reads jobs"| node_database
node_application_api -->|"reads and writes applications"| node_database
node_job_api -->|"uses request helpers"| node_helpers
node_all_jobs -->|"reads page parameter"| node_helpers
node_created_jobs -->|"reads user identity"| node_helpers
node_favorites_api -->|"reads request identity"| node_helpers
node_favorite_jobs -->|"reads request parameters"| node_helpers
node_application_api -->|"reads request identity"| node_helpers
node_auth_api -->|"gets token secrets"| node_helpers
node_user_api -->|"gets token secrets"| node_helpers
node_refresh_api -->|"gets token secrets"| node_helpers
node_application_api -->|"validates application"| node_validation

click node_home "https://github.com/ayus-10/project-ib/blob/main/src/app/page.tsx"
click node_job_browse "https://github.com/ayus-10/project-ib/blob/main/src/app/job/page.tsx"
click node_admin "https://github.com/ayus-10/project-ib/blob/main/src/app/admin/manage/page.tsx"
click node_signin "https://github.com/ayus-10/project-ib/blob/main/src/app/signin/page.tsx"
click node_signup "https://github.com/ayus-10/project-ib/blob/main/src/app/signup/page.tsx"
click node_job_card "https://github.com/ayus-10/project-ib/blob/main/src/components/JobCard.tsx"
click node_job_form "https://github.com/ayus-10/project-ib/blob/main/src/components/JobForm.tsx"
click node_user_form "https://github.com/ayus-10/project-ib/blob/main/src/components/UserForm.tsx"
click node_auth_hook "https://github.com/ayus-10/project-ib/blob/main/src/hooks/useAuthentication.ts"
click node_auth_request "https://github.com/ayus-10/project-ib/blob/main/src/requests/getAuthenticatedUser.ts"
click node_refresh_request "https://github.com/ayus-10/project-ib/blob/main/src/requests/refreshTokens.ts"
click node_user_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/user/route.ts"
click node_auth_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/route.ts"
click node_refresh_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/refresh/route.ts"
click node_logout_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/logout/route.ts"
click node_logout_request "https://github.com/ayus-10/project-ib/blob/main/src/requests/logoutUser.ts"
click node_job_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/route.ts"
click node_all_jobs "https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/all/route.ts"
click node_created_jobs "https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/created/route.ts"
click node_favorites_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/favorite/route.ts"
click node_favorite_jobs "https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/favorites/route.ts"
click node_application_api "https://github.com/ayus-10/project-ib/blob/main/src/app/api/application/route.ts"
click node_helpers "https://github.com/ayus-10/project-ib/blob/main/src/app/api/helpers.ts"
click node_validation "https://github.com/ayus-10/project-ib/blob/main/src/utils/detailsValidation.ts"
click node_responses "https://github.com/ayus-10/project-ib/blob/main/src/utils/httpResponses.ts"
click node_redux_auth "https://github.com/ayus-10/project-ib/blob/main/src/redux/slices/authenticatedUserSlice.ts"

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_home,node_job_browse,node_admin,node_signin,node_signup,node_job_card,node_job_form,node_user_form toneBlue
class node_auth_hook,node_auth_request,node_refresh_request,node_user_api,node_auth_api,node_refresh_api,node_logout_api,node_logout_request,node_database toneAmber
class node_job_api,node_all_jobs,node_created_jobs,node_favorites_api,node_favorite_jobs,node_application_api toneMint
class node_helpers,node_validation,node_responses,node_redux_auth toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Home and discovery](https://github.com/ayus-10/project-ib/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Job browsing](https://github.com/ayus-10/project-ib/blob/main/src/app/job/page.tsx): `src/app/job/page.tsx`
- [Admin management](https://github.com/ayus-10/project-ib/blob/main/src/app/admin/manage/page.tsx): `src/app/admin/manage/page.tsx`
- [Sign in](https://github.com/ayus-10/project-ib/blob/main/src/app/signin/page.tsx): `src/app/signin/page.tsx`
- [Sign up](https://github.com/ayus-10/project-ib/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Job cards](https://github.com/ayus-10/project-ib/blob/main/src/components/JobCard.tsx): `src/components/JobCard.tsx`
- [Job form](https://github.com/ayus-10/project-ib/blob/main/src/components/JobForm.tsx): `src/components/JobForm.tsx`
- [User form](https://github.com/ayus-10/project-ib/blob/main/src/components/UserForm.tsx): `src/components/UserForm.tsx`

### Identity

- [Authentication hook](https://github.com/ayus-10/project-ib/blob/main/src/hooks/useAuthentication.ts): `src/hooks/useAuthentication.ts`
- [Get user request](https://github.com/ayus-10/project-ib/blob/main/src/requests/getAuthenticatedUser.ts): `src/requests/getAuthenticatedUser.ts`
- [Refresh request](https://github.com/ayus-10/project-ib/blob/main/src/requests/refreshTokens.ts): `src/requests/refreshTokens.ts`
- [User registration](https://github.com/ayus-10/project-ib/blob/main/src/app/api/user/route.ts): `src/app/api/user/route.ts`
- [Login and profile](https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/route.ts): `src/app/api/auth/route.ts`
- [Token refresh](https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/refresh/route.ts): `src/app/api/auth/refresh/route.ts`
- [Logout](https://github.com/ayus-10/project-ib/blob/main/src/app/api/auth/logout/route.ts): `src/app/api/auth/logout/route.ts`
- [Logout request](https://github.com/ayus-10/project-ib/blob/main/src/requests/logoutUser.ts): `src/requests/logoutUser.ts`

### Job workflows

- [Job management](https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/route.ts): `src/app/api/job/route.ts`
- [Browse listings](https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/all/route.ts): `src/app/api/job/all/route.ts`
- [Admin listings](https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/created/route.ts): `src/app/api/job/created/route.ts`
- [Favorite listings](https://github.com/ayus-10/project-ib/blob/main/src/app/api/favorite/route.ts): `src/app/api/favorite/route.ts`
- [Favorite listing view](https://github.com/ayus-10/project-ib/blob/main/src/app/api/job/favorites/route.ts): `src/app/api/job/favorites/route.ts`
- [Applications](https://github.com/ayus-10/project-ib/blob/main/src/app/api/application/route.ts): `src/app/api/application/route.ts`

### API support

- [Request helpers](https://github.com/ayus-10/project-ib/blob/main/src/app/api/helpers.ts): `src/app/api/helpers.ts`
- [Detail validation](https://github.com/ayus-10/project-ib/blob/main/src/utils/detailsValidation.ts): `src/utils/detailsValidation.ts`
- [HTTP responses](https://github.com/ayus-10/project-ib/blob/main/src/utils/httpResponses.ts): `src/utils/httpResponses.ts`
- [Auth state](https://github.com/ayus-10/project-ib/blob/main/src/redux/slices/authenticatedUserSlice.ts): `src/redux/slices/authenticatedUserSlice.ts`

### Other components

- **Visitor**
- **Application database**

## Connections

- Visitor → Home and discovery: visits
- Visitor → Job browsing: browses
- Visitor → Sign in: signs in
- Visitor → Sign up: registers
- Visitor → Admin management: manages listings
- Authentication hook → Get user request: requests profile
- Authentication hook → Refresh request: refreshes after failure
- Authentication hook → Auth state: updates state
- User registration → Application database: creates user
- Login and profile → Application database: reads user
- Job management → Application database: reads and writes jobs
- Browse listings → Application database: reads jobs and favorites
- Admin listings → Application database: reads jobs
- Favorite listings → Application database: writes favorites
- Favorite listing view → Application database: reads jobs
- Applications → Application database: reads and writes applications
- Job management → Request helpers: uses request helpers
- Browse listings → Request helpers: reads page parameter
- Admin listings → Request helpers: reads user identity
- Favorite listings → Request helpers: reads request identity
- Favorite listing view → Request helpers: reads request parameters
- Applications → Request helpers: reads request identity
- Login and profile → Request helpers: gets token secrets
- User registration → Request helpers: gets token secrets
- Token refresh → Request helpers: gets token secrets
- Applications → Detail validation: validates application
