A Python application for managing and maintaining resume data using SQLite database.
- Store all resume data in a structured database
- Web-based forms for easy data entry and editing
- Manage personal info, work experience, education, skills, projects, and certifications
- AI-powered CV parsing using Google Gemini, Groq, or local Ollama - automatically extract data from existing CVs (PDF, DOCX, TXT)
- Multi-consultant support - manage multiple consultant profiles with easy switching
- Multi-language support (English and Dutch) with easy language switching
- Import/export consultant data in JSON format
- Docker support for easy deployment
The application includes AI-powered features that can automatically parse existing CVs and extract structured information using Google Gemini, Groq, or local Ollama.
- PDF files (.pdf)
- Microsoft Word documents (.docx, .doc)
- Plain text files (.txt)
- Get a Gemini API key from Google AI Studio
- Set the environment variable:
export GEMINI_API_KEY="your-gemini-api-key-here"
- Optional: Configure Groq:
export GROQ_API_KEY="your-groq-api-key-here"
- Optional: Configure local Ollama (defaults already work for local install):
export OLLAMA_ENABLED=true export OLLAMA_BASE_URL="http://localhost:11434" export OLLAMA_MODEL="orca2" export OLLAMA_TIMEOUT_SECONDS=180
- In Docker, use
host.docker.internalwhen Ollama runs on the host machine.
- Upload your CV file via the web interface
- The AI analyzes the content and extracts:
- Personal information (name, contact details)
- Work experience with dates and descriptions
- Education history
- Skills categorized by type
- Projects with technologies used
- Certifications with issue dates
- Review the extracted data before importing
- Create a new consultant profile with the structured data
Note: The AI parsing feature is optional. All manual features work without an API key.
The application includes OAuth 2.0 authentication with role-based access control to secure your resume data when exposing the application to the internet.
- OAuth 2.0 Integration: Login with Google or Microsoft accounts
- Passwordless Email Login: Send one-time sign-in links to existing users
- Whitelist-based Access: Only pre-approved emails can access the system
- Role-based Authorization:
- Admin: Full access to all features, user management, and whitelist control
- Consultant: Can only edit their own personal resume data
- Admin Dashboard: Manage users, roles, and whitelist entries
-
Configure OAuth Providers
Copy the environment template:
cp env.template .env
-
Set up Google OAuth (Optional)
a. Go to Google Cloud Console
b. Create a new project or select existing
c. Enable Google+ API
d. Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client ID"
e. Set application type to "Web application"
f. Add authorized redirect URI:
http://localhost:5000/auth/google/callback(or your domain)g. Copy Client ID and Client Secret to
.env:GOOGLE_CLIENT_ID=your-client-id-here GOOGLE_CLIENT_SECRET=your-client-secret-here
-
Set up Microsoft OAuth (Optional)
a. Go to Azure Portal
b. Navigate to "Azure Active Directory" → "App registrations"
c. Click "New registration"
d. Set redirect URI:
http://localhost:5000/auth/microsoft/callback(or your domain)e. Go to "Certificates & secrets" → Create new client secret
f. Copy Application (client) ID and client secret to
.env:MICROSOFT_CLIENT_ID=your-client-id-here MICROSOFT_CLIENT_SECRET=your-client-secret-here
If a provider client ID is not configured, that provider button is hidden from the login screen.
-
Configure Email Magic-Link Login (Optional)
Add SMTP settings to
.env:SMTP_HOST=smtp.yourprovider.com SMTP_PORT=587 SMTP_USERNAME=your-smtp-username SMTP_PASSWORD=your-smtp-password SMTP_USE_TLS=true SMTP_USE_SSL=false SMTP_FROM_EMAIL=no-reply@yourdomain.com SMTP_FROM_NAME=BetterCV EMAIL_LOGIN_TOKEN_TTL_MINUTES=30
Users can request a one-time login link by email. The login session remains active for 24 hours (or until logout).
-
Generate Secret Key
Generate a secure random secret key:
python -c "import secrets; print(secrets.token_hex(32))"Add it to
.env:SECRET_KEY=your-generated-secret-key-here
-
Set Base URL
For production deployment, set your domain:
BASE_URL=https://yourdomain.com
-
Initial Admin Setup
Before first login, add your email to the whitelist:
a. Edit
database.pyand modify the default admin email:INSERT OR IGNORE INTO user_whitelist (email, role, notes) VALUES ('your-email@example.com', 'admin', 'Initial admin user')
b. Initialize/reinitialize the database:
python init_db.py
-
Adding More Users
After logging in as admin:
- Go to the Admin Dashboard (Admin link in navigation)
- Use "Whitelist Management" to add approved emails
- Assign roles (admin or consultant)
- Users can then log in using OAuth providers
-
Role Permissions
- Admin:
- Access all consultant profiles
- Edit any resume data
- Manage users and whitelist
- Access admin dashboard
- Consultant:
- View only their own profile
- Edit only their personal information
- Cannot access other consultants' data
- Admin:
- Never commit
.envfile to version control (already in.gitignore) - Use HTTPS in production for secure OAuth callbacks
- Rotate secrets regularly, especially if exposed
- Review whitelist periodically to remove inactive users
- Use strong secret keys (minimum 32 characters)
- Configure OAuth apps with minimal required scopes
- Set appropriate redirect URIs in OAuth provider settings (no wildcards)
Update docker-compose.yml with your environment variables or use .env file:
services:
bettercv:
environment:
- SECRET_KEY=${SECRET_KEY}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- MICROSOFT_CLIENT_ID=${MICROSOFT_CLIENT_ID}
- MICROSOFT_CLIENT_SECRET=${MICROSOFT_CLIENT_SECRET}
- BASE_URL=https://yourdomain.com
env_file:
- .envThen run:
docker-compose up -d-
Build and run with Docker Compose:
docker-compose up -d
-
For AI features: Set the Gemini API key in your environment:
export GEMINI_API_KEY="your-gemini-api-key-here" docker-compose down docker-compose up -d
Or add it directly to the docker-compose.yml file:
environment: - GEMINI_API_KEY=your-gemini-api-key-here - GROQ_API_KEY=your-groq-api-key-here - OLLAMA_ENABLED=true - OLLAMA_BASE_URL=http://host.docker.internal:11434 - OLLAMA_MODEL=orca2
-
Open your browser to: http://localhost:5000
-
To stop the application:
docker-compose down
The database will be persisted in the ./data directory.
-
Install dependencies:
pip install -r requirements.txt
-
Install native libraries for WeasyPrint (required for PDF export):
- Linux (Debian/Ubuntu):
sudo apt-get update sudo apt-get install -y libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf-2.0-0 libffi-dev shared-mime-info
- Windows/macOS: See the official WeasyPrint installation guide for required system libraries.
- Linux (Debian/Ubuntu):
-
For AI features: Set one or more AI provider settings:
export GEMINI_API_KEY="your-gemini-api-key-here" export GROQ_API_KEY="your-groq-api-key-here" export OLLAMA_ENABLED=true export OLLAMA_BASE_URL="http://localhost:11434" export OLLAMA_MODEL="orca2"
-
Initialize the database:
python init_db.py
-
Run the application:
python app.py
-
Open your browser to: http://localhost:5000
PDF export note: BetterCV uses WeasyPrint for PDF generation.
Build the image:
docker build -t bettercv .Run the container:
# Basic run (without authentication)
docker run -d -p 5000:5000 -v $(pwd)/data:/app/data --name bettercv bettercv
# With AI features (include Gemini API key)
docker run -d -p 5000:5000 -v $(pwd)/data:/app/data \
-e GEMINI_API_KEY="your-api-key-here" \
--name bettercv bettercv
# With authentication (include OAuth credentials)
docker run -d -p 5000:5000 -v $(pwd)/data:/app/data \
-e SECRET_KEY="your-secret-key-here" \
-e GOOGLE_CLIENT_ID="your-google-client-id" \
-e GOOGLE_CLIENT_SECRET="your-google-client-secret" \
-e MICROSOFT_CLIENT_ID="your-microsoft-client-id" \
-e MICROSOFT_CLIENT_SECRET="your-microsoft-client-secret" \
-e BASE_URL="http://localhost:5000" \
--name bettercv bettercv
# Full setup with all features
docker run -d -p 5000:5000 -v $(pwd)/data:/app/data \
-e SECRET_KEY="your-secret-key-here" \
-e GOOGLE_CLIENT_ID="your-google-client-id" \
-e GOOGLE_CLIENT_SECRET="your-google-client-secret" \
-e MICROSOFT_CLIENT_ID="your-microsoft-client-id" \
-e MICROSOFT_CLIENT_SECRET="your-microsoft-client-secret" \
-e GEMINI_API_KEY="your-gemini-api-key" \
-e BASE_URL="http://localhost:5000" \
--name bettercv bettercvOr use docker-compose (recommended):
# Make sure you have .env file configured first
docker-compose up -dView logs:
docker logs bettercv
# or with docker-compose:
docker-compose logs -fStop the container:
docker stop bettercv
# or with docker-compose:
docker-compose down