How mohamed-samehh/bue-spec-path works
Project Type & Purpose
• Full-stack web application for personalized career specialization recommendations, course exploration (via external API), and user reviews.
• Frontend: React + Vite; Backend: Node.js + Express; Database: MongoDB Atlas; External Service: Coursera API; Auth: JWT.
File Structure & Architectural Patterns
• Monorepo with two top-level folders:
• frontend/ (React components, CSS, router, entry point)
• backend/ (Express server, config, controllers, services, models, routes)
• MVC-style separation in backend:
• Models → define MongoDB schemas
• Controllers → handle HTTP requests, orchestrate services
• Services → business logic (auth, recommendation, career, knowledge hub, reviews)
• Configuration & environment:
• config/.env, db.js for Mongo connection
• dotenv, cors, body-parser, bcrypt, JWT
• Build & run scripts: Vite (frontend), nodemon (backend).
Main Components
A. Users & Client (Browser)
B. Frontend Application (React + Vite)
• AppRouter, individual page components (Auth, CareerPlanning, KnowledgeHub, Reviews, Profile)
• Static assets (images, CSS)
C. Backend API (Express)
• Entry: server.js
• Routes (auth, career, knowledgeHub, recommendation, review)
• Controllers & Services
• Config (env, db connection)
D. Database (MongoDB Atlas)
• Collections: Users, Careers/Specializations, RecommendationResults, Reviews
E. External Service
• Coursera API for fetching course data
F. Supporting libraries
• bcrypt, JWT secret, cors, body-parser
Interactions & Data Flows
1. User → Browser → React UI
2. React UI → HTTP (Axios/fetch) → Express API routes
• Auth endpoints (/signup, /login, /user, /check-token)
• Career endpoints (/get-specializations, /explore-career-options)
• Recommendation endpoint (/recommend-specialization)
• Knowledge hub (/get-courses → Coursera API)
• Reviews (/reviews CRUD)
3. Express Service Layer → MongoDB (via Mongoose)
4. For course search, Express calls Coursera’s external HTTP API and returns results to UI
Architectural Patterns & Design Principles
• Separation of concerns: UI vs API vs DB
• Layered backend: Routes → Controllers → Services → Models
• Stateless JWT authentication for protected routes
• External integration abstracted behind KnowledgeHub service
• Config driven (dotenv), allowing multiple environments