How chirag-mukhija/paytmentgateway works
PaytmentGateway is an Express payment API backed by PostgreSQL. A merchant client sends requests to the running server; payment routes authenticate the merchant, then handlers validate and dispatch create, retrieve, or list operations to the payment service. The service reads and writes payment records and creates an initial audit event transactionally. The sampled code shows request logging and centralized error handling as supporting layers. The README describes the project broadly as a backend/database learning project, but gives no additional product capabilities; the graph therefore reflects only evidenced runtime behavior.
Main entry points: app.js Express app · payments.js Payment routes · auth.js Merchant auth · paymentService.js Payment service
Components 11
HTTP runtime
- Server entry
src/index.js - Express app
src/app.js - Request logger
src/middleware/requestLogger.js - Error handler
src/middleware/errorHandler.js
Merchant access
- Payment routes
src/routes/payments.js - Merchant auth
src/middleware/auth.js
Payment operations
- Payment handlers
src/controllers/paymentController.js - Payment service
src/services/paymentService.js
Persistence
- Postgres pool
src/config/db.js - Payment database
db/schema.sql
Other components
- Merchant client
Connections 13
- Merchant client → Server entry: sends requests
- Server entry → Express app: starts
src/index.js - Express app → Request logger: registers
src/app.js - Express app → Payment routes: mounts
src/app.js - Express app → Error handler: registers
src/app.js - Payment routes → Merchant auth: guards routes
src/routes/payments.js - Payment routes → Payment handlers: dispatches
src/routes/payments.js - Merchant auth → Postgres pool: looks up merchant
src/middleware/auth.js - Payment handlers → Payment service: calls operations
src/controllers/paymentController.js - Payment service → Postgres pool: queries
src/services/paymentService.js - Postgres pool → Payment database: connects
src/config/db.js - Merchant auth → Payment database: checks API key
src/middleware/auth.js - Payment service → Payment database: reads and writes
src/services/paymentService.js