How viraljain7/backend works
This is an Express API for merchant onboarding, KYC, product administration and Pine Labs payments. The main workflow is user authentication followed by business, director, document and identity verification steps, with persisted merchant records; administrators review KYC and manage products, while payment endpoints coordinate orders with Pine Labs. The graph reflects explicit app routing and source-index references. Several route/controller and integration details were not excerpted, so unsupported links are omitted.
Main entry points: app.js Express application · User.js User records · Director.js Director records · db.js SQL database
Components 25
API entry
- Express application
src/app.js
Identity and onboarding
- Authentication
src/controllers/Auth/auth.controller.js - Merchant entities
src/controllers/Entities/entities.controller.js - Business information
src/controllers/Onboarding/BusinessInfo/businessInfo.controller.js - Director onboarding
src/controllers/Onboarding/Directors/directors.controller.js - Document and KYC checks
src/controllers/Onboarding/DocKYC/docKYC.controller.js - User documents
src/controllers/Onboarding/DocumentUpload/userDocument.controller.js
Administration
- Admin KYC review
src/controllers/Admin/KYC/adminKYC.controller.js - Product administration
src/controllers/Admin/Product/product.controller.js - Notifications
src/controllers/Admin/Notifications/notification.controller.js - IP administration
src/controllers/Admin/IP/ip.controller.js
Payments
- Payment orders
src/controllers/Payment/PineLabs/Order/pineLabsOrder.controller.js - Payment webhook
src/controllers/Payment/PineLabs/Webhook/pineLabsWebhook.controller.js - Pine Labs service
src/Services/Pinelabs/pinelabs.service.js
Persistence and services
- SQL database
src/config/db.js - User records
src/models/User.js - Director records
src/models/Director.js - User document records
src/models/UserDocument.js - Product records
src/models/Product.js - Notification records
src/models/Notifications.js - Payment order records
src/models/PineLabsOrder.js - Payment records
src/models/PineLabsPayment.js - Object storage helper
src/utils/r2Helper.js - Verification helper
src/utils/verificationHelper.js
Other components
- API client
Connections 48
- API client → Express application: sends requests
- Express application → Authentication: routes auth
src/app.js - Express application → Merchant entities: routes entities
src/app.js - Express application → Business information: routes business info
src/app.js - Express application → Document and KYC checks: routes KYC
src/app.js - Express application → Director onboarding: routes directors
src/app.js - Express application → User documents: routes documents
src/app.js - Express application → Admin KYC review: routes admin KYC
src/app.js - Express application → Product administration: routes products
src/app.js - Express application → Notifications: routes notifications
src/app.js - Express application → IP administration: routes IP admin
src/app.js - Express application → Payment orders: routes payments
src/app.js - Authentication → User records: reads users
src/controllers/Auth/auth.controller.js - Authentication → SQL database: runs transactions
src/controllers/Auth/auth.controller.js - Authentication → User records: resolves identity
src/controllers/Auth/auth.controller.js - Merchant entities → User records: reads and updates
src/controllers/Entities/entities.controller.js - Merchant entities → Director records: uses director records
src/controllers/Entities/entities.controller.js - Merchant entities → Product records: uses product records
src/controllers/Entities/entities.controller.js - Merchant entities → User document records: uses documents
src/controllers/Entities/entities.controller.js - Business information → User records: updates business
src/controllers/Onboarding/BusinessInfo/businessInfo.controller.js - Business information → Director records: uses director records
src/controllers/Onboarding/BusinessInfo/businessInfo.controller.js - Director onboarding → User records: updates user
src/controllers/Onboarding/Directors/directors.controller.js - Director onboarding → Director records: updates directors
src/controllers/Onboarding/Directors/directors.controller.js - Director onboarding → Object storage helper: uploads files
src/controllers/Onboarding/Directors/directors.controller.js - Document and KYC checks → User records: updates KYC
src/controllers/Onboarding/DocKYC/docKYC.controller.js - Document and KYC checks → Director records: uses director records
src/controllers/Onboarding/DocKYC/docKYC.controller.js - Document and KYC checks → Object storage helper: uploads evidence
src/controllers/Onboarding/DocKYC/docKYC.controller.js - Document and KYC checks → Verification helper: checks identity
src/controllers/Onboarding/DocKYC/docKYC.controller.js - User documents → User records: resolves user
src/controllers/Onboarding/DocumentUpload/userDocument.controller.js - User documents → User document records: manages documents
src/controllers/Onboarding/DocumentUpload/userDocument.controller.js - User documents → Object storage helper: uploads files
src/controllers/Onboarding/DocumentUpload/userDocument.controller.js - Admin KYC review → User records: reviews user
src/controllers/Admin/KYC/adminKYC.controller.js - Admin KYC review → Director records: reviews directors
src/controllers/Admin/KYC/adminKYC.controller.js - Product administration → User records: looks up users
src/controllers/Admin/Product/product.controller.js - Product administration → Product records: manages products
src/controllers/Admin/Product/product.controller.js - Notifications → Notification records: manages notices
src/controllers/Admin/Notifications/notification.controller.js - Notifications → User records: looks up users
src/controllers/Admin/Notifications/notification.controller.js - IP administration → User records: looks up users
src/controllers/Admin/IP/ip.controller.js - Payment orders → Payment order records: manages orders
src/controllers/Payment/PineLabs/Order/pineLabsOrder.controller.js - Payment orders → Payment records: manages payments
src/controllers/Payment/PineLabs/Order/pineLabsOrder.controller.js - Payment orders → Pine Labs service: calls service
src/controllers/Payment/PineLabs/Order/pineLabsOrder.controller.js - Payment webhook → Payment order records: updates orders
src/controllers/Payment/PineLabs/Webhook/pineLabsWebhook.controller.js - Payment webhook → Payment records: updates payments
src/controllers/Payment/PineLabs/Webhook/pineLabsWebhook.controller.js - User records → SQL database: uses connection
src/models/User.js - Director records → SQL database: uses connection
src/models/Director.js - User document records → SQL database: uses connection
src/models/UserDocument.js - Product records → SQL database: uses connection
src/models/Product.js - Notification records → SQL database: uses connection
src/models/Notifications.js