# omercikan/nexthire-job-platform architecture

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

- Interactive diagram: https://gitdiagram.com/omercikan/nexthire-job-platform
- Repository: https://github.com/omercikan/nexthire-job-platform

## Overview

##### Project type and purpose
- NextHire is a full-stack job-platform built with Next.js (App Router), React, TypeScript, Tailwind/SCSS, Firebase (Auth + Firestore), and Redux Toolkit.
- The user flows include: public landing page, candidate/employer signup & login, newsletter subscription, and (under development) job listings with search & filters.

##### File structure
- app/ → Next.js “App Router” pages and layouts:
- (auth)/… → signup/login/password-reset routes
- api/firebase/… → serverless API routes (candidate/employer login/signup, reset-password, subscribe, fetchBlogs, favorites, employers by slug)
- is-ilanlari → job listings page
- layout.tsx, globals.css → top-level layout & global styles
- components/ → reusable UI components (layout/Header, layout/Footer, pages/home, pages/jobPostings, ui primitives)
- lib/ → client- and server-side utilities:
- lib/firebase.ts + api routes → Firebase SDK config
- lib/redux/ → Redux Toolkit store, feature slices, RTK Query services
- misc helpers: fetchData, deleteCookie, formatText, setUserDatabase, etc.
- context/ → React Context for authentication state
- public/ → static assets (images, JSON data for cities/districts)
- scss/ → custom styling modules
- configuration files: next.config.ts, netlify.toml, ESLint, Turbopack, sitemap

##### README for architecture notes
- Tech stack confirms:
- Next.js App Router
- Serverless API routes calling Firebase
- React Firebase Hooks + custom Firestore logic
- Redux Toolkit + RTK Query for global state & data fetching
- Formik & Yup for form validation
- Recent changes highlight organized Redux folder, RTK Query integration, Framer Motion, and new job-listing features.

