raghuece455/r-pay

GitHub: raghuece455/r-pay

Stars: 0 | Forks: 0

# R-Pay ![Node](https://img.shields.io/badge/node-20-green) ![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue) ![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/280fec5693102916.svg) ![License](https://img.shields.io/badge/license-MIT-blue) R-Pay, also called Raghu's Pay, is a fictional UPI-style payment product for India. It is a production-style full-stack demo for learning payment safety, state machines, incident response, observability, RCA workflows, and Claude Code agent collaboration. R-Pay is not a real payment system. It does not connect to real UPI rails, NPCI, banks, PSPs, PhonePe, Google Pay, payment gateways, or real money movement. The app uses a local sandbox payment network simulator only. ## Screenshots ### Consumer Payment App | Home | Pay | Status | Transactions | | --- | --- | --- | --- | | ![R-Pay home](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/11b8b92540102924.png) | ![R-Pay pay](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/c7999b8997102930.png) | ![R-Pay status](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/ea312c7c55102936.png) | ![R-Pay transactions](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/8c9e41893f102941.png) | ### IncidentDesk | Health | Incident | Logs | Deployments | | --- | --- | --- | --- | | ![IncidentDesk health](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/1a91cddd61102947.png) | ![Incident detail](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/db440f2fbf102953.png) | ![Logs and traces](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/0fd2882c7d103000.png) | ![Deployments](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/338f0ddbdd103006.png) | | Runbooks | RCA | | --- | --- | | ![Runbooks](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/a25cbd90ec103012.png) | ![RCA draft](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/d9a5261565103016.png) | ## What You Can Demo ## Architecture apps/web Next.js consumer app and IncidentDesk apps/api Express API, Prisma, payment APIs, simulator APIs, ops APIs apps/worker Status reconciler and incident signal worker packages/shared Types, validation, payment state machine, retry and RCA helpers packages/ui Shared React UI package placeholder prisma PostgreSQL schema and seed data scripts Demo traffic, incident, and reset scripts screenshots Final GitHub and article-ready screenshots ## Local Setup docker compose up -d cp .env.example .env pnpm install pnpm db:migrate pnpm seed pnpm dev On Windows PowerShell: Copy-Item .env.example .env If `pnpm` is not on your PATH, enable it with Corepack or run commands through `npx pnpm@10.11.0`. Open: - Consumer app: http://localhost:3001 - IncidentDesk: http://localhost:3001/ops - API health: http://localhost:4000/health Demo user: - Name: Raghu - UPI-style ID: `raghu@rpay` - Account: `HDFC Bank **** 4242` ## Useful Commands pnpm test pnpm lint pnpm typecheck pnpm seed pnpm simulate:incident pnpm reset:demo DB-backed API integration tests are available after Postgres is running: RUN_DB_TESTS=true pnpm --filter @rpay/api test ## Make a Payment 1. Open http://localhost:3001. 2. Select **Pay**. 3. Use a sandbox UPI-style payee like `chai-shop@rpay`. 4. Enter an amount and note. 5. Confirm the payment. 6. Open the status page and transaction history. The simulator can return `SUCCESS`, `FAILED`, or `PENDING`. A payment can only become `SUCCESS` when the local simulator returns a valid confirmation. ## Trigger the Midnight Retry Storm From IncidentDesk: 1. Open http://localhost:3001/ops/simulations. 2. Trigger **Midnight Retry Storm**. 3. Watch success rate drop, latency spike, pending transactions rise, queue depth explode, and DB pool usage hit 100%. 4. Open the incident timeline, logs, deployment history, and runbook. 5. Use the approval-gated rollback or fixed-retry action. 6. Generate the RCA draft. From the command line: pnpm simulate:incident ## Docs - [Architecture](docs/architecture/ARCHITECTURE.md) - [Product spec](docs/architecture/SPEC.md) - [API design](docs/architecture/API_DESIGN.md) - [Data model](docs/architecture/DATA_MODEL.md) - [Payment state machine](docs/architecture/PAYMENT_STATE_MACHINE.md) - [Observability plan](docs/architecture/OBSERVABILITY_PLAN.md) - [Payment incident runbook](docs/runbooks/payment-incident-runbook.md) - [Screenshot guide](docs/SCREENSHOTS.md)
标签:自动化攻击