# josedelacruz81/ofiempleo architecture

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

- Interactive diagram: https://gitdiagram.com/josedelacruz81/ofiempleo
- Repository: https://github.com/josedelacruz81/ofiempleo

## Overview

Ofiempleo is a Spanish-language jobs and services marketplace built on a Next.js app, despite the README describing a generic template. Its main user flow is browsing accepted posts and jobs, viewing a worker profile, and sending or managing service requests; account registration and role-based employee/employer areas support that flow. Admin pages provide moderation and reporting capabilities. The source excerpts show selected routes and storage calls; several feature branches are represented from the file tree and are not fully verified, so uncertain links are omitted.

Main entry points: [`lib/supabase.ts`](https://github.com/josedelacruz81/ofiempleo/blob/main/lib/supabase.ts) (Supabase data), [`app/employee/page.tsx`](https://github.com/josedelacruz81/ofiempleo/blob/main/app/employee/page.tsx) (Employee workspace), [`app/page.tsx`](https://github.com/josedelacruz81/ofiempleo/blob/main/app/page.tsx) (Home feed), [`auth.ts`](https://github.com/josedelacruz81/ofiempleo/blob/main/auth.ts) (Credentials and session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Marketplace discovery"]
  node_home["Home feed<br/>[page.tsx]"]
  node_posts_list["Post list<br/>[PostsList.tsx]"]
  node_post_routes["Post APIs<br/>[route.ts]"]
  node_post_detail["Post detail<br/>[page.tsx]"]
  node_job_search["Job search<br/>[page.tsx]"]
  node_search["Search UI<br/>[index.tsx]"]
  node_search_action["Search action<br/>[searchAction.tsx]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_auth_flow["Sign-in and signup<br/>[page.tsx]"]
  node_signup_api["Registration API<br/>[route.ts]"]
  node_auth_core["Credentials and session<br/>[auth.ts]"]
  node_verification["Account verification<br/>[page.tsx]"]
  node_profile["User profile<br/>[index.tsx]"]
  node_profile_edit["Profile editing<br/>[page.tsx]"]
end

subgraph group_requests["Service requests"]
  node_employee_area["Employee workspace<br/>[page.tsx]"]
  node_post_form["Worker post form<br/>[cvForm.tsx]"]
  node_employee_requests["Incoming requests<br/>[RequestsList.tsx]"]
  node_employer_requests["Employer requests<br/>[page.tsx]"]
  node_contact["Contact action<br/>[ContactButton.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_portal["Admin portal<br/>[layout.tsx]"]
  node_admin_posts["Post moderation<br/>[page.tsx]"]
  node_admin_reports["Report review<br/>[page.tsx]"]
  node_admin_users["User management<br/>[page.tsx]"]
  node_admin_stats["Admin statistics<br/>[page.tsx]"]
  node_admin_api["Admin APIs<br/>[route.ts]"]
end

subgraph group_infrastructure["Data and shared UI"]
  node_supabase[("Supabase data<br/>[supabase.ts]")]
  node_firebase["Firebase image storage<br/>[firebase.ts]"]
  node_ratings["Ratings and comments<br/>[Rating.tsx]"]
  node_icons["Shared icons<br/>[icons.tsx]"]
  node_toast["Toast state<br/>[useToast.tsx]"]
  node_services["Admin service fetches<br/>[services.ts]"]
end

node_visitor(("Marketplace visitor"))
node_email_provider["Resend email"]

node_visitor -->|"browses"| node_home
node_home -->|"loads session"| node_auth_core
node_home -->|"fetches posts"| node_post_routes
node_home -->|"loads jobs"| node_supabase
node_home -->|"renders"| node_posts_list
node_posts_list -.->|"links posts"| node_post_detail
node_post_routes -->|"reads and writes"| node_supabase
node_post_routes -->|"uploads images"| node_firebase
node_post_detail -->|"loads post data"| node_supabase
node_job_search -->|"queries jobs"| node_supabase
node_visitor -.->|"searches"| node_search
node_search -.->|"uses search"| node_search_action
node_visitor -.->|"registers or signs in"| node_auth_flow
node_signup_api -->|"creates user"| node_supabase
node_signup_api -->|"sends verification"| node_email_provider
node_auth_core -->|"checks credentials"| node_supabase
node_auth_flow -.->|"submits signup"| node_signup_api
node_verification -.->|"uses sign-in"| node_auth_core
node_profile_edit -->|"loads profile"| node_supabase
node_profile_edit -.->|"renders editor"| node_profile
node_profile -->|"renders ratings"| node_ratings
node_employee_area -->|"checks session"| node_auth_core
node_employee_area -->|"checks job requests"| node_supabase
node_employee_area -->|"renders form"| node_post_form
node_employee_area -->|"renders requests"| node_employee_requests
node_employee_area -->|"fetches user and requests"| node_supabase
node_contact -.->|"creates request"| node_supabase
node_employer_requests -->|"checks session"| node_auth_core
node_employer_requests -.->|"loads requests"| node_supabase
node_admin_portal -.->|"hosts moderation"| node_admin_posts
node_admin_portal -.->|"hosts reports"| node_admin_reports
node_admin_portal -.->|"hosts users"| node_admin_users
node_admin_portal -.->|"hosts statistics"| node_admin_stats
node_admin_posts -.->|"uses post API"| node_admin_api
node_admin_api -->|"reads and writes"| node_supabase
node_admin_stats -->|"queries statistics"| node_supabase
node_admin_stats -->|"loads admin data"| node_services
node_services -.->|"fetches admin endpoints"| node_admin_api
node_signup_api -->|"uses email template"| node_icons
node_admin_posts -->|"shows feedback"| node_toast

click node_home "https://github.com/josedelacruz81/ofiempleo/blob/main/app/page.tsx"
click node_posts_list "https://github.com/josedelacruz81/ofiempleo/blob/main/components/PostsList.tsx"
click node_post_routes "https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/posts/route.ts"
click node_post_detail "https://github.com/josedelacruz81/ofiempleo/blob/main/app/post/%5Bid%5D/page.tsx"
click node_job_search "https://github.com/josedelacruz81/ofiempleo/blob/main/app/jobs/%5Boficio%5D/page.tsx"
click node_search "https://github.com/josedelacruz81/ofiempleo/blob/main/components/SearchBar/index.tsx"
click node_auth_flow "https://github.com/josedelacruz81/ofiempleo/blob/main/app/auth/page.tsx"
click node_signup_api "https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/auth/signUp/route.ts"
click node_auth_core "https://github.com/josedelacruz81/ofiempleo/blob/main/auth.ts"
click node_verification "https://github.com/josedelacruz81/ofiempleo/blob/main/app/verification/page.tsx"
click node_profile "https://github.com/josedelacruz81/ofiempleo/blob/main/components/profile/index.tsx"
click node_profile_edit "https://github.com/josedelacruz81/ofiempleo/blob/main/app/user/editProfile/page.tsx"
click node_employee_area "https://github.com/josedelacruz81/ofiempleo/blob/main/app/employee/page.tsx"
click node_post_form "https://github.com/josedelacruz81/ofiempleo/blob/main/components/modals/PostModal/cvForm.tsx"
click node_employee_requests "https://github.com/josedelacruz81/ofiempleo/blob/main/app/employee/components/RequestsList.tsx"
click node_employer_requests "https://github.com/josedelacruz81/ofiempleo/blob/main/app/employer/requests/page.tsx"
click node_contact "https://github.com/josedelacruz81/ofiempleo/blob/main/components/buttons/ContactButton.tsx"
click node_admin_portal "https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/layout.tsx"
click node_admin_posts "https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/posts/%5Bstatus%5D/page.tsx"
click node_admin_reports "https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/reports/page.tsx"
click node_admin_users "https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/users/page.tsx"
click node_admin_stats "https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/stats/page.tsx"
click node_admin_api "https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/admin/posts/route.ts"
click node_supabase "https://github.com/josedelacruz81/ofiempleo/blob/main/lib/supabase.ts"
click node_firebase "https://github.com/josedelacruz81/ofiempleo/blob/main/lib/firebase.ts"
click node_ratings "https://github.com/josedelacruz81/ofiempleo/blob/main/components/littleComponents/Rating.tsx"
click node_icons "https://github.com/josedelacruz81/ofiempleo/blob/main/components/icons.tsx"
click node_toast "https://github.com/josedelacruz81/ofiempleo/blob/main/components/shadCn/useToast.tsx"
click node_search_action "https://github.com/josedelacruz81/ofiempleo/blob/main/components/actions/searchAction.tsx"
click node_services "https://github.com/josedelacruz81/ofiempleo/blob/main/lib/services.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_posts_list,node_post_routes,node_post_detail,node_job_search,node_search,node_search_action toneBlue
class node_auth_flow,node_signup_api,node_auth_core,node_verification,node_profile,node_profile_edit toneAmber
class node_employee_area,node_post_form,node_employee_requests,node_employer_requests,node_contact toneMint
class node_admin_portal,node_admin_posts,node_admin_reports,node_admin_users,node_admin_stats,node_admin_api toneRose
class node_supabase,node_firebase,node_ratings,node_icons,node_toast,node_services,node_visitor,node_email_provider toneIndigo
```

## Components

### Marketplace discovery

- [Home feed](https://github.com/josedelacruz81/ofiempleo/blob/main/app/page.tsx): `app/page.tsx`
- [Post list](https://github.com/josedelacruz81/ofiempleo/blob/main/components/PostsList.tsx): `components/PostsList.tsx`
- [Post APIs](https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/posts/route.ts): `app/api/posts/route.ts`
- [Post detail](https://github.com/josedelacruz81/ofiempleo/blob/main/app/post/%5Bid%5D/page.tsx): `app/post/[id]/page.tsx`
- [Job search](https://github.com/josedelacruz81/ofiempleo/blob/main/app/jobs/%5Boficio%5D/page.tsx): `app/jobs/[oficio]/page.tsx`
- [Search UI](https://github.com/josedelacruz81/ofiempleo/blob/main/components/SearchBar/index.tsx): `components/SearchBar/index.tsx`
- [Search action](https://github.com/josedelacruz81/ofiempleo/blob/main/components/actions/searchAction.tsx): `components/actions/searchAction.tsx`

### Accounts and profiles

- [Sign-in and signup](https://github.com/josedelacruz81/ofiempleo/blob/main/app/auth/page.tsx): `app/auth/page.tsx`
- [Registration API](https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/auth/signUp/route.ts): `app/api/auth/signUp/route.ts`
- [Credentials and session](https://github.com/josedelacruz81/ofiempleo/blob/main/auth.ts): `auth.ts`
- [Account verification](https://github.com/josedelacruz81/ofiempleo/blob/main/app/verification/page.tsx): `app/verification/page.tsx`
- [User profile](https://github.com/josedelacruz81/ofiempleo/blob/main/components/profile/index.tsx): `components/profile/index.tsx`
- [Profile editing](https://github.com/josedelacruz81/ofiempleo/blob/main/app/user/editProfile/page.tsx): `app/user/editProfile/page.tsx`

### Service requests

- [Employee workspace](https://github.com/josedelacruz81/ofiempleo/blob/main/app/employee/page.tsx): `app/employee/page.tsx`
- [Worker post form](https://github.com/josedelacruz81/ofiempleo/blob/main/components/modals/PostModal/cvForm.tsx): `components/modals/PostModal/cvForm.tsx`
- [Incoming requests](https://github.com/josedelacruz81/ofiempleo/blob/main/app/employee/components/RequestsList.tsx): `app/employee/components/RequestsList.tsx`
- [Employer requests](https://github.com/josedelacruz81/ofiempleo/blob/main/app/employer/requests/page.tsx): `app/employer/requests/page.tsx`
- [Contact action](https://github.com/josedelacruz81/ofiempleo/blob/main/components/buttons/ContactButton.tsx): `components/buttons/ContactButton.tsx`

### Administration

- [Admin portal](https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/layout.tsx): `app/admin/layout.tsx`
- [Post moderation](https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/posts/%5Bstatus%5D/page.tsx): `app/admin/posts/[status]/page.tsx`
- [Report review](https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/reports/page.tsx): `app/admin/reports/page.tsx`
- [User management](https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/users/page.tsx): `app/admin/users/page.tsx`
- [Admin statistics](https://github.com/josedelacruz81/ofiempleo/blob/main/app/admin/stats/page.tsx): `app/admin/stats/page.tsx`
- [Admin APIs](https://github.com/josedelacruz81/ofiempleo/blob/main/app/api/admin/posts/route.ts): `app/api/admin/posts/route.ts`

### Data and shared UI

- [Supabase data](https://github.com/josedelacruz81/ofiempleo/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [Firebase image storage](https://github.com/josedelacruz81/ofiempleo/blob/main/lib/firebase.ts): `lib/firebase.ts`
- [Ratings and comments](https://github.com/josedelacruz81/ofiempleo/blob/main/components/littleComponents/Rating.tsx): `components/littleComponents/Rating.tsx`
- [Shared icons](https://github.com/josedelacruz81/ofiempleo/blob/main/components/icons.tsx): `components/icons.tsx`
- [Toast state](https://github.com/josedelacruz81/ofiempleo/blob/main/components/shadCn/useToast.tsx): `components/shadCn/useToast.tsx`
- [Admin service fetches](https://github.com/josedelacruz81/ofiempleo/blob/main/lib/services.ts): `lib/services.ts`

### Other components

- **Marketplace visitor**
- **Resend email**

## Connections

- Marketplace visitor → Home feed: browses
- Home feed → Credentials and session: loads session (evidence: `app/page.tsx`)
- Home feed → Post APIs: fetches posts (evidence: `app/page.tsx`)
- Home feed → Supabase data: loads jobs (evidence: `app/page.tsx`)
- Home feed → Post list: renders (evidence: `app/page.tsx`)
- Post list → Post detail: links posts
- Post APIs → Supabase data: reads and writes (evidence: `app/api/posts/route.ts`)
- Post APIs → Firebase image storage: uploads images (evidence: `app/api/posts/route.ts`)
- Post detail → Supabase data: loads post data (evidence: `app/post/[id]/page.tsx`)
- Job search → Supabase data: queries jobs (evidence: `app/jobs/[oficio]/page.tsx`)
- Marketplace visitor → Search UI: searches
- Search UI → Search action: uses search
- Marketplace visitor → Sign-in and signup: registers or signs in
- Registration API → Supabase data: creates user (evidence: `app/api/auth/signUp/route.ts`)
- Registration API → Resend email: sends verification (evidence: `app/api/auth/signUp/route.ts`)
- Credentials and session → Supabase data: checks credentials (evidence: `auth.ts`)
- Sign-in and signup → Registration API: submits signup
- Account verification → Credentials and session: uses sign-in
- Profile editing → Supabase data: loads profile (evidence: `app/user/editProfile/page.tsx`)
- Profile editing → User profile: renders editor
- User profile → Ratings and comments: renders ratings (evidence: `components/profile/index.tsx`)
- Employee workspace → Credentials and session: checks session (evidence: `app/employee/page.tsx`)
- Employee workspace → Supabase data: checks job requests (evidence: `app/employee/page.tsx`)
- Employee workspace → Worker post form: renders form (evidence: `app/employee/page.tsx`)
- Employee workspace → Incoming requests: renders requests (evidence: `app/employee/page.tsx`)
- Employee workspace → Supabase data: fetches user and requests (evidence: `app/employee/page.tsx`)
- Contact action → Supabase data: creates request (evidence: `components/buttons/ContactButton.tsx`)
- Employer requests → Credentials and session: checks session (evidence: `app/employer/requests/page.tsx`)
- Employer requests → Supabase data: loads requests (evidence: `app/employer/requests/page.tsx`)
- Admin portal → Post moderation: hosts moderation
- Admin portal → Report review: hosts reports
- Admin portal → User management: hosts users
- Admin portal → Admin statistics: hosts statistics
- Post moderation → Admin APIs: uses post API
- Admin APIs → Supabase data: reads and writes (evidence: `app/api/admin/posts/route.ts`)
- Admin statistics → Supabase data: queries statistics (evidence: `app/admin/stats/page.tsx`)
- Admin statistics → Admin service fetches: loads admin data (evidence: `app/admin/stats/page.tsx`)
- Admin service fetches → Admin APIs: fetches admin endpoints
- Registration API → Shared icons: uses email template (evidence: `app/api/auth/signUp/route.ts`)
- Post moderation → Toast state: shows feedback
