This guide covers the two main deployment methods for Simple Menu: local development setup and Docker deployment.
- Node.js (v18 or higher)
- npm or yarn
- Git
-
Clone the repository
git clone <repository-url> cd Simple-menu
-
Backend Setup
cd Backend npm install npx prisma generate npx prisma migrate dev --name init npm start -
Frontend Setup (in a new terminal)
cd Frontend/front npm install npm start -
Access the application
- Frontend: http://localhost:4200
- Backend API: http://localhost:3000
- Health Check: http://localhost:3000/health
- Hot Reload: Both frontend and backend support hot reload during development
- Database Studio: Access the database with
npx prisma studio(from Backend directory) - Real-time Updates: WebSocket connection provides live updates across all clients
- Debug Mode: Full error logging and detailed console output
# Generate Prisma client (run from Backend directory)
npx prisma generate
# Create migration
npx prisma migrate dev --name your_migration_name
# View database in Prisma Studio
npx prisma studio
# Reset database (development only)
npx prisma migrate reset- Docker and Docker Compose
# Complete deployment with full monitoring stack
docker-compose -f docker\docker-compose.unified.yml up -dThe unified Docker deployment includes:
- Frontend: Angular application served via Nginx
- Backend: Node.js API server with WebSocket support
- Database: SQLite with persistent storage
- Prometheus: Metrics collection and storage
- Grafana: Metrics visualization and alerting
- Node Exporter: System metrics collection
- cAdvisor: Container metrics collection
- Elasticsearch: Log storage and search engine
- Logstash: Log processing and enrichment
- Kibana: Log visualization and analysis
- Filebeat: Log collection and shipping
| Service | URL | Credentials |
|---|---|---|
| 🍝 Simple Menu | http://localhost:4200 | - |
| 🔧 Backend API | http://localhost:3000 | - |
| 📊 Grafana | http://localhost:3001 | admin/admin |
| 🔍 Prometheus | http://localhost:9090 | - |
| 📋 Kibana | http://localhost:5601 | - |
| 🔍 Elasticsearch | http://localhost:9200 | - |
- RAM: 4GB
- CPU: 2 cores
- Storage: 10GB free space
- RAM: 6GB+
- CPU: 4+ cores
- Storage: 20GB+ free space
# Check service status
docker-compose -f docker\docker-compose.unified.yml ps
# View logs
docker-compose -f docker\docker-compose.unified.yml logs -f [service-name]
# Stop services
docker-compose -f docker\docker-compose.unified.yml down
# Rebuild and restart
docker-compose -f docker\docker-compose.unified.yml up --build -d
# Remove all data (caution!)
docker-compose -f docker\docker-compose.unified.yml down -v# Application health
curl http://localhost:3000/health
curl http://localhost:4200
# Monitoring health
curl http://localhost:9090/-/healthy # Prometheus
curl http://localhost:3001/api/health # Grafana
curl http://localhost:9200/_cluster/health # Elasticsearch# Run the automated LAN setup script
.\scripts\lan-setup\setup-lan-auto.ps1-
Find your local IP address
# Windows ipconfig | findstr IPv4 # Linux/macOS ifconfig | grep "inet " | grep -v 127.0.0.1
-
Update frontend environment
// Frontend/front/src/environments/environment.ts export const environment = { production: false, apiUrl: 'http://YOUR_IP:3000', wsUrl: 'ws://YOUR_IP:3000/menu-updates' };
-
For Docker deployment
# Update docker-compose.yml environment variables FRONTEND_API_URL=http://YOUR_IP:3000 FRONTEND_WS_URL=ws://YOUR_IP:3000/menu-updates -
Restart the application
# Local development # Restart both frontend and backend servers # Docker docker-compose -f docker\docker-compose.unified.yml down docker-compose -f docker\docker-compose.unified.yml up -d
After LAN configuration, the application will be accessible from any device on the network:
- Application: http://YOUR_IP:4200
- Admin Interface: http://YOUR_IP:4200/menu
- Slideshow: http://YOUR_IP:4200/slideshow
# Check if ports are in use
netstat -an | findstr :3000
netstat -an | findstr :4200
# Kill processes using the ports (Windows)
taskkill /f /im node.exe
taskkill /f /im ng.exe# Reset database (development only)
cd Backend
npx prisma migrate reset
# Regenerate Prisma client
npx prisma generate# Check backend is running
curl http://localhost:3000/health
# Test WebSocket connection
# Use a WebSocket client or browser dev tools# View container logs
docker-compose -f docker\docker-compose.unified.yml logs backend
docker-compose -f docker\docker-compose.unified.yml logs frontend
# Check container status
docker-compose -f docker\docker-compose.unified.yml ps
# Free up space
docker system prune -a- Reduce Elasticsearch heap size in docker-compose.yml
- Limit Docker container memory usage
- Close unnecessary applications
- Check system resources with
docker stats - Verify network connectivity
- Check database performance in Grafana dashboards
-
Firewall Settings
- Ensure ports 3000 and 4200 are open
- Check Windows Firewall or system firewall settings
-
Network Configuration
- Verify all devices are on the same network
- Check router settings for device communication
-
Environment Configuration
- Verify IP addresses in environment files
- Ensure frontend is pointing to correct backend URL
- Check Logs: Always start by checking application and container logs
- Health Endpoints: Use
/healthendpoints to verify service status - Network Tools: Use
ping,curl, and browser dev tools for debugging - Documentation: Refer to API Reference for detailed API information
For more information, see the main README or other documentation files in the docs directory.