Architecture
How the frontend, API, database, and blockchain interact.
VerseBill is a Next.js application with an App Router frontend, API route handlers, a Prisma-backed Supabase Postgres database, and a viem client for reading the Polygon blockchain.
- 1Frontend (Next.js / React, Tailwind CSS)
- 2Application/API layer (Next.js route handlers)
- 3Supabase / Postgres (Prisma ORM)
- 4Blockchain RPC (viem public client)
- 5Polygon network
- 6VERSE token (ERC-20)
- 7On-chain transaction verification
Request flow
- The browser calls an API route with the authenticated session
- The route validates input and authorizes the request against the merchant
- Server modules read and write Postgres via Prisma
- Payment verification reads the blockchain through a server-side RPC
- The route returns JSON that the client renders
The browser never talks to the database or the RPC directly. All chain reads and database writes happen on the server.