Project Structure
Qprint_antiGravity/
├── backend/ # Go backend API
│ ├── cmd/
│ │ ├── api/ # Main API server
│ │ ├── create_admin/ # Admin user creation utility
│ │ ├── check_users/ # User management utility
│ │ ├── fix_file_paths/ # File path repair utility
│ │ └── fix_schema/ # Schema fix utility
│ ├── internal/
│ │ ├── admin/ # Admin handlers & middleware
│ │ ├── auth/ # JWT authentication
│ │ ├── csrf/ # CSRF protection
│ │ ├── database/ # DB connection & schema
│ │ ├── email/ # Email service (Resend/SMTP)
│ │ ├── handlers/ # HTTP request handlers
│ │ ├── middleware/ # HTTP middleware (body limit)
│ │ ├── models/ # Data models
│ │ ├── payment/ # Razorpay integration
│ │ ├── ratelimit/ # Rate limiting
│ │ ├── secureheaders/ # Security headers
│ │ ├── shopstatus/ # Shop auto-close sweeper (heartbeat + web activity)
│ │ ├── storage/ # File storage (Local/S3)
│ │ └── utils/ # Utility functions
│ ├── migrations/ # SQL migration files
│ ├── scripts/ # Database scripts
│ ├── go.mod # Go dependencies
│ └── .env # Environment variables (not in git)
│
├── frontend/ # Next.js web frontend
│ ├── app/ # Next.js app directory
│ │ ├── admin/ # Admin dashboard (users, orders, payouts, payments, downloads)
│ │ ├── contact/ # Contact page
│ │ ├── customer/ # Customer dashboard & wallet
│ │ ├── delete-data/ # GDPR "Delete data" page (Play Store requirement)
│ │ ├── download-apps/ # Public app download links page
│ │ ├── forgot-password/ # Password recovery
│ │ ├── forgot-username/ # Username recovery
│ │ ├── login/ # Authentication pages
│ │ ├── privacy/ # Privacy policy
│ │ ├── register/ # Registration pages
│ │ ├── reset-password/ # Password reset
│ │ ├── refund-policy/ # Refund policy
│ │ ├── shipping-policy/ # Shipping policy
│ │ ├── shopkeeper/ # Shopkeeper dashboard
│ │ └── terms/ # Terms of service
│ ├── components/ # React components
│ ├── lib/ # Utilities & API client
│ ├── android/ # Capacitor Android wrapper
│ └── package.json
│
├── admin_frontend/ # Separate admin panel (port 3001)
│ ├── app/ # Admin pages (dashboard, users, orders, payouts, payments, downloads)
│ ├── lib/ # API client (includes getAppDownloads, updateAppDownloads)
│ └── package.json
│
├── customer_app/ # Flutter customer app
│ ├── lib/
│ │ ├── screens/ # App screens
│ │ │ └── widgets/ # Reusable widgets
│ │ ├── services/ # API & location services
│ │ ├── config/ # App configuration
│ │ ├── utils/ # safe_error, referral_sanitizer, etc.
│ │ └── theme/ # App theming
│ ├── scripts/ # Certificate update scripts
│ ├── android/ # Android platform files
│ ├── ios/ # iOS platform files
│ └── pubspec.yaml
│
├── shopkeeper_app/ # Flutter shopkeeper app (Windows)
│ ├── lib/
│ │ ├── screens/ # App screens
│ │ ├── services/ # API, printer, converter_engine, preconvert_cache, pdf_utils
│ │ ├── config/ # App configuration
│ │ ├── utils/ # Utility functions
│ │ └── models/ # Data models
│ ├── scripts/ # Windows printing & installer
│ │ ├── setup_sumatra.ps1 # SumatraPDF download
│ │ ├── setup_libreoffice.ps1 # LibreOffice portable (Word/PPT→PDF)
│ │ ├── patch_and_repack_msix.ps1 # White logo, desktop shortcut, repack MSIX
│ │ └── create_signing_cert.ps1 # Qprint.pfx for Publisher: Qprint
│ ├── windows/ # Windows platform files (+ Qprint.pfx when built)
│ ├── build_windows.bat # Clean build + SumatraPDF + optional LibreOffice
│ ├── build_installer.bat # MSIX create + patch + optional Inno Setup
│ ├── installer_script.iss # Inno Setup: install dir choice, desktop shortcut option
│ ├── WINDOWS_INSTALLER.md # Installer build and configuration
│ └── pubspec.yaml
│
├── project-docs/ # Docusaurus documentation
│ └── docs/ # Markdown documentation files
│
├── manage.bat / manage.sh / manage.py # Management scripts
└── README.md # Project documentation
Directory Descriptions
Backend (backend/)
cmd/api/: Main application entry pointcmd/create_admin/: Admin user creation utilitycmd/fix_file_paths/: File path repair utilitycmd/fix_schema/: Database schema fix utilityinternal/admin/: Admin-specific handlers and middlewareinternal/auth/: JWT authentication and middlewareinternal/csrf/: CSRF token generation and validationinternal/database/: Database connection and schema initializationinternal/email/: Email service implementation (Resend/SMTP)internal/handlers/: HTTP request handlers for all endpointsinternal/middleware/: HTTP middleware (body limit, etc.)internal/models/: Data models and request/response structuresinternal/payment/: Razorpay payment gateway integrationinternal/ratelimit/: Rate limiting middlewareinternal/secureheaders/: Security headers middlewareinternal/shopstatus/: Shop auto-close sweeper (periodically closes shops when app heartbeat and web activity are stale)internal/storage/: File storage abstraction (Local/S3)internal/utils/: Utility functions: PDF page count (pdf.go), Office page/slide count (office.go: CountPPTXSlides, CountDOCXPages, CountDOCPages, CountPPTSlides; returns error when count unavailable so API can respond with "convert to PDF and upload")migrations/: SQL migration files for database schema changes
Frontend (frontend/)
app/: Next.js 14 App Router pagescomponents/: Reusable React componentslib/: Utility functions and API client
Admin Frontend (admin_frontend/)
- Separate Next.js application for admin panel
- Runs on port 3001
- Similar structure to main frontend
Mobile Apps
customer_app/: Flutter app for customersshopkeeper_app/: Flutter app for shopkeeperslib/services/converter_engine.dart: File type→PDF conversion (PDF passthrough, image→PDF, Word/PPT→PDF via LibreOffice; on Windows runs LibreOffice via cmd.exe withcd /d outdir && soffice ...)lib/services/preconvert_cache.dart: Per-file pre-convert cache (download + convert in background when queue loads; at print use cache or wait/on-demand; delete local files after print)lib/services/pdf_utils.dart: PDF merge, front page, etc.lib/services/printer_service.dart: Platform-specific printing (Windows: SumatraPDF CLI)scripts/:setup_sumatra.ps1,setup_libreoffice.ps1for Windows printing dependenciesbuild_windows.bat: One-shot setup + clean build for Windows (SumatraPDF, optional LibreOffice, thenflutter run)build_installer.bat: Creates signing cert (if missing), runsmsix:create, then patches MSIX (white logo, desktop shortcut, Publisher Qprint) and optionally builds Inno Setup .exe (install dir + desktop shortcut checkbox). See Windows Installer.installer_script.iss: Inno Setup script for classic installer; default dir Program Files, optional "Create desktop shortcut" task.
- Customer app
lib/utils/:safe_error.dart(user-safe error messages),referral_sanitizer.dart(sanitize referral codes from deep links/input). - Both follow standard Flutter project structure