System overview
How Gitpay is built, from the React app to the payment providers, and where each piece lives in the repository.
Gitpay is a single repository, worknenjoy/gitpay, with a Node.js API and a React web app. It’s open source under the MIT license.
The pieces
| Part | Technology | Where |
|---|---|---|
| Web app | React 18, MUI, Redux, React Intl, webpack | frontend/ |
| Design library | Components from atoms to full pages, documented in Storybook | frontend/src/components/design-library/ |
| API server | Node.js 24, Express 5, TypeScript, Passport | src/ |
| Database | PostgreSQL through Sequelize, with migrations and seeders | src/models/, src/db/ |
| Payment providers | A provider layer with Whop and Stripe connectors | src/providers/ |
| Webhooks | Signed endpoints for Whop and Stripe events | src/app/routes/webhooks.ts, src/modules/webhooks/ |
| GitHub integration | OAuth sign-in, the REST API, and issue comments | src/client/, src/bot/ |
| Scheduled jobs | In-process cron, moving to Inngest | src/crons/, src/inngest/ |
| SendGrid, with templates in English and Portuguese | src/mail/, locales/ |
Request flow
- The web app calls the API over HTTPS with JSON. Signed-in requests carry a JWT.
- Express routes in
src/app/routes/pass the request to a controller insrc/app/controllers/. - Controllers call business logic in
src/modules/andsrc/services/, which read and write throughsrc/queries/andsrc/mutations/. - Anything that moves money goes through
getPaymentProvider(), never a provider SDK directly. See Payment providers. - Providers report results back through webhooks, which update records and send emails. See Webhooks.
Repository layout
gitpay/
├── src/
│ ├── app/ # Express routes and controllers
│ ├── modules/ # Business logic by feature (tasks, orders, payment requests…)
│ ├── services/ # Cross-cutting services (payments, payouts, issues, transfers)
│ ├── queries/ # Database reads
│ ├── mutations/ # Database writes
│ ├── models/ # Sequelize models
│ ├── db/ # Migrations and seeders
│ ├── providers/ # PaymentProvider, Stripe and Whop connectors, webhook registry
│ ├── client/ # Auth strategies and external API clients
│ ├── bot/ # Comments Gitpay posts on GitHub
│ ├── crons/ # Legacy scheduled jobs
│ ├── inngest/ # Inngest functions
│ ├── mail/ # Email templates and senders
│ └── scripts/ # Operational and reporting scripts
├── frontend/
│ └── src/
│ ├── components/
│ │ ├── areas/ # Public and private app areas
│ │ └── design-library/ # atoms → molecules → organisms → templates → pages
│ ├── actions/, reducers/ # Redux
│ └── translations/ # UI strings (React Intl)
├── test/ # Backend tests (Mocha)
├── playwright/ # End-to-end tests with GitHub and Whop stubs
├── locales/ # Server-side strings for emails
└── docs/ # Developer notes on providers and jobs
Authentication
Passport handles sign-in with email and password, GitHub, Bitbucket, Google and Facebook. The API issues a JWT that the web app sends on every signed-in request. Connecting GitHub is required to send bounty solutions, because Gitpay verifies the pull request author against the connected account.
Hosting
The API and the built web app run as one Node.js process on Heroku, with Heroku Postgres. The documentation site and Storybook are published to GitHub Pages from the gh-pages branch.