Skip to main content

Setup Instructions

Prerequisites

  1. Go 1.21+ - https://golang.org/dl/
  2. Node.js 18+ and npm - https://nodejs.org/
  3. PostgreSQL 12+ - https://www.postgresql.org/download/
  4. 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):

  1. Run build_windows.bat from shopkeeper_app. It:

    • Runs scripts/setup_sumatra.ps1 (or skips if SumatraPDF.exe exists in windows/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
  2. SumatraPDF is required; the script exits with instructions if not found. LibreOffice is optional (for Word/PPT conversion).

  3. 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:

  1. Backend: http://localhost:8080 - Should show welcome message
  2. Frontend: http://localhost:3000 - Should show login page
  3. Admin Frontend: http://localhost:3001 - Should show admin login
  4. Shopkeeper Windows: Use build_windows.bat in shopkeeper_app; ensure windows/runner/bin/SumatraPDF.exe exists for printing. See Windows Printing.

Troubleshooting

Backend won't start

  • Check PostgreSQL is running
  • Verify DATABASE_URL in .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.