# kascencio/jobsy-main architecture

> Architecture diagram of the GitHub repository kascencio/jobsy-main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kascencio/jobsy-main
- Repository: https://github.com/kascencio/jobsy-main

## Overview

##### Project type and purpose
- This is a full-stack Next.js application (using the App Router) that implements a multi-role job-posting and recruitment platform.
- The README confirms it’s a Next.js app bootstrapped with create-next-app and intended for browser users, with built-in routing, API endpoints, and Prisma for database access.

##### File structure
- Top-level config files: next.config.mjs, tsconfig.json, tailwind.config.js, .env, Prisma schema and migrations under prisma/.
- src/app: the Next.js App Router directory. It contains both page.tsx files for UI routes and nested src/app/api for serverless API routes.
- src/app/api: subdivided into role-based segments (auth, candidato, reclutador, moderador…), each with route.ts handlers.
- src/components: shared UI components, grouped by role (candidato, reclutador, moderador).
- src/lib: utility modules for Prisma client instantiation and Google OAuth client.
- src/utils and src/types add reusable helpers and TypeScript definitions.

##### README for additional insights
- It highlights Next.js, NextAuth (via [...nextauth]), and automatic font optimization.

##### Detail
- Feature-based API routes (auth, candidato, reclutador, moderador).
- Prisma schema layer and migration directory as part of the DB component.
- Static asset serving (public/) and build/deployment on Vercel.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Frontend Layer
    subgraph "Client (Browser)" 
        direction TB
        FP["Frontend Pages"]:::frontend
        SUC["Shared UI Components"]:::frontend
        CFC["Candidate Feature Components"]:::frontend
        RFC["Recruiter Feature Components"]:::frontend
        MFC["Moderator Feature Components"]:::frontend
    end

    %% Backend Layer
    subgraph "Server (Next.js)" 
        direction TB
        AR["App Router & Layout"]:::backend
        subgraph "API Routes" 
            direction TB
            AUTH["Auth Module"]:::backend
            CAND_API["Candidate API"]:::backend
            RECR_API["Recruiter API"]:::backend
            MOD_API["Moderator API"]:::backend
            SHR_API["Shared Resources API"]:::backend
            UPLOAD["File Upload Service"]:::backend
        end
        UTILS["Utilities"]:::backend
    end

    %% Database Layer
    subgraph "Database Layer" 
        direction TB
        DB["PostgreSQL Database"]:::db
        PRISMA_SCHEMA["Prisma Schema & Migrations"]:::db
    end

    %% External Services
    subgraph "External Services"
        direction TB
        OAUTH["OAuth Provider (Google)"]:::external
        STORAGE["Object Storage Service"]:::external
        VERCEL["Vercel Deployment"]:::external
    end

    %% Connections
    FP -->|"SSR/SSG & Client Fetches"| AR
    SUC --> AR
    CFC --> AR
    RFC --> AR
    MFC --> AR

    AR -->|Routes to| AUTH
    AR -->|Routes to| CAND_API
    AR -->|Routes to| RECR_API
    AR -->|Routes to| MOD_API
    AR -->|Routes to| SHR_API
    AR -->|Routes to| UPLOAD

    subgraph "API Internals"
        AUTH -->|uses| UTILS
        CAND_API -->|uses| UTILS
        RECR_API -->|uses| UTILS
        MOD_API -->|uses| UTILS
        SHR_API -->|uses| UTILS
        UPLOAD -->|uses| UTILS
        UTILS -->|Prisma Client| PRISMA_SCHEMA
        UTILS -->|Google OAuth Client| OAUTH
    end

    PRISMA_SCHEMA -->|SQL Queries| DB
    AUTH -->|OAuth flow| OAUTH
    UPLOAD -->|stores files| STORAGE
    AR -->|deployed on| VERCEL

    %% Click Events - Frontend
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/login/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/registro/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/ofertas/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/ofertas/[id]/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/perfil/page.tsx"
    click FP "https://github.com/kascencio/jobsy-main/blob/IA/src/app/dashboard/**/page.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/Button.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/Header.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/Footer.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/Input.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/ProtectedRoute.tsx"
    click SUC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/Providers.tsx"
    click CFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/candidato/BuscarEmpleo.tsx"
    click CFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/candidato/PerfilForm.tsx"
    click CFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/candidato/PostulacionesList.tsx"
    click RFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/reclutador/CrearEmpleoForm.tsx"
    click RFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/reclutador/EmpleosList.tsx"
    click RFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/reclutador/EmpresaForm.tsx"
    click RFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/reclutador/PostulacionesList.tsx"
    click MFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/moderador/CategoriaForm.tsx"
    click MFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/moderador/CategoriasList.tsx"
    click MFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/moderador/HabilidadForm.tsx"
    click MFC "https://github.com/kascencio/jobsy-main/blob/IA/src/app/components/moderador/HabilidadList.tsx"

    %% Click Events - Backend
    click AUTH "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/auth/[...nextauth]/route.ts"
    click AUTH "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/auth/register/route.ts"
    click CAND_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/candidato/empleos/route.ts"
    click CAND_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/candidato/perfil/route.ts"
    click CAND_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/candidato/postulaciones/route.ts"
    click CAND_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/candidato/postular/route.ts"
    click RECR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/reclutador/empleos/route.ts"
    click RECR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/reclutador/empleos/[empId]/route.ts"
    click RECR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/reclutador/empleos/[empId]/postulaciones/route.ts"
    click RECR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/reclutador/empresa/route.ts"
    click RECR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/reclutador/postulaciones/[posId]/route.ts"
    click MOD_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/moderador/categorias/route.ts"
    click MOD_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/moderador/categorias/[id]/route.ts"
    click MOD_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/moderador/habilidades/route.ts"
    click MOD_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/moderador/habilidades/[id]/route.ts"
    click SHR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/categorias/route.ts"
    click SHR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/habilidades/route.ts"
    click SHR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/cv/[id]/route.ts"
    click SHR_API "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/usuarios/[id]/route.ts"
    click UPLOAD "https://github.com/kascencio/jobsy-main/blob/IA/src/app/api/upload/route.ts"
    click AR "https://github.com/kascencio/jobsy-main/blob/IA/src/app/layout.tsx"
    click AR "https://github.com/kascencio/jobsy-main/blob/IA/src/app/globals.module.css"
    click AR "https://github.com/kascencio/jobsy-main/blob/IA/src/app/page.module.css"
    click UTILS "https://github.com/kascencio/jobsy-main/blob/IA/src/lib/prisma.ts"
    click UTILS "https://github.com/kascencio/jobsy-main/blob/IA/src/app/utils/prisma.ts"
    click UTILS "https://github.com/kascencio/jobsy-main/blob/IA/src/lib/googleClient.ts"
    click PRISMA_SCHEMA "https://github.com/kascencio/jobsy-main/blob/IA/prisma/schema.prisma"
    click PRISMA_SCHEMA "https://github.com/kascencio/jobsy-main/tree/IA/prisma/migrations/**"

    %% Click Events - External & Config
    click STORAGE "https://github.com/kascencio/jobsy-main/tree/IA/public/"
    click STORAGE "https://github.com/kascencio/jobsy-main/tree/IA/public/images/"
    click VERCEL "https://github.com/kascencio/jobsy-main/blob/IA/next.config.mjs"
    click VERCEL "https://github.com/kascencio/jobsy-main/blob/IA/tsconfig.json"
    click VERCEL "https://github.com/kascencio/jobsy-main/blob/IA/tailwind.config.js"
    click VERCEL "https://github.com/kascencio/jobsy-main/blob/IA/.env"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#006064,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#1B5E20,stroke-width:1px
    classDef db fill:#FFF3E0,stroke:#E65100,stroke-width:1px
    classDef external fill:#F3E5F5,stroke:#6A1B9A,stroke-width:1px
```
