- Python 3.11+
- MongoDB Atlas account (free M0 tier)
- Google Gemini API key (free tier)
cd backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Download spaCy model
python -m spacy download en_core_web_mdCreate .env file in the backend directory:
cp .env.example .envEdit .env and add your credentials:
# MongoDB Atlas Connection
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/cv-wizard?retryWrites=true&w=majority
# Google Gemini API
GEMINI_API_KEY=your_gemini_api_key_here
# Application Settings
ENVIRONMENT=development
DEBUG=True
PORT=8000
HOST=0.0.0.0
# File Upload Settings
MAX_FILE_SIZE=5242880 # 5MB
UPLOAD_DIR=./uploads
QUARANTINE_DIR=./quarantine
# Security
SECRET_KEY=your-secret-key-change-in-production
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# Rate Limiting
RATE_LIMIT_PER_MINUTE=10
RATE_LIMIT_WINDOW=900
# Session Settings
SESSION_TTL_HOURS=24- Go to MongoDB Atlas
- Create free M0 cluster
- Create database user
- Whitelist your IP (or 0.0.0.0/0 for development)
- Get connection string from "Connect" → "Connect your application"
- Replace
<password>and<username>in the URI
- Go to Google AI Studio
- Create new API key
- Copy and paste into
.env
# Make sure you're in the backend directory with venv activated
cd backend
source venv/bin/activate
# Run with uvicorn
python main.py
# Or use uvicorn directly
uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at:
- API: http://localhost:8000
- Docs: http://localhost:8000/docs
- Health: http://localhost:8000/health
curl -X POST "http://localhost:8000/api/upload" \
-F "file=@/path/to/your/resume.pdf"Response:
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "resume.pdf",
"file_hash": "a1b2c3...",
"extracted_text": "...",
"parsed_data": {
"skills": ["Python", "FastAPI"],
"experience": [],
"education": [],
"contact": {...}
}
}curl -X POST "http://localhost:8000/api/analyze" \
-H "Content-Type: application/json" \
-d '{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"job_description": "We are looking for a Python developer with FastAPI experience..."
}'# Download as Markdown
curl "http://localhost:8000/api/download/{session_id}/markdown" \
-o optimized_resume.md
# Download as PDF (TODO)
curl "http://localhost:8000/api/download/{session_id}/pdf" \
-o optimized_resume.pdfOnce the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
python -m spacy download en_core_web_mdIf you have limited bandwidth, use the smaller model:
python -m spacy download en_core_web_sm- Check if your IP is whitelisted in MongoDB Atlas
- Verify the connection string format
- Ensure database user has correct permissions
Free tier limits:
- 5 requests per minute
- ~20-25 requests per day
The API implements caching to reduce redundant calls.
Make sure you're in the virtual environment:
source venv/bin/activate # On Windows: venv\Scripts\activate- ✅ Backend API is running
- 🔄 Create frontend React application
- 🔄 Implement PDF generation
- 🔄 Add Docker configuration
- 🔄 Deploy to AWS EC2
uvicorn main:app --reloadLogs are printed to console. For production, configure proper logging.
View your data in MongoDB Atlas:
- Go to your cluster
- Click "Browse Collections"
- Navigate to
cv_wizarddatabase →cv_sessionscollection
Test PDF security validation with a malicious pattern:
# This will be rejected
echo "%PDF-1.4\n/JavaScript (alert(1))" > test.pdf
curl -X POST "http://localhost:8000/api/upload" -F "file=@test.pdf"See DEPLOYMENT.md (to be created) for AWS EC2 deployment instructions.
For issues or questions:
- Check API documentation at
/docs - Review logs in console
- Check MongoDB Atlas dashboard
- Verify environment variables in
.env