How magesh-sam/job-portal works
Project type and purpose
• This is a Single-Page Application (“Job Portal”) written in React + TypeScript.
• It uses a mock backend (json-server) to expose RESTful endpoints over a local JSON file (db.json).
• Key features: user/admin roles, job CRUD, save jobs, theme toggle, profile pages, WYSIWYG editor (TinyMCE).
File structure
• Top level: configuration files (.env, tsconfig, vite.config.ts), package.json, README.
• public/: static assets (index.html, screenshots).
• src/: application code subdivided into:
• pages/ (route-level components)
• components/ (UI components & Shadcn UI wrappers)
• hooks/ (data-fetching & mutation hooks)
• redux/ (Redux Toolkit slices, rootReducer, store)
• lib/ (shared types, utils, mock data)
• main.tsx + App.tsx (entrypoints)
• db.json + json-server script emulate backend API.
Key architectural insights from README
• Frontend communicates with json-server via REST (GET/POST/PUT/DELETE).
• Uses React Router for navigation.
• State is managed in Redux Toolkit (jobsSlice, userSlice).
• React Hook Form + TinyMCE for job-form input.
• Tailwind CSS + Shadcn UI for styling and UI primitives.
A. Client (Browser)
1. Vite Dev Server (or built static bundle) → serves index.html + JS/CSS.
2. React App
• Presentation layer: Pages & reusable Components (JobCard, Navbar, etc.)
• State layer: Redux store (jobsSlice, userSlice)
• Data layer: custom hooks (useGetJobs, useDeleteJobById, etc.)
• Utility layer: lib/utils, lib/types
• External integration: TinyMCE (via its cloud API key)
B. Backend (Mock API)
• json-server process
• Endpoints: /jobs, /users, /candidates, etc.
• Persistence: db.json
Relationships & interactions
• On mount or user action → React Hook (useGetJobs) dispatches Redux async thunk → HTTP GET → json-server → returns JSON → Redux store updates → UI re-renders.
• Form submissions (job create/edit) → Hook → HTTP POST/PUT → json-server → updates db.json → response flows back to client.
• Auth flow: LoginForm sends credentials to /users endpoint → json-server returns user data → stored in userSlice.
• Theme toggle: client-side only via ThemeProvider component (no server involvement).
• TinyMCE: loaded via script from TinyMCE cloud, used inside JobForm.
Architectural patterns & design principles
• Component-based UI (React functional components + Shadcn/UI primitives).
• Layered front-end architecture (Presentation → State → Data → Utilities).
• Redux Toolkit for predictable global state.
• Hooks for encapsulating side-effects (data-fetching).
• RESTful API separation (client ↔ json-server).
• Have you separated the SPA into logical layers?
• Have you labeled all major Redux slices and hooks?
• Are all HTTP endpoints and the db.json store represented?
• Is the TinyMCE integration shown as an external dependency?