##### Detail
- CS S/SCSS styling layer as a note (global styles, modules).
- Do not omit the context layer for client-side auth state.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    ClientBrowser["Client Browser"]:::frontend

    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        PublicLandingPage["Public Landing Page"]:::frontend
        JobListingsPage["Job Listings Page"]:::frontend
        CandidateLoginPage["Candidate Login Page"]:::frontend
        CandidateSignupPage["Candidate Signup Page"]:::frontend
        EmployerLoginPage["Employer Login Page"]:::frontend
        EmployerSignupPage["Employer Signup Page"]:::frontend
        ResetPasswordPage["Reset Password Page"]:::frontend
        AuthLayout["Auth Layout"]:::frontend
        AuthComponents["Auth Components"]:::frontend
        YupSchemas["Form Schemas (Yup)"]:::frontend
        AuthContext["React Auth Context"]:::frontend
        ReduxStore["Redux Store"]:::frontend
        RTKQueryServices["RTK Query Services"]:::frontend
        Styling["Global Styles & SCSS Modules"]:::frontend
        UIlibs["UI Libraries (Tailwind/SCSS/MUI/Framer)"]:::frontend
    end

    %% Backend Layer
    subgraph "Next.js Backend Layer (Serverless API)"
        direction TB
        FirebaseConfig["Firebase Config Utility"]:::backend
        CandidateLoginAPI["Candidate Login API"]:::backend
        CandidateSignupAPI["Candidate Signup API"]:::backend
        EmployerLoginAPI["Employer Login API"]:::backend
        EmployerSignupAPI["Employer Signup API"]:::backend
        ResetPasswordAPI["Reset Password API"]:::backend
        SubscribeAPI["Newsletter Subscribe API"]:::backend
        FetchBlogsAPI["Fetch Blogs API"]:::backend
        FavoritesAPI["Favorites API"]:::backend
        EmployersBySlugAPI["Employers by Slug API"]:::backend
    end

    %% External Services
    subgraph "External Services"
        direction TB
        FirebaseAuth["Firebase Authentication"]:::external
        FirestoreDB["Firestore Database"]:::external
        GoogleOAuth["Google OAuth"]:::external
    end

    %% Connections
    ClientBrowser --> PublicLandingPage
    ClientBrowser --> JobListingsPage
    ClientBrowser --> CandidateLoginPage
    ClientBrowser --> CandidateSignupPage
    ClientBrowser --> EmployerLoginPage
    ClientBrowser --> EmployerSignupPage
    ClientBrowser --> ResetPasswordPage

    PublicLandingPage --> AuthContext
    JobListingsPage --> AuthContext
    CandidateLoginPage --> AuthContext
    CandidateSignupPage --> AuthContext
    EmployerLoginPage --> AuthContext
    EmployerSignupPage --> AuthContext
    ResetPasswordPage --> AuthContext

    PublicLandingPage --> ReduxStore
    JobListingsPage --> ReduxStore

    ReduxStore --> RTKQueryServices

    CandidateLoginPage -->|uses Formik/Yup| YupSchemas
    CandidateSignupPage -->|uses Formik/Yup| YupSchemas
    EmployerLoginPage -->|uses Formik/Yup| YupSchemas
    EmployerSignupPage -->|uses Formik/Yup| YupSchemas
    ResetPasswordPage -->|uses Formik/Yup| YupSchemas

    PublicLandingPage --> UIlibs
    JobListingsPage --> UIlibs
    AuthComponents --> UIlibs

    %% API Calls
    CandidateLoginPage -->|POST /api/firebase/candidate-login| CandidateLoginAPI
    CandidateSignupPage -->|POST /api/firebase/candidate-signup| CandidateSignupAPI
    EmployerLoginPage -->|POST /api/firebase/employer-login| EmployerLoginAPI
    EmployerSignupPage -->|POST /api/firebase/employer-signup| EmployerSignupAPI
    ResetPasswordPage -->|POST /api/firebase/reset-password| ResetPasswordAPI
    PublicLandingPage -->|POST /api/firebase/subscribe| SubscribeAPI
    PublicLandingPage -->|GET /api/firebase/fetchBlogs| FetchBlogsAPI
    ReduxStore -->|mutations| FavoritesAPI
    ReduxStore -->|queries| EmployersBySlugAPI

    %% Backend to Firebase
    FirebaseConfig --> FirebaseAuth
    FirebaseConfig --> FirestoreDB
    CandidateLoginAPI --> FirebaseConfig
    CandidateSignupAPI --> FirebaseConfig
    EmployerLoginAPI --> FirebaseConfig
    EmployerSignupAPI --> FirebaseConfig
    ResetPasswordAPI --> FirebaseConfig
    SubscribeAPI --> FirebaseConfig
    FetchBlogsAPI --> FirebaseConfig
    FavoritesAPI --> FirebaseConfig
    EmployersBySlugAPI --> FirebaseConfig

    %% Direct client SDK usage
    AuthContext -->|uses React Firebase Hooks| FirebaseAuth

    %% Click Events
    click PublicLandingPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/page.tsx"
    click JobListingsPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/is-ilanlari/page.tsx"
    click CandidateLoginPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/aday-giris/page.tsx"
    click CandidateSignupPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/aday-uye-ol/page.tsx"
    click EmployerLoginPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/isveren-giris/page.tsx"
    click EmployerSignupPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/isveren-kayit/page.tsx"
    click ResetPasswordPage "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/sifre-sifirla/page.tsx"
    click AuthLayout "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/layout.tsx"
    click AuthComponents "https://github.com/omercikan/nexthire-job-platform/tree/dev/app/(auth)/components"
    click YupSchemas "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/schema/SignupSchema.ts"
    click YupSchemas "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/schema/LoginSchema.ts"
    click YupSchemas "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/(auth)/schema/ResetPasswordSchema.ts"
    click FirebaseConfig "https://github.com/omercikan/nexthire-job-platform/blob/dev/lib/firebase.ts"
    click CandidateLoginAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/candidate-login/route.ts"
    click CandidateSignupAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/candidate-signup/route.ts"
    click EmployerLoginAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/employer-login/route.ts"
    click EmployerSignupAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/employer-signup/route.ts"
    click ResetPasswordAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/reset-password/route.ts"
    click SubscribeAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/subscribe/route.ts"
    click FetchBlogsAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/fetchBlogs/route.ts"
    click FavoritesAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/favorites/route.ts"
    click EmployersBySlugAPI "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/api/firebase/employers/[slug]/route.ts"
    click ReduxStore "https://github.com/omercikan/nexthire-job-platform/blob/dev/lib/redux/store.ts"
    click RTKQueryServices "https://github.com/omercikan/nexthire-job-platform/tree/dev/lib/redux/services"
    click AuthContext "https://github.com/omercikan/nexthire-job-platform/blob/dev/context/authContext.tsx"
    click Styling "https://github.com/omercikan/nexthire-job-platform/blob/dev/app/globals.css"
    click Styling "https://github.com/omercikan/nexthire-job-platform/tree/dev/scss"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/blob/dev/components/layout/Header.tsx"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/blob/dev/components/layout/Footer/FooterCopyright.tsx"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/tree/dev/components/pages/home"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/tree/dev/components/pages/jobPostings"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/blob/dev/lib/formatText.ts"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/blob/dev/lib/logout.ts"
    click UIlibs "https://github.com/omercikan/nexthire-job-platform/blob/dev/lib/deleteCookie.ts"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#00796B,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#388E3C,stroke-width:1px
    classDef external fill:#FFF3E0,stroke:#F57C00,stroke-width:1px
```
