Skip to content

Commit ecaf7ce

Browse files
authored
Merge pull request #204 from develop
chore: sync develop to main — PostHog migration verification
2 parents 686f877 + 2d6e8d3 commit ecaf7ce

45 files changed

Lines changed: 1411 additions & 61 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ VITE_SUPABASE_ANON_KEY=your-anon-key
77
# Google Identity Services — Web OAuth client ID (public)
88
VITE_GOOGLE_WEB_CLIENT_ID=your-web-client-id.apps.googleusercontent.com
99

10+
# PostHog analytics (optional — skip in local dev)
11+
VITE_POSTHOG_API_HOST=https://us.i.posthog.com
12+
VITE_POSTHOG_API_KEY=phc_your_project_token
13+
# For production with reverse proxy: VITE_POSTHOG_API_HOST=https://e.bayanflow.com
14+
1015
# Optional: Pyodide CDN override (see src/constants/pyodideCdn.js)
1116
# VITE_PYODIDE_CDN_BASE=

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ jobs:
127127
env:
128128
VITE_GIT_BRANCH: ${{ github.ref_name }}
129129
VITE_DEV_SITE_URL: 'https://dev.bayanflow.com'
130+
VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
131+
VITE_POSTHOG_API_HOST: 'https://us.i.posthog.com'
130132

131133
- name: Upload build artifacts
132134
uses: actions/upload-artifact@v5

.github/workflows/deploy-cloudflare.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
5252
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
5353
VITE_GOOGLE_WEB_CLIENT_ID: ${{ secrets.VITE_GOOGLE_WEB_CLIENT_ID }}
54+
VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
55+
VITE_POSTHOG_API_HOST: ${{ github.event.workflow_run.head_branch == 'main' && 'https://e.bayanflow.com' || 'https://e.dev.bayanflow.com' }}
5456

5557
- name: Deploy to Cloudflare Workers
5658
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3

.github/workflows/preview-cloudflare.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
5959
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
6060
VITE_GOOGLE_WEB_CLIENT_ID: ${{ secrets.VITE_GOOGLE_WEB_CLIENT_ID }}
61+
VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
62+
VITE_POSTHOG_API_HOST: https://e.dev.bayanflow.com
6163

6264
- name: Upload preview version
6365
id: deploy

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Bayan Flow implements several security measures:
6969

7070
- **Client-side only**: No server-side data processing or storage for algorithm execution
7171
- **Local algorithm execution**: Sorting, searching, pathfinding, and graph visualizations run entirely in the browser
72-
- **Limited third-party calls**: Umami analytics (privacy-oriented), GitHub public API (release/repo metadata), and jsDelivr (Pyodide, only when the user opens the Python panel)
72+
- **Limited third-party calls**: PostHog analytics (privacy-oriented, via first-party proxy), GitHub public API (release/repo metadata), and jsDelivr (Pyodide, only when the user opens the Python panel)
7373
- **HTTP security headers** (via Cloudflare Workers static assets `public/_headers`): Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy
7474
- **Content Security Policy**: Restricts script, connect, frame, and worker sources to approved origins
7575
- **Automated scanning**:

docs/AGENTS_REFERENCE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,3 +615,31 @@ Use focused tests first for registry/category changes, then broaden to the full
615615
- If a shared helper is required, add it in the earliest commit that needs it.
616616
- Prefer existing hooks, registries, helpers, and component patterns over one-off branches.
617617
- Keep deterministic generators deterministic in tests by accepting/passing an `rng` where existing utilities do.
618+
619+
## Agent-Readiness Endpoints
620+
621+
### Static files (served from `public/`)
622+
623+
| File | Content-Type | Purpose |
624+
|------|-------------|---------|
625+
| `/.well-known/api-catalog` | `application/linkset+json` | RFC 9727 API catalog with `linkset` array |
626+
| `/.well-known/mcp/server-card.json` | `application/json` | MCP Server Card (SEP-1649) with `serverInfo`, endpoint, capabilities |
627+
| `/.well-known/oauth-authorization-server` | `application/json` | OAuth discovery (Supabase issuer) with `agent_auth` block |
628+
| `/.well-known/oauth-protected-resource` | `application/json` | RFC 9728 Protected Resource Metadata |
629+
| `/.well-known/agent-card.json` | `application/json` | Agent card with capabilities and features |
630+
| `/.well-known/agent-skills/index.json` | `application/json` | Agent skills catalog |
631+
| `/auth.md` | `text/markdown` | Agent registration / authentication guide |
632+
| `/llms.txt` | `text/plain` | Machine-readable site description for AI agents |
633+
634+
### Link headers (in `public/_headers`)
635+
636+
The `/*` section includes `Link` headers pointing to:
637+
- `</.well-known/api-catalog>; rel="api-catalog"`
638+
- `</.well-known/oauth-protected-resource>; rel="oauth-protected-resource"`
639+
- `</.well-known/mcp/server-card.json>; rel="mcp-server-card"`
640+
- `</auth.md>; rel="auth-md"`
641+
- `</llms.txt>; rel="llms-txt"`
642+
643+
### CORS
644+
645+
All `/.well-known/*` paths include `Access-Control-Allow-Origin: *` for cross-origin agent discovery.

