Prerequisites
Before you begin, ensure you have the following installed:- Docker Desktop - For containerized development
- Docker Compose - For orchestrating multi-container apps
- Go 1.24+ - For local Go development (optional)
- Node.js - For frontend build tools
- Google Gemini API key - Required for AI features
Quick Start
Set up environment variables
Create a
.env file with your configuration:Generate a secure
TOKEN_SECRET using: openssl rand -base64 32Start development environment
Use the Makefile command to build and start the containers:This command will:
- Build the Docker image from
docker/dev/Dockerfile - Start the application container
- Start the SQLite web dashboard for database inspection
- Mount your local directory for live code reloading
Access the application
Once the containers are running:
- Web interface: http://localhost:8765
- Database dashboard: http://localhost:8080
- Default credentials:
- Username:
admin - Password:
VegaAdmin
- Username:
The application automatically reloads when you make code changes.
Development Commands
The project includes a Makefile with helpful commands:| Command | Description |
|---|---|
make run | Start development environment in detached mode |
make run-it | Start development environment with interactive logs |
make restart | Rebuild and restart containers |
make stop | Stop all containers |
make logs | View container logs (follows last 100 lines) |
make enter-app | Open shell inside app container |
make test | Run test suite with coverage |
make test-verbose | Run tests with verbose output |
make format | Format code with gofmt and run go vet |
Example Usage
Frontend Development
CSS Build Process
Vega AI uses Tailwind CSS with a build process that optimizes CSS delivery. The production CSS is ~46KB compared to the 340KB CDN version.Build CSS for production
static/css/output.css file with only the styles used in your templates.Template Structure
The frontend is built with Go templates:Project Structure
Understanding the codebase organization:Key Directories
internal/auth
User authentication, JWT tokens, OAuth integration
internal/job
Job tracking, company management, match results
internal/ai
AI services: CV parsing, job matching, document generation
internal/quota
Usage quota tracking and enforcement for cloud mode
Environment Variables
Core Application Settings
| Variable | Required | Description |
|---|---|---|
TOKEN_SECRET | Yes | JWT secret for user sessions |
GEMINI_API_KEY | Yes | Google AI API key |
GOOGLE_CLIENT_ID | No | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | No | Google OAuth client secret |
Admin User Management
Admin user creation is only available in self-hosted mode. In cloud mode, admin privileges must be granted manually in the database.
| Variable | Required | Default | Description |
|---|---|---|---|
ADMIN_USERNAME | No | admin | Admin username (3-50 characters) |
ADMIN_PASSWORD | No | VegaAdmin | Admin password (8-64 characters) |
RESET_ADMIN_PASSWORD | No | false | Reset admin password on startup |
CORS Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
CORS_ALLOWED_ORIGINS | No | * | Comma-separated list of allowed origins |
CORS_ALLOW_CREDENTIALS | No | false | Allow credentials in CORS requests |
Database
Vega AI uses SQLite for data storage:- Location:
data/vega.db(in Docker volume) - Migrations: Automatic on startup
- Schema: Located in
migrations/sqlite/ - Dashboard: Available at http://localhost:8080 during development
Database Commands
| Command | Description |
|---|---|
make migrate-create | Create a new migration file |
make migrate-up | Run pending migrations |
make migrate-down | Rollback last migration |
make migrate-reset | Rollback all migrations |
make migrate-force | Force migration to specific version |
Git Hooks
Set up pre-commit hooks for code quality:- Checks code formatting with
gofmt - Runs
go vetfor static analysis - Runs inside Docker containers for consistency
Troubleshooting
Port Already in Use
If port 8765 is already in use:Database Locked
If you encounter database lock errors:Permission Denied
If you have permission issues with the data directory:Container Won’t Start
View logs to diagnose issues:Code Changes Not Reflected
Ensure the volume mount is working:Next Steps
Testing Guide
Learn how to write and run tests
Contributing
Contribute to Vega AI development