Skip to main content

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/ # Utility functions
│ │ └── 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, pdf_utils
│ │ ├── config/ # App configuration
│ │ ├── utils/ # Utility functions
│ │ └── models/ # Data models
│ ├── scripts/ # Windows printing setup
│ │ ├── setup_sumatra.ps1 # SumatraPDF download
│ │ └── setup_libreoffice.ps1 # LibreOffice portable (Word/PPT→PDF)
│ ├── windows/ # Windows platform files
│ ├── build_windows.bat # Clean build + SumatraPDF + optional LibreOffice
│ └── 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 point
  • cmd/create_admin/: Admin user creation utility
  • cmd/fix_file_paths/: File path repair utility
  • cmd/fix_schema/: Database schema fix utility
  • internal/admin/: Admin-specific handlers and middleware
  • internal/auth/: JWT authentication and middleware
  • internal/csrf/: CSRF token generation and validation
  • internal/database/: Database connection and schema initialization
  • internal/email/: Email service implementation (Resend/SMTP)
  • internal/handlers/: HTTP request handlers for all endpoints
  • internal/middleware/: HTTP middleware (body limit, etc.)
  • internal/models/: Data models and request/response structures
  • internal/payment/: Razorpay payment gateway integration
  • internal/ratelimit/: Rate limiting middleware
  • internal/secureheaders/: Security headers middleware
  • internal/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 processing, etc.)
  • migrations/: SQL migration files for database schema changes

Frontend (frontend/)

  • app/: Next.js 14 App Router pages
  • components/: Reusable React components
  • lib/: 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 customers
  • shopkeeper_app/: Flutter app for shopkeepers
    • lib/services/converter_engine.dart: File type→PDF conversion (PDF passthrough, image→PDF, Word/PPT→PDF via LibreOffice)
    • 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.ps1 for Windows printing dependencies
    • build_windows.bat: One-shot setup + clean build for Windows (SumatraPDF, optional LibreOffice, then flutter run)
  • Both follow standard Flutter project structure