Setup Instructions
Prerequisites
- Go 1.21+ - https://golang.org/dl/
- Node.js 18+ and npm - https://nodejs.org/
- PostgreSQL 12+ - https://www.postgresql.org/download/
- Flutter 3.10+ (for mobile apps) - https://flutter.dev/
Step 1: Clone and Navigate
cd Qprint
Step 2: Database Setup
# Create database
psql -U postgres -c "CREATE DATABASE filesharing;"
# Or using your user
psql -U xerox -d postgres -c "CREATE DATABASE filesharing;"
Step 3: Backend Setup
cd backend
# Install Go dependencies
go mod download
# Create .env file (see Environment Variables section)
# Create manually based on the Environment Variables documentation
# Run backend
go run cmd/api/main.go
Expected Output:
Loaded and OVERRODE env vars from current directory
Connected to PostgreSQL database
Server running on port 8080
Step 4: Frontend Setup
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev
Expected Output:
ready - started server on 0.0.0.0:3000
Step 5: Admin Frontend Setup
cd admin_frontend
# Install dependencies
npm install
# Run development server (runs on port 3001)
npm run dev
Step 6: Mobile Apps Setup
Customer App
cd customer_app
# Install dependencies
flutter pub get
# Run on device/emulator
flutter run
Shopkeeper App
cd shopkeeper_app
# Install dependencies
flutter pub get
# Run on device/emulator
flutter run
Shopkeeper App (Windows, with printing)
For Windows builds with silent printing (SumatraPDF + optional LibreOffice):
-
Run
build_windows.batfromshopkeeper_app. It:- Runs
scripts/setup_sumatra.ps1(or skips ifSumatraPDF.exeexists inwindows/runner/bin/) - Optionally runs
scripts/setup_libreoffice.ps1(or skips if LibreOffice is already present) - Runs
flutter clean,flutter pub get,flutter run -d windows --release
- Runs
-
SumatraPDF is required; the script exits with instructions if not found. LibreOffice is optional (for Word/PPT conversion).
-
See Windows Printing for manual setup, troubleshooting, and supported file types.
Quick Start (Using Management Scripts)
Windows
manage.bat start
Linux/Mac
./manage.sh start
Python (Cross-platform)
python manage.py start
Verification
After starting all services, verify:
- Backend: http://localhost:8080 - Should show welcome message
- Frontend: http://localhost:3000 - Should show login page
- Admin Frontend: http://localhost:3001 - Should show admin login
- Shopkeeper Windows: Use
build_windows.batinshopkeeper_app; ensurewindows/runner/bin/SumatraPDF.exeexists for printing. See Windows Printing.
Troubleshooting
Backend won't start
- Check PostgreSQL is running
- Verify
DATABASE_URLin.env - Check port 8080 is available
Frontend won't start
- Check Node.js version (18+)
- Delete
node_modules/and reinstall - Check port 3000 is available
Database connection failed
- Verify database exists
- Check connection string format
- Verify PostgreSQL is running
See Troubleshooting Guide for more help. de](../troubleshooting) for more help.