How devanshuk3/printr_backend works
Printr is a mobile print-ordering app backed by an Express API. Users authenticate, select and configure a document, obtain server-side pricing, and use vendor/payment information to complete a print order. The app also includes email verification, Google sign-in, vendor administration, and maintenance operations. The print-settings excerpt directly confirms pricing and vendor API calls; route internals and file-storage wiring were not sampled, so those details are represented only where the tree supports a subsystem, without asserting uncertain connections.
Main entry points: index.js API server · auth.js Auth routes · signup.tsx Sign-up · print-preferences.tsx Print settings
Components 21
Mobile app
- Session entry
mobile-app/app/index.tsx - Sign-up
mobile-app/app/(auth)/signup.tsx - Home
mobile-app/app/(main)/home.tsx - Print settings
mobile-app/app/(main)/print-preferences.tsx - File preview
mobile-app/components/modals/FilePreviewModal.tsx - Vendor dashboard
mobile-app/app/(admin)/vendors.tsx - Auth storage
mobile-app/utils/authStorage.ts
Backend API
- API server
backend/index.js - Auth routes
backend/routes/auth.js - Vendor routes
backend/routes/vendors.js - Payment routes
backend/routes/payment.js - Token authentication
backend/middleware/auth.js - Role authorization
backend/middleware/roleAuth.js - Pricing logic
backend/utils/pricing.js - Cleanup jobs
backend/utils/cleanup.js
Data and integrations
- Application database
backend/db.js - Object storage
backend/r2.js - Email delivery
backend/utils/mailer.js
Other components
- Print customer
- Administrator
- Google sign-in
Connections 34
- Print customer → Session entry: opens app
- Session entry → Auth storage: reads session
- Session entry → Auth routes: verifies session
- Session entry → Home: routes authenticated
- Print customer → Sign-up: registers
- Sign-up → Auth routes: submits account
- Sign-up → Auth storage: saves session
- Sign-up → Google sign-in: requests identity
- Sign-up → Home: routes after signup
- Print customer → Print settings: configures print
- Print settings → File preview: previews document
- Print settings → Auth storage: reads token
- Print settings → Payment routes: requests pricing
- Print settings → Vendor routes: verifies vendor
- Administrator → Vendor dashboard: views vendors
- Vendor dashboard → Vendor routes: fetches vendors
- API server → Auth routes: dispatches auth
- API server → Vendor routes: dispatches vendors
- API server → Payment routes: dispatches payments
- API server → Cleanup jobs: starts cleanup
- API server → Application database: checks connection
- Auth routes → Token authentication: protects endpoints
- Auth routes → Application database: queries accounts
- Auth routes → Email delivery: sends verification
- Auth routes → Google sign-in: verifies identity
- Vendor routes → Token authentication: authenticates requests
- Vendor routes → Application database: queries vendors
- Payment routes → Token authentication: authenticates requests
- Payment routes → Pricing logic: calculates price
- Payment routes → Application database: reads payment data
- API server → Token authentication: protects cleanup
- API server → Role authorization: checks admin role
- Cleanup jobs → Object storage: cleans stored files
- Cleanup jobs → Application database: cleans history