Skip to content
Closed
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
7 changes: 7 additions & 0 deletions .github/workflows/vercel-preview-identity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
paths:
- "apps/demo-identity-app/**"
- "packages/citizen-sdk/**"
- "packages/streaming-sdk/**"
- "packages/react-hooks/**"
- ".github/workflows/*identity*.yml"
pull_request:
types: [opened, synchronize, edited, ready_for_review]
Expand All @@ -12,6 +14,8 @@ on:
paths:
- "apps/demo-identity-app/**"
- "packages/citizen-sdk/**"
- "packages/streaming-sdk/**"
- "packages/react-hooks/**"
- ".github/workflows/*identity*.yml"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Expand All @@ -33,6 +37,9 @@ jobs:
- run: npm install --global turbo@latest
- run: npm install --global vite@latest
- run: yarn install --immutable
# Build dependencies first using turbo
- name: Build dependencies
run: turbo build --filter=demo-identity-app...
# Get env vars
- run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_DEPLOY_TOKEN }}
working-directory: apps/demo-identity-app
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ node_modules
.env.development.local
.env.test.local
.env.production.local
**/.env
**/.env.local
**/.env.*.local

# Testing
coverage
Expand Down Expand Up @@ -39,4 +42,5 @@ yarn-error.log*
.yarn/install-state.gz
apps/engagement-app/tsconfig.tsbuildinfo
.vscode/settings.json
e2e.log

docs
16 changes: 16 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
.git
.env.*.local
.DS_Store
*.md
coverage
artifacts
cache
dist
.next
.turbo
.eslintcache
.vercel
packages/*/dist
apps/*/dist
apps/*/.next
1 change: 1 addition & 0 deletions apps/demo-identity-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_GRAPH_API_KEY=
3 changes: 2 additions & 1 deletion apps/demo-identity-app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vercel
.certs
.yalc
yalc.lock
yalc.lock
.env
10 changes: 10 additions & 0 deletions apps/demo-identity-app/.vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
.git
.env.*.local
.DS_Store
*.md
coverage
.eslintcache
.turbo
src/**/*.test.ts
src/**/*.test.tsx
10 changes: 9 additions & 1 deletion apps/demo-identity-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ To utilize the `citizen-sdk` within your application:
}
```

For more examples and detailed usage, refer to the [citizen-sdk README](packages/citizen-sdk/README.md).
For more examples and detailed usage, refer to the [citizen-sdk README](../../packages/citizen-sdk/README.md).

### Developing with `streaming-sdk`

The demo app includes an interactive test page for Superfluid streams:

1. **Test UI**: Access it at [http://localhost:3000/streaming](http://localhost:3000/streaming).
2. **Guide**: For detailed instructions on testing streams and GDA pools, see the [Streaming Guide](./STREAMING.md).
3. **Environment**: Ensure you have a `VITE_GRAPH_API_KEY` configured in your `.env` for data fetching.
46 changes: 46 additions & 0 deletions apps/demo-identity-app/STREAMING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Streaming SDK Test Guide

This page explains how to use the interactive test UI for the Superfluid Streaming SDK.

## Location
The test page is built into the demo app:
`src/components/StreamingTestPage.tsx`

## Quick Start
To start the development server, you can run the standard dev command from the root:

```bash
yarn dev
```

Alternatively, if you want to run just the demo app:

1. `cd apps/demo-identity-app`
2. `yarn dev`

Once started, open [http://localhost:3000/streaming](http://localhost:3000/streaming) in your browser.

## Features

### Money Streaming
- Create: Set up a new stream by entering a receiver address and amount. The SDK handles the flow rate math for you.
- Update: Change the flow rate for an existing recipient.
- Delete: Stop an active stream.

### Distribution Pools (GDA)
- Connect: Join a distribution pool to start receiving funds.
- Disconnect: Leave a pool when you no longer want to receive distributions.
- Visibility: Check your connection status and current units directly in the UI.

## Testing the Frontend
To properly test the data fetching:
1. Make sure your `.env` file in the app folder has a `VITE_GRAPH_API_KEY`.
2. Connect your wallet and switch to a supported network (Celo is best for G$ testing).
3. If you're on Base, you can view SUP reserve holdings to verify the subgraph integration.

## Unit Tests
If you want to run the underlying logic tests:
```bash
cd packages/streaming-sdk
npm test
```
29 changes: 29 additions & 0 deletions apps/demo-identity-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
8 changes: 7 additions & 1 deletion apps/demo-identity-app/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "demo-identity-app",
"version": "1.0.0",
"type": "module",
"private": true,
"scripts": {
"dev": "vite --port 3000",
"build": "vite build",
"startS": "cross-env HTTPS=true SSL_CRT_FILE='./.certs/ssl.crt' SSL_KEY_FILE='./.certs/ssl.key' PORT=1122 vite --port 1122",
"preview": "vite preview",
"lint": "eslint . --ext .ts,.tsx",
"lint": "eslint src --cache",
"format": "prettier --write ."
},
"dependencies": {
"@goodsdks/citizen-sdk": "*",
"@goodsdks/react-hooks": "*",
"@goodsdks/streaming-sdk": "*",
"@reown/appkit": "^1.7.2",
"@reown/appkit-adapter-wagmi": "^1.7.2",
"@reown/appkit-wallet": "^1.7.2",
Expand All @@ -34,6 +36,7 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint/js": "8.57.0",
"@tamagui/babel-plugin": "^1.125.22",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
Expand All @@ -46,10 +49,13 @@
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "0.4.12",
"globals": "15.0.0",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"sass": "^1.85.1",
"typescript": "^5.8.2",
"typescript-eslint": "8.0.0",
"vite": "6.3.5"
}
}
Loading
Loading