Bartendie Development Environment Guide
Bartendie Development Environment Guide
Section titled “Bartendie Development Environment Guide”This guide provides multiple ways to run the Bartendie development environment as persistent services, making it accessible to both you and Augment AI for collaborative development.
🚀 Quick Start Options
Section titled “🚀 Quick Start Options”Option 1: Simple Service Manager (Recommended)
Section titled “Option 1: Simple Service Manager (Recommended)”The easiest way to start both frontend and backend as persistent services:
# Start both servicespnpm dev
# Or use the script directly./scripts/dev-services.sh start
# Check statuspnpm run dev:status
# View logspnpm run dev:logs
# Stop servicespnpm run dev:stopOption 2: HTTPS Development (For SSL Testing)
Section titled “Option 2: HTTPS Development (For SSL Testing)”# Setup HTTPS certificates (one-time)./scripts/setup-https-dev.sh
# Start with HTTPSpnpm run dev:httpsOption 3: Docker Compose (Full Isolation)
Section titled “Option 3: Docker Compose (Full Isolation)”# Start all services including databasesdocker-compose -f docker-compose.dev.yml up -d
# View logsdocker-compose -f docker-compose.dev.yml logs -f
# Stop servicesdocker-compose -f docker-compose.dev.yml down📋 Available Commands
Section titled “📋 Available Commands”Root Project Commands
Section titled “Root Project Commands”# Developmentpnpm dev # Start both servicespnpm run dev:stop # Stop both servicespnpm run dev:restart # Restart both servicespnpm run dev:status # Check service statuspnpm run dev:logs # View logs from both servicespnpm run dev:logs:backend # View backend logs onlypnpm run dev:logs:frontend # View frontend logs onlypnpm run dev:follow # Follow logs in real-timepnpm run dev:https # Start with HTTPS support
# Individual servicespnpm run backend # Start only backendpnpm run frontend # Start only frontend
# Setup and maintenancepnpm run setup # Install all dependenciespnpm test # Run all testspnpm run test:backend # Run backend tests onlypnpm run test:frontend # Run frontend tests onlypnpm run test:e2e # Run end-to-end testspnpm run quality # Run code quality checksService Manager Commands
Section titled “Service Manager Commands”./scripts/dev-services.sh start # Start both services./scripts/dev-services.sh stop # Stop both services./scripts/dev-services.sh restart # Restart both services./scripts/dev-services.sh status # Show service status./scripts/dev-services.sh logs [service] # Show logs./scripts/dev-services.sh follow [service] # Follow logs./scripts/dev-services.sh backend # Start only backend./scripts/dev-services.sh frontend # Start only frontend./scripts/dev-services.sh help # Show help🌐 Development URLs
Section titled “🌐 Development URLs”Once services are running, access the application at:
- Frontend Application: http://dev.bartendie.com:3001
- Backend API: http://dev.bartendie.com:4001
- GraphQL Playground: http://dev.bartendie.com:4001/api/graphql
- Phoenix LiveDashboard: http://dev.bartendie.com:4001/dashboard
Alternative URLs (localhost)
Section titled “Alternative URLs (localhost)”- Frontend: http://localhost:3001
- Backend: http://localhost:4001
- GraphQL: http://localhost:4001/api/graphql
🔧 Service Management Features
Section titled “🔧 Service Management Features”Persistent Services
Section titled “Persistent Services”The development services run as background processes and persist until explicitly stopped. This means:
- ✅ Services continue running even if you close your terminal
- ✅ Both you and Augment can access the same running instance
- ✅ No need to restart services when switching between tasks
- ✅ Automatic process management with PID tracking
Log Management
Section titled “Log Management”- Real-time logs:
pnpm run dev:follow - Service-specific logs:
pnpm run dev:logs:backendorpnpm run dev:logs:frontend - Log files: Stored in
.dev-services/directory - Log rotation: Automatic cleanup of old logs
Health Monitoring
Section titled “Health Monitoring”- Service status:
pnpm run dev:status - Port availability: Automatic port conflict detection
- Health checks: Built-in service health verification
- Auto-restart: Services restart automatically on failure
🐳 Docker Development
Section titled “🐳 Docker Development”For complete isolation and consistency:
Start Services
Section titled “Start Services”# Start all services (backend, frontend, databases)docker-compose -f docker-compose.dev.yml up -d
# Start specific servicedocker-compose -f docker-compose.dev.yml up backendMonitor Services
Section titled “Monitor Services”# View all logsdocker-compose -f docker-compose.dev.yml logs -f
# View specific service logsdocker-compose -f docker-compose.dev.yml logs -f backenddocker-compose -f docker-compose.dev.yml logs -f frontend
# Check service statusdocker-compose -f docker-compose.dev.yml psStop Services
Section titled “Stop Services”# Stop all servicesdocker-compose -f docker-compose.dev.yml down
# Stop and remove volumesdocker-compose -f docker-compose.dev.yml down -v🛠️ WebStorm Integration
Section titled “🛠️ WebStorm Integration”Configure WebStorm Run Configurations
Section titled “Configure WebStorm Run Configurations”-
Backend Configuration:
- Name: “Bartendie Backend”
- Command:
./scripts/dev-services.sh backend - Working Directory: Project root
-
Frontend Configuration:
- Name: “Bartendie Frontend”
- Command:
./scripts/dev-services.sh frontend - Working Directory: Project root
-
Full Development:
- Name: “Bartendie Dev Services”
- Command:
pnpm dev - Working Directory: Project root
WebStorm Terminal Integration
Section titled “WebStorm Terminal Integration”Add these aliases to your shell profile:
# Add to ~/.zshrc or ~/.bashrcalias bd-dev="cd /path/to/bartendie && pnpm dev"alias bd-status="cd /path/to/bartendie && pnpm run dev:status"alias bd-logs="cd /path/to/bartendie && pnpm run dev:logs"alias bd-stop="cd /path/to/bartendie && pnpm run dev:stop"🔍 Troubleshooting
Section titled “🔍 Troubleshooting”Port Conflicts
Section titled “Port Conflicts”If ports 3001 or 4001 are in use:
# Check what's using the portslsof -i :3001lsof -i :4001
# Kill processes if neededkill -9 <PID>
# Or use the service manager to stop cleanlypnpm run dev:stopService Not Starting
Section titled “Service Not Starting”# Check service statuspnpm run dev:status
# View logs for errorspnpm run dev:logs
# Restart servicespnpm run dev:restartDatabase Issues
Section titled “Database Issues”# Reset database (if using local PostgreSQL)mix ecto.reset
# Or use Docker for isolated databasedocker-compose -f docker-compose.dev.yml up postgres eventstore -dFrontend Build Issues
Section titled “Frontend Build Issues”# Clear node_modules and reinstallcd frontendrm -rf node_modules pnpm-lock.yamlpnpm install
# Or restart just the frontend servicepnpm run dev:stoppnpm run frontend📁 File Structure
Section titled “📁 File Structure”bartendie/├── scripts/│ ├── dev-services.sh # Main service manager│ ├── start-dev-https.sh # HTTPS development│ └── setup-https-dev.sh # HTTPS setup├── .dev-services/ # Service management files│ ├── backend.pid # Backend process ID│ ├── frontend.pid # Frontend process ID│ ├── backend.log # Backend logs│ └── frontend.log # Frontend logs├── docker-compose.dev.yml # Docker development setup├── Dockerfile.dev # Development Docker image├── package.json # Root project scripts└── DEV_ENVIRONMENT_GUIDE.md # This guide🤝 Collaborative Development
Section titled “🤝 Collaborative Development”This setup enables seamless collaboration between you and Augment:
- Shared Services: Both can access the same running instance
- Persistent State: Services maintain state across sessions
- Real-time Updates: Hot reloading works for both users
- Log Sharing: Both can view the same logs and debug information
- Consistent Environment: Same URLs and ports for everyone
🎯 Best Practices
Section titled “🎯 Best Practices”- Always check status first:
pnpm run dev:status - Use service manager: Prefer
pnpm devover manual starts - Monitor logs: Use
pnpm run dev:followfor active development - Clean shutdown: Always use
pnpm run dev:stopto stop services - Regular restarts: Use
pnpm run dev:restartif services become unresponsive