GitHub X (Twitter) LinkedIn
← All projects
Node & Stripe

embpa

A B2B invoicing platform where a customer pays without leaving the page: Express issues the invoice, Stripe confirms the payment, and a signature verified webhook marks it paid.

RoleDesign + Build StatusOpen source TypePayments platform
embpa invoice, server and Stripe flow

Overview

embpa is a small, complete payments loop. The browser fetches a publishable key from the server, pays through Stripe's embedded form, and never sees the secret key. The webhook route is mounted before express.json() so it can verify the raw body, and invoice ownership is enforced on every route.

browser --publishable key--> Stripe Elements browser --create invoice----> Express -> SQLite Stripe --signed webhook----> Express -> invoice.paid

Key features

  • Embedded paymentsThe Stripe Payment Element sits inside the invoice page; no redirect to a hosted checkout.
  • Raw body webhookMounted before JSON parsing, so signature verification sees the exact bytes Stripe signed.
  • Cookie authhttpOnly JWT cookie with SameSite=Lax and an optional secure flag.
  • Invoice ownershipEvery invoice carries user_id; list and pay routes filter by the session user.
  • Startup migrationsAdds payment_intent_id, user_id and currency to older databases.
  • Fail fast configThe process exits if JWT_SECRET or STRIPE_SECRET_KEY is missing.

How it works

  1. Fill .env with Stripe test keys, the webhook secret and a JWT secret.
  2. Run npm install && npm start.
  3. Register, create an invoice, and pay it with a Stripe test card.
  4. The webhook marks the invoice paid; the list reflects it on the next load.
npm install npm start # .env STRIPE_SECRET_KEY=sk_test_... STRIPE_PUBLISHABLE_KEY=pk_test_... STRIPE_WEBHOOK_SECRET=whsec_... JWT_SECRET=...

Stack

Node.js Express JS Stripe better-sqlite3 JWT bcrypt

Have a project in mind?

Email me
Have a project? Let's talk