Next.js marketing site, merchant dashboard, public payment pages, wallet integration, webhook settings, and embeddable widget.
The frontend follows the Stargate design prompt kit: dark fintech hero, B2B navigation, transactions, payment links, wallets, webhooks, team controls, developer docs, hosted checkout, and the widget SDK.
cp .env.local.example .env.local
npm install
npm run devThe payment flow supports Freighter and Albedo wallets. To test wallet connection locally:
- Install the Freighter browser extension.
- Open Freighter, create or import a wallet, and switch the network to Testnet (Settings → Network → Testnet).
- Fund your testnet account using Stellar Friendbot or the Stellar Laboratory.
- To receive USDC on testnet, add a trustline for the testnet USDC asset:
- Asset code:
USDC - Issuer:
GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5
- Asset code:
- Start the dev server (
npm run dev) and open a payment page (/pay/<invoice-id>). - Click Connect Freighter — the extension will prompt for access and then sign the payment transaction.
Albedo works in-browser without an extension. Select Albedo on the wallet selector and follow the popup prompts. Use the same testnet USDC issuer above when adding a trustline.
- Testnet accounts reset periodically; re-fund with Friendbot if your balance disappears.
- Set
NEXT_PUBLIC_STELLAR_NETWORK=testnetin.env.localto ensure transactions are submitted to the test network. - Use the Stellar Expert testnet explorer to inspect transactions.
graph TB
subgraph Pages["Next.js Pages"]
Home["/ - Marketing Site"]
Auth["/(auth) - Login/Register"]
Pay["pay/[id] - Payment Page"]
Dashboard["dashboard/* - Merchant Dashboard"]
end
subgraph Components["Shared Components"]
UI["UI Components<br/>Button, Modal, Card, Input"]
Payment["Payment Components<br/>PaymentWidget, WalletSelector"]
Dashboard_Comp["Dashboard Components<br/>StatsCards, Charts, Tables"]
Auth_Comp["Auth Components<br/>TwoFactorManagement, SessionTimeout"]
end
subgraph Integrations["External Integrations"]
Stellar["Stellar Network<br/>Horizon API"]
Wallets["Wallet SDKs<br/>Freighter, Albedo"]
API["Backend API<br/>REST Endpoints"]
end
subgraph Utils["Utilities & Hooks"]
Lib["lib/<br/>api.ts, stellar.ts, sse.ts"]
Hooks["hooks/<br/>useWallet, useInvoices, useTeam"]
end
Pages -->|uses| Components
Components -->|calls| Utils
Utils -->|connects to| Integrations
Dashboard -->|manages| Payment
Auth -->|validates| Auth_Comp
npm run typecheck
npm run lint
npm test
npm run build
npm run build:widgetThe from-scratch product prompt kit lives at ../docs/stargate-product-build-prompts.md.
cp .env.production.example .env.production
npm run build
npm run build:widgetvercel.json contains the production build command, global security headers, hosted-checkout frame policy, and widget rewrite used by the deployment workflow.
The following GitHub secrets must be configured on the dreamgeneX/stargate-frontend repository for production deployments to work:
| Secret | Type | Description |
|---|---|---|
VERCEL_TOKEN |
string |
Authentication token for Vercel API. Generate from Vercel Account Settings. |
VERCEL_ORG_ID |
string |
Organization ID from Vercel. Found in Vercel dashboard under Settings → General. |
VERCEL_PROJECT_ID |
string |
Project ID from Vercel. Found in Vercel dashboard under Settings → General. |
How to set GitHub secrets:
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Enter the secret name and value
- Click "Add secret"
The following GitHub repository variables must be configured for production environment setup:
| Variable | Type | Default | Description |
|---|---|---|---|
NEXT_PUBLIC_APP_URL |
string |
http://localhost:3000 |
Public-facing domain URL of the frontend console. Used to generate webhook endpoints, copyable integration scripts, and SDK configuration details. Example: https://app.stargate.example.com |
NEXT_PUBLIC_API_URL |
string |
http://localhost:3001 |
Base API URL for frontend interactions. Used for general API calls and payment confirmation streams. Example: https://api.stargate.example.com |
How to set GitHub repository variables:
- Go to repository Settings → Secrets and variables → Variables
- Click "New repository variable"
- Enter the variable name and value
- Click "Add variable"
The production deployment workflow (.github/workflows/deploy-production.yml) uses these secrets and variables to:
- Authenticate with Vercel using
VERCEL_TOKEN - Deploy to the correct Vercel organization and project using
VERCEL_ORG_IDandVERCEL_PROJECT_ID - Configure environment variables for the deployed application using
NEXT_PUBLIC_APP_URLandNEXT_PUBLIC_API_URL
When deploying to production, ensure the following environment variables are set:
# Required
NEXT_PUBLIC_APP_URL=https://app.stargate.example.com
NEXT_PUBLIC_API_URL=https://api.stargate.example.com
NEXT_PUBLIC_STELLAR_NETWORK=mainnet # Use 'mainnet' for production
# Optional (defaults provided)
# NEXT_PUBLIC_STELLAR_NETWORK defaults to 'testnet' if not setBefore deploying to production, verify:
- All GitHub secrets are configured correctly
- All GitHub repository variables are set
- Environment variables are correct for your production environment
- Run the verification commands:
npm run typecheck npm run lint npm run build npm run build:widget
Issue: "Vercel authentication failed"
- Verify
VERCEL_TOKENis valid and not expired - Regenerate the token from Vercel Account Settings if needed
Issue: "Project not found"
- Verify
VERCEL_ORG_IDandVERCEL_PROJECT_IDare correct - Ensure the project exists in the specified Vercel organization
Issue: "Environment variables not set"
- Verify
NEXT_PUBLIC_APP_URLandNEXT_PUBLIC_API_URLare configured as GitHub repository variables - Check that the deployment workflow has access to these variables
The frontend application is configured via the following environment variables:
| Variable | Type | Default | Usage / Description |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
string (URL) |
http://localhost:3001 |
Base API URL for frontend interactions. Used in api.ts for general API calls and sse.ts to establish payment confirmation streams. |
NEXT_PUBLIC_APP_URL |
string (URL) |
http://localhost:3000 |
The public-facing domain URL of the frontend console. Used in developers/page.tsx to generate webhook endpoints, copyable integration scripts, and SDK configuration details. |
NEXT_PUBLIC_STELLAR_NETWORK |
'testnet' | 'mainnet' |
testnet |
Specifies the default target Stellar network environment. Used in transaction signing configurations, Horizon endpoints construction, and fallback parameters. |
Note: Never put secrets or private keys in these variables. All variables prefixed with
NEXT_PUBLIC_are bundled into the client-side code and exposed to the browser.
For detailed integration and styling guides, refer to the following documentation:
- Widget SDK & Event Schema — Event schemas (
STARGATE_LOADED,STARGATE_PAID,STARGATE_ERROR),postMessagedetails, and embedding code. - Theming & Branding Customisation Guide — Complete walkthrough on how to override CSS variables, customize brand colors, support dark mode, and customize fonts for the hosted checkout page.
- i18n Contribution Guide — Process for adding new languages to the hosted checkout page using next-intl.
- Performance Budget — Core Web Vitals targets (LCP, CLS, INP) and how they are measured in CI.
MIT