QRepair is a complete system for managing device maintenance through QR Codes. Ideal for technical assistance companies, maintenance providers, and service providers who want to digitize and simplify maintenance intervention tracking.
🎭 Try the Demo: demo-qrepair.ballarini.app (login:
demo/demo)
- 🔐 Authentication System - Secure login with user and session management
- 📱 QR Code Generation - Create unique QR codes for each device
- 📊 Complete Dashboard - View, search, and manage all maintenances
- 🌍 Multilingual - Support for Italian, English, and German
- 📅 Due Date Management - Automatic expiration date monitoring
- 💬 WhatsApp Integration - Direct messaging to customers
- 📥 Export/Import - Export to CSV and JSON
- 👥 User Management - Complete access administration
- 🔄 Persistent Database - Automatic saving on SQLite
Prerequisites:
- Docker and Docker Compose installed
- Available port 5126
Quick Start:
# Clone the repository
git clone https://github.com/Gheben/QRepair.git
cd QRepair
# Create necessary directories and files
mkdir -p /volume1/docker/QRepair/data
mkdir -p /volume1/docker/QRepair/uploads
touch /volume1/docker/QRepair/manutenzioni.db
touch /volume1/docker/QRepair/settings.json
# Start with Docker Compose
docker-compose up -d
# Check status
docker ps
# View logs
docker logs qrepair📁 Note: If you're not using Synology NAS, adjust the volume paths in
docker-compose.ymlto match your system (e.g.,./datafor relative paths or/opt/QRepair/datafor absolute paths).
Access the application at http://localhost:5126
Docker Compose Configuration:
The docker-compose.yml file includes:
- Automatic container restart
- Port mapping (5126:5126)
- Persistent volumes for database, settings, and uploads
- Production environment
Stop the application:
docker-compose downUpdate the application:
git pull
docker-compose down
docker-compose up -d --buildEnable Demo Mode:
To run QRepair in demo mode, uncomment the DEMO_MODE environment variable in your docker-compose.yml:
environment:
- NODE_ENV=production
- PORT=5126
- DEMO_MODE=true # Uncomment this line to enable demo modeThen restart the container:
docker-compose down
docker-compose up -dDemo Mode Features:
- Creates a demo user with credentials:
demo/demo - Demo user is created automatically only if the database is empty
- User management is completely disabled:
- Cannot create new users
- Cannot edit existing users
- Cannot delete users
- Cannot change passwords
- All other features (QR codes, maintenance, customers) work normally
- Perfect for public demonstrations or testing without data modification risks
Prerequisites:
- Node.js (v14 or higher) - Download
- npm (included with Node.js)
- Modern browser (Chrome, Firefox, Edge, Safari)
Installation Steps:
-
Clone the repository
git clone https://github.com/Gheben/QRepair.git cd QRepair -
Install dependencies
npm install
-
Start the server
npm start
-
Open your browser
http://localhost:5126/login
On first startup, the system automatically creates an administrator user:
- Username:
admin - Password:
admin
⚠️ IMPORTANT: Change the password immediately after first login!
When DEMO_MODE=true is set, the system creates a demo user:
- Username:
demo - Password:
demo
🎭 NOTE: In demo mode, user management is disabled. Password and user settings cannot be modified.
Main view with statistics, search, and maintenance management
Form for creating new QR codes for devices
Complete customer management with address book and maintenance history
Public page displayed to customers when scanning the QR code
Configuration of company data, logo, and contacts
- Open
http://localhost:5126/login - Enter your credentials
- Click "Login"
Before creating QR codes, configure your company data:
- Go to
http://localhost:5126/settings - Enter:
- Company Name (e.g., "GB Service")
- Phone Number (e.g., "+39 333 1234567")
- Public Base URL (optional, e.g., "https://yourdomain.com") - see note below
- Company Logo (optional, max 5MB, PNG format recommended for transparency)
- Click "💾 Save Settings"
📌 Base URL Configuration:
If you access the system via different URLs (e.g., local IP, domain name), configure the Public Base URL to ensure QR codes always point to your public domain.
- Example: If you access via
192.168.1.100:5126locally but want QR codes to point tohttps://myservice.com, enterhttps://myservice.comas Base URL.- Update existing QR codes: After changing the Base URL, use the "🔄 UPDATE ALL QR CODES URLs" button to update all existing QR codes with the new URL.
- Go to
http://localhost:5126(creation page) - Fill in the form:
- Customer Name (required)
- Customer Phone (required)
- Device Model (e.g., "iPhone 13")
- Serial Number (S/N) (e.g., "ABC123456")
- Maintenance Date (required)
- Due Date (for warranty/next service)
- Language (IT/EN/DE)
- Click "🎨 Generate QR Code"
- The QR code is generated and automatically saved
- Download the QR code as PNG
Access the dashboard at http://localhost:5126/dashboard:
- 📊 Statistics: Total records, monthly maintenances, unique customers
- 🔍 Search: Search by name, phone, model, or serial number
- 👁️ View QR: Display and print the QR code for each record
- ✏️ Edit: Update maintenance data
- 🔄 Update Maintenance: Record new maintenances for the same device
- 🗑️ Delete: Remove individual records
- 📥 Export CSV/JSON: Export all data
- 📤 Import: Import data from JSON file
- 🗑️ Delete All: Remove all records (requires confirmation)
When a customer scans the QR code, they automatically access http://localhost:5126/info?id=XXX:
Information Displayed:
- 🏢 Company Name and Logo
- 📞 Company Phone
- 👤 Customer Name
- 📱 Customer Phone (with direct call button)
- 🔧 Device Model
- 🔢 Serial Number
- 📅 Last Maintenance Date
- ⏰ Due Date (with color indicator)
- 💬 "Send WhatsApp Message" button
Due Date Indicators:
- 🟢 Green: Future due date
- 🟡 Yellow: Due date is today
- 🔴 Red: Past due date
Access http://localhost:5126/users from the Dashboard:
- ➕ Create New User: Username, Password, Full name
- ✏️ Edit User: Update data (leave password blank to keep it unchanged)
- 🗑️ Delete User: Remove user (minimum 1 user required)
💡 Note: You cannot delete the last user in the system
Click "🚪 Logout" in the Dashboard to safely exit.
QRepair/
├── server.js # Main Express server
├── database.js # SQLite database management
├── db.js # Database wrapper (legacy)
├── api-client.js # API client for frontend
├── package.json # Node.js dependencies
├── settings.json # Company settings (auto-generated)
├── manutenzioni.db # SQLite database (auto-generated)
│
├── login.html # Login page
├── index.html # QR Code generation
├── dashboard.html # Management dashboard
├── info.html # Public QR Code page
├── settings.html # Company configuration
├── users.html # User management
│
└── style.css # Global styles
- Node.js - JavaScript runtime
- Express - Web framework
- sql.js - In-memory SQLite database
- bcrypt - Password hashing
- express-session - Session management
- CORS - Cross-Origin Resource Sharing
- HTML5 - Structure
- CSS3 - Styles and animations
- Vanilla JavaScript - Application logic
- QRCode.js - QR Code generation
- Flag Icons - Flags for language selection
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/check- Verify authentication
GET /api/manutenzioni- List all maintenancesGET /api/manutenzioni/:id- Maintenance details (public)POST /api/manutenzioni- Create new maintenancePUT /api/manutenzioni/:id- Update maintenancePUT /api/manutenzioni/:id/data- Update only date/due dateDELETE /api/manutenzioni/:id- Delete maintenanceDELETE /api/manutenzioni- Delete all maintenances
GET /api/search/:query- Search maintenancesGET /api/stats- Dashboard statisticsGET /api/count- Count records
GET /api/export- Export all dataPOST /api/import- Import data from JSON
GET /api/settings- Get settings (public)POST /api/settings- Save settings (protected)
GET /api/users- List usersPOST /api/users- Create userPUT /api/users/:id- Update userDELETE /api/users/:id- Delete user
- ✅ Password Hash: Bcrypt with salt rounds = 10
- ✅ HTTP-Only Sessions: XSS-protected cookies
- ✅ Input Validation: Server-side data validation
- ✅ SQL Injection Protection: Prepared statements
- ✅ CORS: Configured for secure requests
- ✅ Required Authentication: All critical operations protected
- ✅ Last User Protection: Cannot be deleted
For Synology NAS or VPS:
-
Install Container Manager (Synology) or Docker on your server
-
Clone and deploy:
# SSH into your server ssh [email protected] # Navigate to your docker folder cd /volume1/docker # Synology # or cd /opt/docker # Linux VPS # Clone the repository git clone https://github.com/Gheben/QRepair.git cd QRepair # Create required directories and files mkdir -p data uploads touch manutenzioni.db settings.json # Start with Docker Compose docker-compose up -d
Note for Synology NAS: The entrypoint script automatically creates directories inside the container, but Docker bind mounts require the host directories to exist first. The commands above create them before starting the container.
-
Configure reverse proxy (optional but recommended)
- Synology: Control Panel → Login Portal → Advanced → Reverse Proxy
- NGINX: See configuration below
Environment Variables for Production:
Edit docker-compose.yml to add:
environment:
- NODE_ENV=production
- PORT=5126
- SESSION_SECRET=your-very-secure-random-secret-keyServer Configuration:
-
Change port (optional) in
server.js:const PORT = process.env.PORT || 5126;
-
Change session secret in
server.js:secret: process.env.SESSION_SECRET || 'YOUR_SECURE_SECRET_KEY'
-
Configure HTTPS (recommended for production)
-
Use reverse proxy (NGINX, Apache) to expose the server
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:5126;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Create /etc/systemd/system/qrepair.service:
[Unit]
Description=QRepair Service
After=network.target
[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/QRepair
ExecStart=/usr/bin/node server.js
Restart=on-failure
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable qrepair
sudo systemctl start qrepair# Check if port 5126 is free
netstat -ano | findstr :5126
# Terminate process on port 5126 (Windows)
taskkill /F /PID <PID>
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install# Delete the database (WARNING: you'll lose all data!)
rm manutenzioni.db
# Restart the server (recreates empty database)
npm start- Verify credentials are correct
- Check browser cookies (delete localhost:5126 cookies)
- Verify express-session is installed:
npm list express-session
- Check JavaScript console in browser (F12)
- Verify QRCode.js loads correctly
- Check server connection
# Export all data from Dashboard (📥 Export JSON)
# Or copy files:
cp manutenzioni.db manutenzioni.db.backup
cp settings.json settings.json.backup# Restore backup files
cp manutenzioni.db.backup manutenzioni.db
cp settings.json.backup settings.json# Add to crontab (crontab -e)
0 2 * * * cp /path/to/QRepair/manutenzioni.db /backup/manutenzioni_$(date +\%Y\%m\%d).db- ✅ Complete authentication system
- ✅ User management
- ✅ QR Code generation
- ✅ Dashboard with statistics
- ✅ Multilingual support (IT/EN/DE)
- ✅ WhatsApp integration
- ✅ CSV and JSON export/import
- ✅ Serial Number (S/N) field
- ✅ Clean URLs without .html extension
- ✅ Persistent SQLite database
- ✅ Due date management with color indicators
- ✅ Responsive design
Contributions are welcome! Please:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is released under the MIT License.
Guido Ballarini
- 💼 LinkedIn: Guido Ballarini
- ☕ Buy Me a Coffee: guidoballau
If you find this project useful, consider buying me a coffee! ☕
⭐ If you like the project, leave a star on GitHub! ⭐
Made with ❤️ by Guido Ballarini - © 2026
