How b30wulffz/job-portal works
Project type and purpose
• This is a full‑stack MERN (MongoDB, Express, React, Node.js) web application called “Job Portal.”
• Purpose: Allow two user roles (applicant and recruiter) to manage job postings and applications via a persistent, JWT‑protected RESTful backend and a React SPA frontend.
File structure
• Top‑level directories:
• backend/ – Node.js + Express server, data models, authentication, file‐upload & download routes
• frontend/ – Create React App, UI components, utility libs, static public assets
• dummyData/ – seed or mock JSON data for local testing (not a runtime dependency)
• backend/ folders:
• db/ – Mongoose schemas (User, Recruiter, Job, Application, Rating)
• lib/ – JWT & Passport configuration, auth key storage
• routes/ – REST endpoints organized by concern (auth, APIs, file upload/download)
• server.js – Express app entrypoint (middleware, route registration, MongoDB connection)
• frontend/ folders:
• public/ – static index.html, manifest, robots.txt
• src/component/ – page components (Login, Signup, Home, Profile, plus recruiter sub‑folder)
• src/lib/ – UI helper components (inputs, popups) and auth/API utilities
• App.js & index.js – bootstraps React SPA and routing
• Key configuration files: package.json (backend & frontend), .gitignore, README.md
Extract architecture insights from the README
• Backend runs on port 4444, frontend on port 3000.
• MongoDB is the primary data store; file uploads (profile pictures, resumes) saved in backend/public subfolders.
• Authentication: persistent sessions (express‑session + connect‑mongo) and JWT for protected REST routes.
Main components and their relationships
a. Frontend (React SPA)
• UI Components → communicate via Axios/Fetch to Backend REST API
• Routes managed by React Router (inside App.js)
b. Backend (Express)
• HTTP middleware: CORS, body‑parser, session management, Passport JWT strategy
• REST API controllers (apiRoutes.js) handle CRUD for jobs, applications, users
• Auth endpoints (authRoutes.js) for signup/login; issue JWT tokens
• Upload/download endpoints (uploadRoutes.js, downloadRoutes.js) using Multer
• Data Access Layer: Mongoose models under backend/db/
• File Storage: local folders under backend/public/profile and backend/public/resume
c. Database (MongoDB)
• Collections: users, recruiters, jobs, applications, ratings
d. External/internal services
• Mail/notification (if any—currently not present)
• Local file system for profile/resume storage
Architectural patterns & design principles
• Layered architecture:
• Presentation (React) → API (Express Routes) → Business Logic (controllers in routes, lib/auth) → Data Access (Mongoose models) → Data Store (MongoDB + file system)
• RESTful design: standard HTTP verbs for CRUD
• JWT + session hybrid: protects API endpoints
• MVC‑like separation: models (db/), controllers (routes/), views (React)
• Single‑page application on the client; stateless interactions via JWT