This guide provides comprehensive setup and configuration instructions for all components of the DEV.OS system.
- Environment Setup
- Backend Configuration
- Frontend Configuration
- OS Automation Setup
- Database Configuration
- OAuth Integration
- API Keys & Secrets
- Troubleshooting
Minimum:
- CPU: 2-core processor
- RAM: 4GB
- Disk: 2GB free space
- OS: Windows 10+, macOS 10.15+, or Linux (Ubuntu 20.04+)
Recommended:
- CPU: 4+ core processor
- RAM: 8GB+
- Disk: 5GB+ free space
- SSD storage
# Download from https://nodejs.org/ (v18 or higher)
# Verify installation
node --version # Should be v18.0.0 or higher
npm --version # Should be 9.0.0 or higher# Download from https://www.python.org/ (3.10 or higher)
# Verify installation
python --version # Should be 3.10 or higher
pip --version # Should be 21.0 or higher# Download from https://git-scm.com/
# Verify installation
git --versioncd apps/dev-auth-backendnpm installCreate .env file in apps/dev-auth-backend/:
# Server Configuration
PORT=3001
NODE_ENV=development
# Database
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dev-os?retryWrites=true&w=majority
# JWT Tokens
JWT_ACCESS_SECRET=your-super-secret-access-key-min-32-chars
JWT_REFRESH_SECRET=your-super-secret-refresh-key-min-32-chars
JWT_ACCESS_EXPIRY=1h
JWT_REFRESH_EXPIRY=7d
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3001/api/auth/google/callback
# GitHub OAuth
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GITHUB_REDIRECT_URI=http://localhost:3001/api/auth/github/callback
GITHUB_TOKEN=github_pat_xxxxx (for API access)
# Google Gemini AI
GOOGLE_GEMINI_API_KEY=your-gemini-api-key
# Logging
LOG_LEVEL=debug
# CORS
CORS_ORIGIN=http://localhost:3000,http://localhost:8000# Development mode (with auto-reload)
npm run dev
# Production mode (build first)
npm run build
npm start
# Run tests
npm run test
npm run test:watch| Variable | Description | Example |
|---|---|---|
PORT |
Server port | 3001 |
MONGODB_URI |
MongoDB connection string | mongodb+srv://... |
JWT_ACCESS_SECRET |
Secret for access tokens | Min 32 characters |
GOOGLE_CLIENT_ID |
Google OAuth client ID | .apps.googleusercontent.com |
GITHUB_TOKEN |
GitHub personal access token | github_pat_... |
GOOGLE_GEMINI_API_KEY |
Google's Gemini API key | AIzaSy... |
cd apps/dev-frontend-uinpm installCreate .env.local file in apps/dev-frontend-ui/:
# Next.js Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_WS_URL=ws://localhost:3001
NEXT_PUBLIC_OS_AUTOMATION_URL=http://localhost:8000
# Feature Flags
NEXT_PUBLIC_ENABLE_VOICE=true
NEXT_PUBLIC_ENABLE_GITHUB_SYNC=true
NEXT_PUBLIC_ENABLE_VOICE_FEEDBACK=true
# Analytics (Optional)
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
# Environment
NEXT_PUBLIC_APP_ENV=development# Development mode (with hot reload)
npm run dev
# Production mode
npm run build
npm start
# Run tests
npm run test
# Build for production deployment
npm run build
# Output in .next/ directory| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API base URL | http://localhost:3001/api |
NEXT_PUBLIC_WS_URL |
WebSocket server URL | ws://localhost:3001 |
NEXT_PUBLIC_OS_AUTOMATION_URL |
OS automation service URL | http://localhost:8000 |
NEXT_PUBLIC_ENABLE_VOICE |
Enable voice commands | true |
cd apps/dev-os-automationWindows:
python -m venv venv
venv\Scripts\activatemacOS/Linux:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate .env file in apps/dev-os-automation/:
# Server Configuration
PORT=8000
HOST=0.0.0.0
DEBUG=true
# API Gateway Backend URL
API_GATEWAY_URL=http://localhost:3001/api
# File Operations
DEFAULT_FILE_PATH=/Users/YourUsername/Documents
ALLOWED_PATHS=/Users/YourUsername
# Application Paths (Windows)
APP_PATHS_CHROME=C:\Program Files\Google\Chrome\Application\chrome.exe
APP_PATHS_VSCODE=C:\Users\YourUsername\AppData\Local\Programs\Microsoft VS Code\Code.exe
APP_PATHS_EXPLORER=explorer.exe
APP_PATHS_CALC=calc.exe
# Application Paths (macOS)
# APP_PATHS_CHROME=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
# APP_PATHS_VSCODE=/Applications/Visual Studio Code.app/Contents/MacOS/Code
# Guard Agent
AUDIT_LOG_ENABLED=true
PERMISSION_SYSTEM_ENABLED=true
# Logging
LOG_LEVEL=INFO# Basic run
python src/server.py
# With auto-reload (development)
pip install watchdog
watchmedo auto-restart -d . -p '*.py' -- python src/server.py| Variable | Description | Example |
|---|---|---|
PORT |
FastAPI server port | 8000 |
API_GATEWAY_URL |
Backend API URL | http://localhost:3001/api |
DEFAULT_FILE_PATH |
Default file operations path | /Users/Documents |
APP_PATHS_* |
Full paths to applications | Full executable path |
AUDIT_LOG_ENABLED |
Enable operation logging | true |
- Visit MongoDB Atlas
- Sign up for free account
- Verify email
- Click "Create Deployment"
- Select "Shared" (Free tier)
- Choose region (closest to you)
- Click "Create Deployment"
- Set credentials (username & password)
- Click "Connect" on your cluster
- Choose "Drivers"
- Copy connection string
- Replace
<password>with your password - Replace
<username>with your username
Connection String Format:
mongodb+srv://username:password@cluster-name.mongodb.net/database-name?retryWrites=true&w=majority
- In MongoDB Atlas, go to "Collections"
- Click "Create Database"
- Database name:
dev-os - Collection name:
users
The backend will automatically create these collections:
- users - User accounts and profiles
- commands - Command execution history
- sessions - User sessions
- audit_logs - Security audit trail
// In MongoDB Atlas Web Console
// Collection: users
db.users.createIndex({ "email": 1 }, { unique: true });
db.users.createIndex({ "githubId": 1 });
// Collection: commands
db.commands.createIndex({ "userId": 1, "createdAt": -1 });
// Collection: sessions
db.sessions.createIndex({ "userId": 1 });
db.sessions.createIndex({ "expiresAt": 1 }, { expireAfterSeconds: 0 });- Visit Google Cloud Console
- Create new project
- Project name: "DEV.OS"
- Search for "Gemini API"
- Click "Enable"
- Go to "APIs & Services" > "Enabled APIs"
- Search for "Google+ API"
- Click "Enable"
- Go to "Credentials"
- Click "Create Credentials" > "OAuth Client ID"
- Choose "Web application"
- Add Authorized redirect URIs:
http://localhost:3001/api/auth/google/callbackhttps://yourdomain.com/api/auth/google/callback
- Copy Client ID and Client Secret
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "API Key"
- Copy the API key
- Add to
.envasGOOGLE_GEMINI_API_KEY
- Visit GitHub Settings
- Click "New OAuth App"
- Fill in:
- Application name: DEV.OS
- Homepage URL: http://localhost:3000
- Authorization callback URL: http://localhost:3001/api/auth/github/callback
- Go to GitHub Settings
- Click "Generate new token"
- Select scopes:
repo(full control of repositories)user(read user profile)gist(manage gists)
- Copy token and save in
.envasGITHUB_TOKEN
- Copy Client ID →
GITHUB_CLIENT_ID - Click "Generate new client secret" →
GITHUB_CLIENT_SECRET
- Go to Google AI Studio
- Click "Create API Key"
- Select project
- Copy key to
.env
Windows (PowerShell):
[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((New-Guid).Guid + (New-Guid).Guid))macOS/Linux (Bash):
openssl rand -base64 32Use generated strings for JWT_ACCESS_SECRET and JWT_REFRESH_SECRET.
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install- Check connection string in
.env - Verify username/password
- Check if IP is whitelisted in MongoDB Atlas
- Ensure network access is enabled
# Find process on port 3001
lsof -i :3001 # macOS/Linux
netstat -ano | findstr :3001 # Windows
# Kill process
kill -9 <PID> # macOS/Linux
taskkill /PID <PID> /F # Windows# Clear Next.js cache
rm -rf .next
npm run dev- Ensure backend is running on correct port
- Check
NEXT_PUBLIC_WS_URLenvironment variable - Verify CORS settings in backend
# Check Python version
python --version
# Reinstall dependencies
pip install --upgrade -r requirements.txt- Check
DEFAULT_FILE_PATHexists - Verify user has read/write permissions
- On macOS, allow Terminal full disk access in Security settings
- Verify full path in
APP_PATHS_* - Check application is installed at that path
- Use quotes for paths with spaces:
"C:\Program Files\...\app.exe"
// Add indexes for frequently queried fields
db.commands.createIndex({ "userId": 1, "createdAt": -1 });
db.commands.createIndex({ "status": 1 });# Enable Static Generation
npm run build
# Analyze bundle size
npm install --save-dev @next/bundle-analyzer// Use connection pooling
// Enable compression for large responses
// Implement caching with Redis (optional)- Never commit
.envfiles - Add to.gitignore - Use strong JWT secrets - Minimum 32 characters
- Rotate tokens regularly - Implement token refresh
- Enable HTTPS in production
- Use environment-specific configs - Don't hardcode values
- Validate all inputs - Prevent injection attacks
- Keep dependencies updated - Run
npm auditregularly
- Complete all configuration steps above
- Test each component separately
- Run the system end-to-end
- See QUICK_START.md for running the full system
- Check API.md for API documentation
Last Updated: December 27, 2025