How ankitpathak62/job-portal works
Project Type and Purpose
• This is a full-stack MERN (MongoDB, Express, React, Node.js) job portal application.
• Users can register/login, browse and apply for jobs; employers can post and manage jobs via an admin dashboard.
File Structure
A. Backend (Node/Express API)
• index.js: Application entry point, spins up Express server.
• controllers/: Request handlers split by resource (application, company, job, user).
• routes/: Defines REST endpoints and ties them to controllers.
• models/: Mongoose schemas (Application, Company, Job, User).
• middleware/: Authentication (JWT or session) and Multer file-upload middleware.
• utils/: Database connection (db.js), file upload helpers (datauri.js, cloud.js).
• .env, package.json: Configuration and dependencies.
B. Frontend (React + Vite + Redux)
• src/: Main application code.
• components/:
– authentication/: Login/Register UI
– admincomponent/: Employer dashboard pages (post job, view applicants, manage companies)
– components_lite/: Candidate-facing pages (browse jobs, profile, filters, static pages)
– creator/: Possibly a wrapper/dashboard container
– ui/: Reusable design system components (buttons, dialogs, tables, etc.)
• hooks/: Custom data-fetching hooks (useGetAllJobs, useGetCompanyById, etc.)
• redux/: State slices and store configuration
• utils/: Static data or helper functions
• main.jsx, App.jsx: Entry point and root component
• public, index.html, CSS config, Tailwind, eslint, Vite config
README for Additional Insights
• Confirms MERN stack, features: authentication, job listing/search, application process, employer dashboard, responsive design.
Main Components and Their Relationships
A. Client Layer (Browser)
• React SPA served by Vite development server (or built static files served by Nginx/Express in production)
• UI components communicate via HTTP to backend API
• Redux manages client state; hooks abstract data fetching
B. API Layer (Express)
• Exposes REST endpoints (/api/users, /api/jobs, /api/companies, /api/applications)
• Controllers implement business logic, call Mongoose models
• Middleware enforces authentication and handles file uploads
C. Data Layer (MongoDB)
• Stores Users, Jobs, Companies, Applications
D. External Services
• Cloud storage (via cloud.js) for storing resumes/images
E. Dev/Build Tools
• Vite, Tailwind, ESLint on frontend; nodemon and dotenv on backend
Architectural Patterns and Design Principles
• Backend: MVC-style separation (models, controllers, routes)
• Middleware chain for concerns (auth, file handling)
• Frontend: Component-based React architecture with a centralized Redux store
• Clear separation of concerns between presentation, state management, and data-fetching
Detail
• Major sub-folder as its own module (e.g., /admincomponent, /authentication).
• Middleware order: JWT auth → multer → controllers.
• Utils (datauri.js → transforms buffer to data URI for cloud).
• Call out Redux slices and store topology (how authSlice, jobSlice integrate into App).