A modular web dashboard for managing robots and 3D printers with reservation, tracking, logging, and real-time monitoring capabilities.
- Node.js 20+
- npm or yarn
- Install dependencies:
npm install- Initialize the database:
npm run db:push
npm run db:seed- Start the development servers:
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Email: admin@example.com
- Password: admin123
dash/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API client
│ │ ├── store/ # Zustand state
│ │ └── types/ # TypeScript types
├── server/ # Node.js backend
│ ├── src/
│ │ ├── routes/ # API endpoints
│ │ ├── middleware/ # Auth middleware
│ │ └── socket/ # WebSocket handlers
│ └── prisma/
│ └── schema.prisma # Database schema
- Dashboard: Real-time machine status overview
- Calendar: Reservation scheduling system
- Machines: Add, edit, and monitor equipment
- Jobs & Logs: Track job history and activity
- Maintenance: Submit and manage repair requests
- Real-time: WebSocket updates for live status changes
- Frontend: React 18, TypeScript, Vite, Tailwind CSS
- Backend: Node.js, Express, TypeScript
- Database: SQLite with Prisma ORM
- Real-time: Socket.io
- Auth: JWT with bcrypt
npm run dev- Start both frontend and backend in development modenpm run build- Build for productionnpm run db:push- Push schema changes to databasenpm run db:seed- Seed database with sample datanpm run db:studio- Open Prisma Studio
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/machines- List machinesPOST /api/machines- Create machineGET /api/reservations- List reservationsPOST /api/reservations- Create reservationGET /api/maintenance- List maintenance requestsPOST /api/maintenance- Submit maintenance request
- Node.js 20 or higher
- npm (comes with Node.js)
- Git
-
Clone the repository
git clone <your-repo-url> dash cd dash
-
Install dependencies
npm install
-
Configure environment files
# Copy example environment files cp server/.env.example server/.env cp client/.env.example client/.env -
Initialize the database
npm run db:push npm run db:seed
-
Start development servers
npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Default login:
admin@example.com/admin123
For production deployment on Linux servers, use the automated deployment script:
-
Clone and deploy
git clone <your-repo-url> dash cd dash chmod +x scripts/*.sh ./scripts/deploy.sh
The deployment script will:
- Install Node.js 20 LTS (if needed)
- Create data directories
- Generate secure
.envfiles - Install dependencies
- Build client and server
- Create and start systemd service
-
Access the application
http://your-server-ip:3001 -
Manage the service
sudo systemctl start dash # Start sudo systemctl stop dash # Stop sudo systemctl restart dash # Restart sudo systemctl status dash # View status journalctl -u dash -f # View logs
-
Clone the repository
git clone <your-repo-url> dash cd dash
-
Install dependencies
npm install
-
Configure environment
copy server\.env.example server\.env copy client\.env.example client\.env
Edit
server\.envand set a secureJWT_SECRET. -
Initialize database
npm run db:push npm run db:seed
-
Build for production
npm run build
-
Run the server
cd server node dist/index.jsFor running as a Windows service, consider using PM2 or NSSM.
./scripts/update.sh [OPTIONS]Options:
--reset- Discard all local changes and update (recommended for production servers)--stash- Automatically stash changes without prompting--help- Show help message
Examples:
# Interactive mode (prompts if there are local changes)
./scripts/update.sh
# Production mode (discards any local modifications)
./scripts/update.sh --reset
# Auto-stash mode (preserves changes, restores after update)
./scripts/update.sh --stashThis will pull latest changes, install dependencies, run migrations, rebuild, and restart the service.
git pull
npm install
npm run db:push
npm run build
# Restart the serverRegular backups protect your data. Backups include the SQLite database, uploaded files, and configuration.
data/dash.dborserver/prisma/dev.db- SQLite databasedata/uploads/- Uploaded filesserver/.envandclient/.env- Configuration files
Using the batch script:
scripts\backup.batUsing PowerShell:
.\scripts\backup.ps1Backups are saved to the backups/ folder with timestamp: dash_backup_YYYYMMDD_HHMMSS.zip
Manual backup:
mkdir backups
powershell Compress-Archive -Path server\prisma\dev.db,server\.env,client\.env -DestinationPath backups\manual_backup.zipCreate a backup:
./scripts/backup.sh
# Output: data/backups/dash_backup_20240123_120000.tar.gzManual backup:
mkdir -p data/backups
tar -czf data/backups/dash_backup_$(date +%Y%m%d_%H%M%S).tar.gz \
data/dash.db \
data/uploads \
server/.env \
client/.env# Enable daily backups at 2 AM
./scripts/setup-backup.sh --daily
# With SSH transfer to remote server
./scripts/setup-backup.sh --daily --ssh user@backup-server:/backups/dash
# Check status
./scripts/setup-backup.sh --status
# Disable automated backups
./scripts/setup-backup.sh --disable# Linux to Linux (SCP)
scp data/backups/dash_backup_*.tar.gz user@newmachine:/path/to/dash/
# Windows to Linux (using PowerShell with SSH)
scp backups\dash_backup_*.zip user@linux-server:/path/to/dash/backups/-
Stop the server if running
-
Extract the backup
Expand-Archive -Path backups\dash_backup_YYYYMMDD_HHMMSS.zip -DestinationPath restore_temp
-
Copy files to their locations
copy restore_temp\dev.db server\prisma\dev.db copy restore_temp\.env server\.env
-
Restart the server
cd server node dist/index.js
Using the restore script:
./scripts/restore.sh data/backups/dash_backup_20240123_120000.tar.gzRestore without overwriting config:
./scripts/restore.sh data/backups/dash_backup_20240123_120000.tar.gz --no-configManual restore:
# Stop the service
sudo systemctl stop dash
# Extract backup
tar -xzf data/backups/dash_backup_20240123_120000.tar.gz -C /
# Restart service
sudo systemctl start dash-
On the source machine: Create a fresh backup
./scripts/backup.sh
-
Transfer the backup to the new server
scp data/backups/dash_backup_*.tar.gz user@newserver:/tmp/ -
On the new server: Deploy and restore
# Clone and deploy git clone <your-repo-url> dash cd dash chmod +x scripts/*.sh ./scripts/deploy.sh # Stop service and restore data sudo systemctl stop dash ./scripts/restore.sh /tmp/dash_backup_*.tar.gz sudo systemctl start dash
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3001 |
DATABASE_URL |
SQLite database path | file:./prisma/dev.db |
JWT_SECRET |
Secret key for JWT tokens | (generate secure random) |
NODE_ENV |
Environment mode | development |
SMTP_HOST |
Email server (optional) | - |
SMTP_PORT |
Email port (optional) | - |
SMTP_USER |
Email username (optional) | - |
SMTP_PASS |
Email password (optional) | - |
SLACK_WEBHOOK_URL |
Slack notifications (optional) | - |
| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Backend API URL | http://localhost:3001 |
# Check logs
journalctl -u dash -n 100
# Check if port is in use
sudo lsof -i :3001
# Try running manually
cd /path/to/dash
node server/dist/index.js# Reset database (WARNING: deletes all data)
cd server
rm prisma/dev.db
npx prisma db push
npx prisma db seedsudo chown -R $USER:$USER /path/to/dash# Find process using port
# Linux:
lsof -i :3001
# Windows:
netstat -ano | findstr :3001
# Kill process (Linux)
kill -9 <PID>
# Kill process (Windows)
taskkill /PID <PID> /F- Detailed deployment scripts documentation: See scripts/README.md
- Database schema: See server/prisma/schema.prisma
- API client configuration: See server/.env.example