Overview
Resume Generator consists of two separate applications:- Backend: Node.js/Express REST API (port 3000)
- Frontend: React/Vite SPA (port 5173)
System requirements
Development
- Node.js 18+ (LTS recommended)
- npm 9+ or yarn 1.22+
- MongoDB 6.0+ (local or Atlas)
- 4GB RAM minimum
Production
- Node.js 18+ (LTS)
- Process manager (PM2 recommended)
- Reverse proxy (nginx/Apache)
- SSL certificate
Development installation
Backend setup
Install dependencies
The backend uses these key packages:Source: backend/package.jsonInstall all dependencies:
Puppeteer will download a compatible Chromium binary (~300MB) during installation. This is normal and required for PDF generation.
Configure environment variables
Create a Add the following configuration:Environment variable details:
.env file in the backend/ directory:| Variable | Description | Example |
|---|---|---|
MONGO_URI | MongoDB connection string with authentication | mongodb+srv://user:pass@host/db |
JWT_SECRET | Secret key for signing JWT tokens (min 32 chars) | Use crypto.randomBytes(32).toString(‘hex’) |
GOOGLE_GENAI_API_KEY | API key from Google AI Studio | Starts with AIzaSy... |
Set up MongoDB
Option A: MongoDB Atlas (recommended for beginners)Use this connection string in The database connection is established in the server startup:Source: backend/src/config/database.js
- Create a free account at mongodb.com/cloud/atlas
- Create a new cluster (free tier M0 is sufficient)
- Create a database user:
- Go to Database Access
- Add New Database User
- Choose password authentication
- Save the username and password
- Whitelist your IP address:
- Go to Network Access
- Add IP Address
- Add your current IP or
0.0.0.0/0for development
- Get your connection string:
- Click “Connect” on your cluster
- Choose “Connect your application”
- Copy the connection string
- Replace
<password>with your database user password
.env:Get a Google Gemini API key
- Visit Google AI Studio
- Sign in with your Google account
- Click Get API Key
- Create a new API key for your project
- Copy the key and add it to your
.envfile
Frontend setup
Install dependencies
The frontend uses these key packages:Source: frontend/package.jsonInstall all dependencies:
Configure API endpoint (optional)
By default, the frontend makes requests to Source: backend/src/app.js:9-12
http://localhost:3000. If you need to change this, update the Axios configuration or API service files.The backend CORS is pre-configured for the Vite dev server:Project structure
Understanding the codebase organization:Backend structure
Frontend structure
Production deployment
Backend deployment
Build for production
While the backend doesn’t require a build step (CommonJS modules), ensure all dependencies are installed:This installs only production dependencies, excluding nodemon.
Use a process manager
Install and configure PM2:This ensures the backend restarts automatically after server reboots.
Configure reverse proxy
Set up nginx to proxy requests to the Node.js server:Enable SSL with Let’s Encrypt:
Frontend deployment
Update API endpoint
Configure the production API URL in your frontend code. Update API service files to point to your production backend:
Build for production
Create an optimized production build:This executes:Output will be in the
dist/ directory.Troubleshooting
Puppeteer fails to launch in production
Puppeteer fails to launch in production
Error: Or run Puppeteer with
Failed to launch the browser processSolution for Linux servers:Install required dependencies:--no-sandbox flag (less secure):MongoDB connection timeout in production
MongoDB connection timeout in production
Solution:
- Ensure your production server IP is whitelisted in MongoDB Atlas Network Access
- Check firewall rules allow outbound connections to MongoDB (port 27017)
- Verify the connection string uses the correct SRV format:
mongodb+srv://
Environment variables not loading
Environment variables not loading
Solution:
- Ensure
.envfile is in the same directory asserver.js - Check that
dotenvis called before any other imports: - For production, use your hosting provider’s environment variable settings instead of
.envfiles
Port already in use
Port already in use
Error:
EADDRINUSE: address already in use :::3000Solution:
Find and kill the process using the port:Verification checklist
After installation, verify everything works:- Backend server starts without errors
- MongoDB connection is established
- Frontend dev server runs on port 5173
- Can register a new user account
- Can log in with credentials
- Can access protected routes after login
- Can upload a resume file (PDF/DOCX)
- Interview report generates successfully
- Can view generated report
- Can export tailored resume PDF
- Previous reports appear in dashboard
Next steps
Authentication API
Explore authentication endpoints
Interview API
Learn about interview report generation