Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions apps/ai-credits-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# AI Credits web app

This Vite app renders the standalone GoodDollar AI credits developer landing page and embeds
`AiCreditsWidget` when an injected browser wallet is available.

## Production configuration

Set these build-time values in the production hosting environment. Vite exposes `VITE_` values to
the browser, so do not put secrets in them.

| Variable | Purpose | Fallback |
| --- | --- | --- |
| `VITE_AI_CREDITS_BACKEND_URL` | AI credits backend used for quotes, payment notifications, and credit status. | None; the widget reports the backend as unavailable. |
| `VITE_AI_CREDITS_FUNDING_VAULT_ADDRESS` | Base funding vault / operator contract used for Base-side credit actions. | None; purchasing cannot proceed. |
| `VITE_AI_CREDITS_VAULT_ADDRESS` | Celo G$ Antseed vault contract that receives the G$ payment. | Widget fallback address; set explicitly for production. |
| `VITE_AI_CREDITS_GOODID_ADDRESS` | Celo GoodID contract used to determine bonus eligibility. | Widget default GoodID address; set explicitly for production. |
| `VITE_AI_CREDITS_BASE_RPC_URL` | Base Mainnet RPC endpoint used for credit and operator reads. | Public Base RPC default. |
| `VITE_AI_CREDITS_CELO_RPC_URL` | Celo Mainnet RPC endpoint used for payment and GoodID reads. | Public Celo RPC default. |

Example deployment configuration:

```dotenv
VITE_AI_CREDITS_BACKEND_URL=https://api.example.com
VITE_AI_CREDITS_FUNDING_VAULT_ADDRESS=0x...
VITE_AI_CREDITS_VAULT_ADDRESS=0x...
VITE_AI_CREDITS_GOODID_ADDRESS=0x...
VITE_AI_CREDITS_BASE_RPC_URL=https://base-rpc.example.com
VITE_AI_CREDITS_CELO_RPC_URL=https://celo-rpc.example.com
```

Use the deployed contracts and managed RPC endpoints approved for the target environment. Keep
local values in `.env.local`, which is ignored by Git.
14 changes: 13 additions & 1 deletion apps/ai-credits-web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GoodDollar AI Credits</title>
<meta
name="description"
content="Buy AI credits with G$ and use them through Antseed in Claude Code, Codex, and compatible agent workflows."
/>
<meta name="theme-color" content="#13151C" />
<title>AI Credits for Developers | GoodDollar × Antseed</title>
<style>
* {
margin: 0;
Expand All @@ -15,6 +20,13 @@
#root {
min-height: 100%;
}
html {
scroll-behavior: smooth;
background: #13151c;
}
body {
background: #13151c;
}
</style>
</head>
<body>
Expand Down
3 changes: 3 additions & 0 deletions apps/ai-credits-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"@goodwidget/core": "workspace:*",
"@goodwidget/embed": "workspace:*",
"@goodwidget/ui": "workspace:*",
"@tamagui/core": "1.121.0",
"@tamagui/lucide-icons": "1.121.0",
"@reown/appkit": "^1.8.22",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"react-native-svg": "15.15.5",
"react-native-web": "^0.19.13"
},
"devDependencies": {
Expand Down
36 changes: 36 additions & 0 deletions apps/ai-credits-web/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { defineConfig, devices } from '@playwright/test'

export default defineConfig({
testDir: './tests',
timeout: 30_000,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: 'list',
use: {
baseURL: 'http://127.0.0.1:3001',
trace: 'on-first-retry',
},
projects: [
{
name: 'desktop',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 800 },
},
},
{
name: 'mobile',
use: {
...devices['iPhone 13'],
viewport: { width: 360, height: 800 },
},
},
],
webServer: {
command: 'pnpm --filter @goodwidget/ai-credits-web dev --host 127.0.0.1',
url: 'http://127.0.0.1:3001',
reuseExistingServer: true,
timeout: 120_000,
},
outputDir: '../../test-results/ai-credits-web',
})
Loading