This project demonstrates an AI-powered solution for dynamic payment integration using the GrabPay Mock APIs. The goal was to streamline developer experience by reducing integration overhead through intelligent prompting and automation. Built for the GrabHack 2025, this project combines large language models, script generation, and runtime code packaging into a seamless developer flow.
A conversational UI allows developers to interact with Claude (via Bedrock) to:
- Generate code for integrating GrabPay, GrabLoans, and other APIs.
- Get runnable scripts for automating file creation and integration.
- Request multi-language (React, Kotlin, Swift, Django) support.
- Ask architectural, code flow, or error-handling questions.
- Claude 3 Sonnet via AWS Bedrock
- Streaming support with SSE
- Custom prompt generation logic
- Task-based dynamic prompting (chat vs script)
- MCP Server: Node.js (Express) — handles mock GrabPay endpoints.
- Chat UI built using React
The chatbot can generate scripts that:
- Create integration files (like
GrabPayIntegration.js) - Modify entry points (e.g.,
App.js,MainActivity.kt) - Add import statements and insert JSX/components
- Use the browser-native
fetchAPI for API calls
- User enters a prompt to integrate any Grab service in their preferred language.
- Backend builds a Claude prompt for code + script generation.
- Claude returns the integration component + automation script.
- User clicks Download Script, and the file is streamed from
/api/download.
node integrate-grabpay.jsCreates:
src/GrabPayIntegration.js- Edits
src/App.jsto:- Add
import GrabPayIntegration from './GrabPayIntegration' - Insert
<GrabPayIntegration />in the JSX
- Add
In addition to individual scripts, the platform can auto-generate a reusable NPM package that wraps Grab services.
- Built dynamically with
grabpay.js,grabloans.js, etc. - Generates:
index.jsfor exportsREADME.mdwith usagepackage.json
- Packaged with
npm packand served as.tgz
GET /api/generate-wrappernpm install ./grabpay-wrapper-1.0.0.tgzimport { useGrabPay, useGrabLoans } from 'grabpay-wrapper';
const handlePay = async () => {
const pay = useGrabPay({ amount: 1000, currency: 'INR', merchant_id: 'demo-merchant-123' });
const response = await pay();
console.log(response);
};Two modes of using generated code:
- Users download a script (e.g.,
integrate-grabpay.js) - Runs with
nodeto inject files into the third-party app - Fully offline-compatible
- Supports multi-language frameworks
- Users install
.tgzNPM package - Use exported methods like
useGrabPay()inside buttons
| Endpoint | Method | Description |
|---|---|---|
/api/invoke-bedrock |
POST | Invoke Claude with prompt + stream response |
/api/download |
GET | Download generated script file |
/api/generate-wrapper |
GET | Package & download Grab wrapper as .tgz |
/server
├── prompts/
│ └── scriptPromptBuilder.js
├── scripts/
│ └── generateWrapperPackage.js
├── routes/
│ └── api.js
├── temp/
│ └── grabpay-wrapper-1.0.0/...
├── app.js
/frontend
├── src/
│ ├── components/
│ │ └── GrabPayIntegration.js (auto-generated)
│ ├── App.js (auto-modified)
- 🧠 AI-generated, real-time, language-specific integration code
- ⚡ Instant file generation and insertion scripts
- 📦 Self-contained, reusable NPM packages
- 💬 Extendable to other payment features (loans, rewards, etc.)
- 🔌 Ideal for rapid prototyping and scalable integration
Copy-pasting code isn't enough. This system:
-
Reduces integration friction for developers
-
Uses AI context to generate smart, customized code
-
Embraces best practices via reusable modules and packages
-
Adapts to frameworks like React, Django, or Kotlin
## Clone repo
git clone https://github.com/abhirupr123/grab_flow.git
## Start backend server
cd server
npm install
node server.js
## Run React frontend
cd ../react-app
npm install
npm start
This project is licensed under the MIT License - see the LICENSE file for details.
Built during GrabHack 2025 🏁
Grateful to the GrabHack organizing team for the opportunity.
Special thanks to our mentors for guiding through the development and ideation of the entire prohect.
- Support for auto-installing dependencies
- Authentication flow integrations
- CI-ready SDK bundling for broader deployments