PayLab ships as 2 products, 2 codebases
Case file № 01 / 03Fintech & Blockchain
PayLab Merchant
Enterprise Bitcoin Payment Gateway System
A comprehensive, self-hosted Bitcoin payment processing platform designed for merchants to accept cryptocurrency payments with complete control and privacy. Built with modern enterprise architecture and containerized deployment.
- bitcoin
- invoicing
- payouts

- AIndustry
- Fintech & Blockchain
- BProduct
- Self-hosted payment gateway
- CCurrency
- Bitcoin (BTC)
- DDeployment
- Docker containers
- ASP.NET Core 8.0Backend
- PostgreSQLDatabase
- DockerDevOps
- Entity Framework CoreORM
- Bitcoin Core IntegrationBlockchain
- RESTful APIsArchitecture
- Razor PagesFrontend
- Bootstrap 5UI Framework
- NBitcoin LibraryCryptography
- WebSocketsReal-time
- ASP.NET Core 8.0Backend
- PostgreSQLDatabase
- DockerDevOps
- Entity Framework CoreORM
- Bitcoin Core IntegrationBlockchain
- RESTful APIsArchitecture
- Razor PagesFrontend
- Bootstrap 5UI Framework
- NBitcoin LibraryCryptography
- WebSocketsReal-time
§ 01 — Technology stack
Built with the right tools, not the trendy ones.
10 components, each picked for the job it does in PayLab Merchant, and nothing added for the sake of a buzzword.
10
Components
12
Features
codelab@paylab/merchant $ codelab inspect --stack
Resolving 10 components…
- ASP.NET Core 8.0Backend
- PostgreSQLDatabase
- DockerDevOps
- Entity Framework CoreORM
- Bitcoin Core IntegrationBlockchain
- RESTful APIsArchitecture
- Razor PagesFrontend
- Bootstrap 5UI Framework
- NBitcoin LibraryCryptography
- WebSocketsReal-time
✔ Build ready · 10 components resolved
$
§ 02 — Key features
What PayLab Merchant does
12capabilities
shipped
- 01
Comprehensive Dashboard
Real-time monitoring of transactions, revenue analytics, and payment status tracking with intuitive data visualization.
- 02
Store Settings
Flexible configuration for multiple stores with customizable payment methods, currencies, and business rules.
- 03
Dynamic Rate Management
Automated exchange rate updates with support for multiple fiat currencies and customizable rate sources.
- 04
Checkout Experience
Seamless payment flow with customizable branding, QR code generation, and mobile-optimized interfaces.
- 05
Store Users & Permissions
Role-based access control with granular permissions for team collaboration and secure multi-user management.
- 06
Email Rules & Notifications
Automated email notifications for payment confirmations, refunds, and custom business triggers.
- 07
BTC Wallet Management
Secure HD wallet implementation with full custody control, backup mechanisms, and multi-signature support.
- 08
Send & Receive BTC
Integrated wallet functionality for direct Bitcoin transactions with fee estimation and batch processing.
- 09
Invoice System
Comprehensive invoicing with expiration management, partial payments, and automatic settlement tracking.
- 10
Advanced Reporting
Detailed financial reports, transaction history exports, and customizable analytics dashboards.
- 11
Payment Requests
Create sharable payment links with customizable amounts, descriptions, and expiration dates.
- 12
Documentation Portal
Comprehensive API documentation and merchant guides for seamless integration and troubleshooting.
§ 03 — Technical highlights
How PayLab Merchant is engineered
Scroll down the pipeline, layer by layer.
Layer 01
Containerized Architecture
Fully Dockerized application ensuring consistent deployment across environments with docker-compose orchestration for seamless scaling and maintenance.
Layer 02
PostgreSQL Data Layer
Robust relational database design with optimized indexing, transaction integrity, and efficient query performance for high-volume payment processing.
Layer 03
Bitcoin Core Integration
Direct integration with Bitcoin network using NBitcoin library for wallet management, transaction signing, and blockchain synchronization.
Layer 04
RESTful API Design
Well-documented APIs following REST principles with authentication, rate limiting, and comprehensive error handling for third-party integrations.
Layer 05
Real-time Updates
WebSocket implementation for instant payment status notifications and live transaction monitoring without page refreshes.
Layer 06
Security First
Industry-standard encryption, secure key storage, HTTPS enforcement, and protection against common vulnerabilities (XSS, CSRF, SQL injection).
§ 04 — Product tour
Inside PayLab Merchant
Pick a screen, swipe, or use the arrow keys. Click a screen to see it full size.
Merchant Dashboard. Wallet balance, balance history, recent transactions and invoice status in one view.
Case file № 01 / 03Fintech & Blockchain
PayLab Admin
Admin Platform, Merchant Onboarding & Hosted Checkout
The operator side of the gateway: a production-grade, multi-service platform that runs merchant onboarding and staff review, store and wallet administration, hosted checkout and webhook-driven order tracking. Seven apps in a Turborepo monorepo talk over gRPC and RabbitMQ, each service owns its own PostgreSQL database, and the whole stack ships as Docker containers.
- bitcoin
- invoicing
- payouts