index.html

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,34 +38,6 @@
3838
})();
3939
</script>
4040

41-
<!-- Umami Analytics - Dynamically loaded based on environment -->
42-
<script>
43-
(function () {
44-
const hostname = window.location.hostname;
45-
let websiteId;
46-
if (
47-
hostname === 'dev.bayanflow.com' ||
48-
hostname.slice(-12) === '.workers.dev'
49-
) {
50-
// Develop
51-
websiteId = 'b21ffc5d-66c1-4bfc-9e54-e05dbbe26852';
52-
} else if (
53-
hostname === 'bayanflow.com' ||
54-
hostname === 'www.bayanflow.com'
55-
) {
56-
// main
57-
websiteId = 'c096589e-f026-47e9-b458-aeb6850d5d5c';
58-
}
59-
if (websiteId) {
60-
const script = document.createElement('script');
61-
script.defer = true;
62-
script.src = 'https://cloud.umami.is/script.js';
63-
script.setAttribute('data-website-id', websiteId);
64-
document.head.appendChild(script);
65-
}
66-
})();
67-
</script>
68-
6941
<!-- Open Graph / Facebook -->
7042
<meta property="og:type" content="website" />
7143
<meta property="og:url" content="https://bayanflow.com/" />

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@monaco-editor/react": "^4.7.0",
6060
"@octokit/rest": "^22.0.1",
6161
"@phosphor-icons/react": "^2.1.10",
62+
"@posthog/react": "^1.10.3",
6263
"@remotion/media": "4.0.436",
6364
"@remotion/web-renderer": "^4.0.436",
6465
"@supabase/supabase-js": "^2.108.2",
@@ -69,6 +70,7 @@
6970
"i18next": "^25.7.1",
7071
"i18next-browser-languagedetector": "^8.2.0",
7172
"isomorphic-dompurify": "^3.18.0",
73+
"posthog-js": "^1.404.0",
7274
"react": "^19.2.0",
7375
"react-dom": "^19.2.0",
7476
"react-i18next": "^15.7.4",

pnpm-lock.yaml

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/.well-known/agent-card.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
"name": "Bayan Flow",
44
"description": "Interactive educational tool for learning algorithms through step-by-step visual animations with clarity (بيان). Features sorting, pathfinding, searching, tree traversal, and graph algorithms with Python code examples and real-time complexity analysis.",
55
"url": "https://bayanflow.com",
6+
"version": "0.5.0",
67
"capabilities": ["visualization", "education", "code-execution", "video-export"],
78
"category": "education",
9+
"skills": [
10+
{
11+
"name": "algorithm-visualization",
12+
"description": "Browse and explore interactive algorithm visualizations across sorting, pathfinding, searching, tree traversal, and graph categories.",
13+
"url": "https://bayanflow.com/app"
14+
},
15+
{
16+
"name": "complexity-analysis",
17+
"description": "View time and space complexity information for any algorithm.",
18+
"url": "https://bayanflow.com/app"
19+
}
20+
],
21+
"supportedInterfaces": ["web", "mcp"],
822
"features": [
923
"45 interactive algorithm visualizations",
1024
"Real-time complexity analysis",

0 commit comments

Comments
 (0)