How pavelihno/smart-resume works
Project type and purpose
• Smart Resume is a containerized, full-stack résumé + cover-letter builder.
• Front end: React SPA served by Nginx (or dev server).
• Back end: Express.js API that talks to MongoDB and renders LaTeX templates.
• Database: MongoDB (with optional mongo-express UI).
• PDF engine: either in-container LaTeX compilation or external .tex download.
File structure
• Top-level: .env, docker-compose.yml, db/, client/, server/.
• client/: React source (src/), build configurations, Dockerfiles, Nginx config.
• server/: Express entrypoints (app.js, server.js), MVC directories (controllers, models, routes), static LaTeX templates, utility libs (errors, latex).
• db/: MongoDB initialization script.
README
• Describes Docker-first workflow and two PDF modes (local vs external).
• Shows how environment variables drive which Dockerfiles get used.
• Mentions ports: client on 80 or 3000, API on 8080.
Main components & interactions
a. Client container
• React SPA + JS code calls api.js → Express server.
• Served via Nginx (production) or React dev server (development).
b. Server container
• Exposes REST endpoints (/profiles, /projects, /coverLetters, etc.).
• Uses controllers → models → MongoDB.
• On export: reads LaTeX templates from server/static/templates, merges with data, and either:
• Runs node-latex locally → PDF
• Skips compilation → returns .tex
c. MongoDB container
• Primary data store for user profiles, projects, work experience, etc.
• Initialized by db/mongo-init.js for user/roles.
d. (Optional) mongo-express container
• UI for browsing/editing the DB.
e. Docker Compose
• Defines and links: react/nginx, express, mongo, (mongo-express).
• Shared .env mounts into each container.
Architectural patterns & design principles
• Separation of concerns:
• Front end (presentation) vs API (business logic) vs Database (persistence).
• MVC in the server: routes → controllers → models.
• Containerized microservices style: each major tier in its own container.
• Environment-driven builds: NODE_ENV and REACT_APP_PDF_GENERATION_MODE select Dockerfiles.
Detailed elements
• Labels for each container (“React Client”, “Express API”, “MongoDB”).
• Port mappings (Client: 80/3000, API: 8080).
• Directories only if needed: e.g. inside Express, call out controllers/, models/, static/templates.