CareerCraft uses a Service-Oriented Architecture (SOA) with a unified frontend orchestrating interactions between a persistent Backend API and a stateless ML Service. This hybrid approach enables high-performance AI inference without overloading the main application server.
-
Frontend (Next.js) (Port 3000)
- Role: Main user interface and orchestrator.
- Tech Stack: Next.js 16, React 19, Tailwind CSS 4, Lucide React.
- Responsibilities:
- Rendering UI (Server & Client Components).
- Managing Authentication state (Context/Cookies).
- Communicating with Backend for user data.
- Communicating directly with ML Service for real-time analysis.
-
Backend (Node.js/Express) (Port 5000)
- Role: Persistent data manager and authentication provider.
- Tech Stack: Express.js, Mongoose, JWT, Bcrypt.
- Database: MongoDB (User data, Profiles, Saved Cover Letters).
- Storage: Cloudinary (Resume file storage).
- Responsibilities:
- User Authentication (Signup/Signin).
- Profile Management.
- storing and retrieving saved resources (Resumes, Cover Letters).
-
ML Service (FastAPI) (Port 8001)
- Role: Stateless intelligence engine.
- Tech Stack: Python, FastAPI, Spacy, Scikit-Learn, Sentence-Transformers.
- Responsibilities:
- Resume Parsing (Text Extraction from PDF/DOCX).
- Resume Analysis (Keyword scoring, feedback).
- Job Matching (Cosine similarity).
- Cover Letter Generation (Template/GenAI logic).
+----------------------+ +----------------------+
| User Client |-------| Third-Party Services|
| (Browser/Next.js) | | (Cloudinary/MongoDB) |
+----------------------+ +----------------------+
| |
| (Auth / | (Analysis /
| Persistence) Inference)
v v
+------------+ +-------------+
| Backend | | ML Service |
| (Express) | | (FastAPI) |
+------------+ +-------------+
|
+------------+
| Database |
| (MongoDB) |
+------------+
- User Action: Uploads a resume file on "Resume Analysis" page.
- Flow: Frontend -> ML Service (
POST /resume/extract-text&/resume/analyze). - Result: Instant feedback displayed to user. No persistent storage in DB until explicitly saved.
- Rationale: Reduces load on Backend; keeps analysis fleeting and fast.
- User Action: Uploads a resume on "Upload Resume" page.
- Flow: Frontend -> Backend (
POST /api/resumes/upload). - Result: File stored in Cloudinary, link saved in MongoDB User Profile.
- User Action: Enters job details and analyzes resume.
- Flow: Frontend -> ML Service (
POST /cover-letter/generate-cover-letter). - Result: Generated text returned to Frontend.
- Save Action: User clicks "Save" -> Frontend -> Backend (
POST /api/cover-letters).
- JWT Strategies: Backend issues JWTs upon login. Frontend includes Bearer tokens in requests to Backend.
- ML Service Security: Currently open (CORS allowing all for development) or protected via internal tokens (Future improvement).
- Environmental Variables: All sensitive keys (DB URI, Cloudinary Secrets) are stored in
.envfiles and never exposed to the client.
- Stateless ML: The ML Service is stateless, making it easy to scale horizontally on GPU/CPU-optimized instances.
- CDN: frontend assets served via Next.js optimization.
- Database: MongoDB handles flexible schema for evolving user profiles.