- AArchitecture
- 7 apps · 4 shared packages
- BTransport
- gRPC + RabbitMQ
- CData
- PostgreSQL per service
- DLanguages
- English & Japanese
- Next.js 16Frontend ×2
- NestJSGateway & services
- gRPCService calls
- RabbitMQEvents
- PostgreSQL + PrismaDB per service
- ZodShared validation
- BTCPay GreenfieldPayments
- MinIOFile storage
- HubSpot APICRM & tickets
- Handlebars + SlackEmail & alerts
- Turborepo + pnpmMonorepo
- Docker · GitHub ActionsDeploy & CI
- shadcn/ui + Tailwind v4UI
- JestTesting
§ 01 — Technology stack
Built with the right tools, not the trendy ones.
14 components, each picked for the job it does in PayLab Admin, and nothing added for the sake of a buzzword.
14
Components
14
Features
codelab@paylab/admin $ codelab inspect --stack
Resolving 14 components…
- Next.js 16Frontend ×2
- NestJSGateway & services
- gRPCService calls
- RabbitMQEvents
- PostgreSQL + PrismaDB per service
- ZodShared validation
- BTCPay GreenfieldPayments
- MinIOFile storage
- HubSpot APICRM & tickets
- Handlebars + SlackEmail & alerts
- Turborepo + pnpmMonorepo
- Docker · GitHub ActionsDeploy & CI
- shadcn/ui + Tailwind v4UI
- JestTesting
✔ Build ready · 14 components resolved
$
§ 02 — System map
Seven apps, two wires.
Synchronous calls go over typed gRPC; everything that can happen later rides RabbitMQ. Each service keeps its own database, and the checkout runs on its own so a busy storefront never touches the admin path.
- Apps
- 7
- Shared packages
- 4
- Transitions tested
- 81
- gRPC — typed request / response
- RabbitMQ — fire-and-forget events
- Own PostgreSQL database
Clients
Admin Panel
Next.js 16
Staff console for merchants, stores, requests, invoices and wallets.
Onboarding Portal
Next.js 16
Registration, tiered verification, plans and support forms.
Checkout Widget
Embedded JS
Runs on each merchant's own storefront.
- merchant site
Edge
API Gateway
NestJS + Fastify
Single entry point: JWT and API-key auth, routes calls, publishes events.
- gRPC
- RabbitMQ
Checkout Service
NestJS · standalone
Multi-tenant hosted checkout, just-in-time invoices, signed webhooks.
- ↗ BTCPay
- standalone
Services
User Service
gRPC
Users, merchants, plans, permissions and 2FA.
- gRPC
Request Service
gRPC + RabbitMQ
Onboarding pipeline, tiered verification, scheduled jobs.
- gRPC
- RabbitMQ
- ↗ HubSpot
- ↗ MinIO
Notification Service
RabbitMQ consumer
Templated EN/JA email and Slack alerts.
- RabbitMQ
- ↗ Slack
Turborepo + pnpm · shared packages
@repo/grpcProto contracts & typed clients@repo/validationZod schemas for every app@repo/nestGeneric Prisma CRUD baseconfigsShared ESLint & TypeScript
§ 03 — Key features
What PayLab Admin does
14capabilities
shipped
- 01
Tiered Merchant Onboarding
Tier 0 quick registration with a duplicate-email check, Tier 1 business application by invitation, Tier 2 documents with a deadline and an approve, reject or hold decision by staff.
- 02
Guarded Request Lifecycle
Every onboarding status change goes through an explicit transition table. Requests can be archived and restored, and resubmissions are only accepted from a valid state.
- 03
Hosted Checkout Widget
Merchants configure a checkout and embed a JavaScript widget on their own storefront. A click creates a BTCPay invoice just in time and returns the checkout link.
- 04
Signed, Deduplicated Webhooks
Each store gets its own webhook secret. Every delivery is HMAC-verified, and duplicates are caught by delivery ID in the same transaction as the order update.
- 05
Strict Tenant Isolation
A guard refuses any query not scoped to a store. Redirect URLs come from a server-side whitelist, and public endpoints are rate-limited per IP.
- 06
Two-Way HubSpot Sync
Onboarding requests and support tickets sync both ways. Incoming webhooks are checked with signature v3 and a 5-minute replay window, and resolved tickets update the request.
- 07
Routed Support Desk
Support and contact forms send inquiries into separate General, Sales, Technical and Marketing pipelines.
- 08
Merchant & Store Administration
Merchant CRUD with plans and permissions, store creation, store users, domain settings and store API keys with plugin and payment permissions.
- 09
Safe Exchange-Rate Setup
Price source, spread and currency pairs per store. On save the gateway reads the current settings first, so it never overwrites values the admin didn't see.
- 10
Invoices & Pull Payments
Search and filter invoices across stores, and review pull payments from one console.
- 11
Billing & Subscriptions
Subscription plans with trial and grace periods, manual credits and charges, and cron-driven emails when a trial or grace period ends.
- 12
Read-Only Treasury Wallet
The billing wallet's balance and paginated transactions, reached with a separate, limited billing key.
- 13
Event-Driven Notifications
RabbitMQ events render Handlebars emails in English and Japanese inside one branded layout, and real-time team alerts go to Slack.
- 14
Hardened Authentication
JWT with refresh, TOTP 2FA that only activates after a confirmed code, bcrypt-hashed service keys, and uploads typed by their first bytes rather than the extension.
§ 04 — Technical highlights
How PayLab Admin is engineered
Scroll down the pipeline, layer by layer.
Layer 01
gRPC Migration
Request/response traffic moved from RabbitMQ to gRPC with typed .proto contracts, leaving RabbitMQ for fire-and-forget events. Known shapes get strict proto fields; genuinely dynamic data travels in JSON envelopes.
Layer 02
Hybrid Transport Microservices
One service serves gRPC and RabbitMQ at once, with NestJS connectMicroservice() per transport. Event-only consumers still expose an HTTP health endpoint for container checks.
Layer 03
Correctness by State Machine
Order and onboarding status follow explicit transition tables, not "whatever the last event said". The checkout table is tested on all 81 event/state combinations, generated from the spec's acceptance tables.
Layer 04
Idempotent, Race-Safe Webhooks
A unique delivery ledger is written in the same transaction as the order update. A unique-key conflict means a duplicate; a failed update rolls the whole thing back.
Layer 05
Database per Service
Each service owns its PostgreSQL database and Prisma client, and production containers run their migrations on start.
Layer 06
End-to-End Type Safety
One shared Zod package validates browser forms, gateway requests and microservice payloads: one source of truth across 7 apps.
Layer 07
Containers & CI/CD
Multi-stage Dockerfiles for NestJS and Next.js, a Compose stack with health checks and automatic MinIO buckets, and GitHub Actions running build, type-check, lint and tests on every pull request. Critical dependency vulnerabilities went from 6 to 0.
§ 05 — Product tour
Inside PayLab Admin
Pick a screen, swipe, or use the arrow keys. Click a screen to see it full size.
Merchants. Search by email, enable or disable accounts, reset passwords, and see every store a merchant can reach.
Next case file
Other case studies

STOCKROOM
A high-performance e-commerce platform engineered for real-time inventory tracking, seamless checkouts, and high conversion.
- Online Store
- Inventory
- Multilingual

TAIMIYANS.
An interactive ex-students’ forum platform connecting alumni through directory networks, event modules, and real-time community engagement.
- Alumni Network
- Events
- Community



