From 7fcc818a1ce979e5f3aa72c1bfc143b9a56f0c83 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 5 Nov 2025 02:45:56 +0000 Subject: [PATCH] Prettier format pending files --- api/sync-docs-gitbook.ts | 83 ++++++++++++++-------- client/contexts/AuthContext.tsx | 14 +++- client/pages/DocsSync.tsx | 86 +++++++++++++++-------- docs-migration/01-overview.md | 12 ++++ docs-migration/02-getting-started.md | 17 +++++ docs-migration/03-platform.md | 22 ++++++ docs-migration/04-api-reference.md | 29 ++++---- docs-migration/05-tutorials.md | 15 ++++ docs-migration/06-cli.md | 30 ++++---- docs-migration/07-examples.md | 16 ++++- docs-migration/08-integrations.md | 34 ++++++--- docs-migration/09-curriculum.md | 25 +++++-- docs-migration/MIGRATION_GUIDE.md | 7 +- docs-migration/gitbook-api-script.js | 76 +++++++++++++------- netlify/functions/sync-docs-to-gitbook.ts | 86 +++++++++++++++-------- 15 files changed, 395 insertions(+), 157 deletions(-) diff --git a/api/sync-docs-gitbook.ts b/api/sync-docs-gitbook.ts index 2884425f..7dc62438 100644 --- a/api/sync-docs-gitbook.ts +++ b/api/sync-docs-gitbook.ts @@ -1,29 +1,47 @@ -import { VercelRequest, VercelResponse } from '@vercel/node'; -import { readFileSync } from 'fs'; -import { join } from 'path'; +import { VercelRequest, VercelResponse } from "@vercel/node"; +import { readFileSync } from "fs"; +import { join } from "path"; -const GITBOOK_API_TOKEN = process.env.GITBOOK_API_TOKEN || 'gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg'; -const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID || '37ITJTgjD56eN3ZI5qtt'; +const GITBOOK_API_TOKEN = + process.env.GITBOOK_API_TOKEN || + "gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg"; +const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID || "37ITJTgjD56eN3ZI5qtt"; const PAGES = [ - { title: 'Welcome to AeThex Documentation', slug: 'overview', file: '01-overview.md' }, - { title: 'Getting Started', slug: 'getting-started', file: '02-getting-started.md' }, - { title: 'Platform Guide', slug: 'platform', file: '03-platform.md' }, - { title: 'API Reference', slug: 'api-reference', file: '04-api-reference.md' }, - { title: 'Tutorials', slug: 'tutorials', file: '05-tutorials.md' }, - { title: 'CLI Tools', slug: 'cli', file: '06-cli.md' }, - { title: 'Code Examples', slug: 'examples', file: '07-examples.md' }, - { title: 'Integrations', slug: 'integrations', file: '08-integrations.md' }, - { title: 'Curriculum', slug: 'curriculum', file: '09-curriculum.md' }, + { + title: "Welcome to AeThex Documentation", + slug: "overview", + file: "01-overview.md", + }, + { + title: "Getting Started", + slug: "getting-started", + file: "02-getting-started.md", + }, + { title: "Platform Guide", slug: "platform", file: "03-platform.md" }, + { + title: "API Reference", + slug: "api-reference", + file: "04-api-reference.md", + }, + { title: "Tutorials", slug: "tutorials", file: "05-tutorials.md" }, + { title: "CLI Tools", slug: "cli", file: "06-cli.md" }, + { title: "Code Examples", slug: "examples", file: "07-examples.md" }, + { title: "Integrations", slug: "integrations", file: "08-integrations.md" }, + { title: "Curriculum", slug: "curriculum", file: "09-curriculum.md" }, ]; -async function makeRequest(method: string, path: string, body?: any): Promise { +async function makeRequest( + method: string, + path: string, + body?: any, +): Promise { const response = await fetch(`https://api.gitbook.com/v1${path}`, { method, headers: { Authorization: `Bearer ${GITBOOK_API_TOKEN}`, - 'Content-Type': 'application/json', - 'User-Agent': 'AeThex-Docs-Sync', + "Content-Type": "application/json", + "User-Agent": "AeThex-Docs-Sync", }, body: body ? JSON.stringify(body) : undefined, }); @@ -36,13 +54,10 @@ async function makeRequest(method: string, path: string, body?: any): Promise = ({ const hasAuthTokens = () => { if (typeof window === "undefined") return false; const keys = Object.keys(window.localStorage); - return keys.some((key) => key.includes("auth-token") || key.includes("sb-") && key.includes("-auth")); + return keys.some( + (key) => + key.includes("auth-token") || + (key.includes("sb-") && key.includes("-auth")), + ); }; // Get initial session with persistence recovery const initializeAuth = async () => { try { - const { data: { session } } = await supabase.auth.getSession(); + const { + data: { session }, + } = await supabase.auth.getSession(); // If no session but tokens exist, the session might not have restored yet // Wait a bit for onAuthStateChange to trigger if (!session && hasAuthTokens()) { - console.log("Tokens exist in storage but session not yet restored, waiting..."); + console.log( + "Tokens exist in storage but session not yet restored, waiting...", + ); // Don't set loading to false yet - wait for onAuthStateChange return; } diff --git a/client/pages/DocsSync.tsx b/client/pages/DocsSync.tsx index 998e3f1d..7c8a05e3 100644 --- a/client/pages/DocsSync.tsx +++ b/client/pages/DocsSync.tsx @@ -1,13 +1,19 @@ -import { useState } from 'react'; -import Layout from '@/components/Layout'; -import { Button } from '@/components/ui/button'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { Badge } from '@/components/ui/badge'; -import { CheckCircle2, AlertCircle, Loader2, BookOpen } from 'lucide-react'; +import { useState } from "react"; +import Layout from "@/components/Layout"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { CheckCircle2, AlertCircle, Loader2, BookOpen } from "lucide-react"; interface SyncResult { page: string; - status: 'success' | 'failed'; + status: "success" | "failed"; error?: string; } @@ -28,10 +34,10 @@ export default function DocsSync() { setError(null); try { - const response = await fetch('/api/sync-docs-gitbook', { - method: 'POST', + const response = await fetch("/api/sync-docs-gitbook", { + method: "POST", headers: { - 'Content-Type': 'application/json', + "Content-Type": "application/json", }, }); @@ -42,7 +48,7 @@ export default function DocsSync() { const data: SyncResponse = await response.json(); setResult(data); } catch (err) { - setError(err instanceof Error ? err.message : 'Unknown error'); + setError(err instanceof Error ? err.message : "Unknown error"); } finally { setLoading(false); } @@ -56,19 +62,25 @@ export default function DocsSync() {
-

Documentation Sync

+

+ Documentation Sync +

- Sync your AeThex documentation to Gitbook. Click the button below to push all 9 documentation pages to your Gitbook workspace. + Sync your AeThex documentation to Gitbook. Click the button below + to push all 9 documentation pages to your Gitbook workspace.

{/* Sync Card */} - Sync Documentation to Gitbook + + Sync Documentation to Gitbook + - This will push all 9 documentation pages to your Gitbook workspace + This will push all 9 documentation pages to your Gitbook + workspace @@ -127,19 +139,25 @@ export default function DocsSync() { {/* Results */} {result && ( - +
Sync Results

Successful

-

{result.successful}

+

+ {result.successful} +

{result.failed > 0 && (

Failed

-

{result.failed}

+

+ {result.failed} +

)}
@@ -148,9 +166,12 @@ export default function DocsSync() {
{result.results.map((item, index) => ( -
+
- {item.status === 'success' ? ( + {item.status === "success" ? ( ) : ( @@ -159,9 +180,9 @@ export default function DocsSync() {
{item.status} @@ -173,7 +194,8 @@ export default function DocsSync() { {result.failed === 0 && (

- āœ… All documentation successfully synced to Gitbook! Your docs are now available at https://docs.aethex.tech + āœ… All documentation successfully synced to Gitbook! Your + docs are now available at https://docs.aethex.tech

)} @@ -190,13 +212,21 @@ export default function DocsSync() {

Before syncing:

    -
  1. Verify Vercel environment variables are set: - GITBOOK_API_TOKEN +
  2. + Verify Vercel environment variables are set: + + GITBOOK_API_TOKEN + and - GITBOOK_SPACE_ID + + GITBOOK_SPACE_ID +
  3. Ensure your Gitbook workspace "AeThex Docs" is ready
  4. -
  5. Have pages created in Gitbook (Overview, Getting Started, etc.)
  6. +
  7. + Have pages created in Gitbook (Overview, Getting Started, + etc.) +
diff --git a/docs-migration/01-overview.md b/docs-migration/01-overview.md index 430550b7..e0dcd190 100644 --- a/docs-migration/01-overview.md +++ b/docs-migration/01-overview.md @@ -18,28 +18,36 @@ Everything you need to build, deploy, and scale amazing projects with AeThex. Ge ## Documentation Sections ### Getting Started + Quick start guides and tutorials for beginners + - Installation - First Steps - Basic Concepts - Hello World ### API Reference + Complete API documentation with examples + - Authentication - Endpoints - SDKs - Rate Limits ### Tutorials + Step-by-step guides for common use cases + - Game Development - Web Apps - Mobile Apps - AI Integration ### CLI Tools + Command-line interface documentation + - Installation - Commands - Configuration @@ -48,15 +56,19 @@ Command-line interface documentation ## Learning Resources ### Video Tutorials + Visual learning with step-by-step walkthroughs (50+ videos) ### Podcast Series + Deep dives into AeThex technology and strategy (20+ episodes) ### Code Examples + Production-ready snippets maintained by the platform team (100+ repos) ### Downloads + SDKs, design kits, and tooling for every platform ## Need Help? diff --git a/docs-migration/02-getting-started.md b/docs-migration/02-getting-started.md index 4cd136b1..ec06e203 100644 --- a/docs-migration/02-getting-started.md +++ b/docs-migration/02-getting-started.md @@ -5,20 +5,27 @@ ### Prerequisites #### AeThex Account + You will need an active AeThex account to access the dashboard, API console, and deployment tools. + - [Create account](/get-started) #### Node.js 18+ & npm + The AeThex CLI relies on modern Node runtimes. Verify your local toolchain before continuing. + - [Verify environment](https://nodejs.org/en/download) #### Project Workspace + Choose an empty directory for your new AeThex project or clone an existing team template. + - [Browse templates](/projects/new) ## Setup Steps ### 1. Install the CLI + The CLI bootstraps local projects, provisions cloud environments, and manages deployments. ```bash @@ -26,6 +33,7 @@ npm install -g aethex ``` ### 2. Authenticate + Log in with your AeThex credentials or paste a personal access token from the dashboard. ```bash @@ -33,6 +41,7 @@ aethex login ``` ### 3. Initialize a Project + Scaffold configuration, environment files, and example services for your team. ```bash @@ -40,6 +49,7 @@ aethex init studio-hub ``` ### 4. Start the Dev Server + Run the local environment with hot reloading, mocked services, and seeded sample data. ```bash @@ -49,26 +59,33 @@ npm run dev ## Deployment Checklist ### Configure Environments + Define staging and production targets, secrets, and automated health probes in aethex.config.ts. ### Provision Resources + Use `aethex deploy --preview` to create sandbox infrastructure before promoting to production. ### Enable Safeguards + Turn on role-based access controls, audit logging, and automated rollbacks from the dashboard. ## Platform Highlights ### Unified Dashboard + Monitor deployments, review incidents, and share announcements with stakeholders from a single console. ### Passport Identity + Give every builder a portable profile that aggregates achievements, verified skills, and mentorship history. ### Community and Mentorship + Pair emerging studios with advisors, host showcase events, and recruit collaborators through the community hub. ### Live Ops Analytics + Track real-time KPIs, automate status updates, and route alerts into your team's notification channels. ## Next Steps diff --git a/docs-migration/03-platform.md b/docs-migration/03-platform.md index a5cfeb3c..c49289d7 100644 --- a/docs-migration/03-platform.md +++ b/docs-migration/03-platform.md @@ -7,34 +7,45 @@ The AeThex platform provides comprehensive tools for building, deploying, and sc ## Platform Pillars ### Unified Dashboard + Monitor deployments, live metrics, and release health from a single control surface. Jump into incidents, approvals, and audit trails without leaving the workspace. + - [Visit dashboard](/dashboard) ### AeThex Passport + Give builders portable identity with verified skills, achievements, and cross-product progress synced to their Passport profile. + - [Open passport](/passport/me) ### Collaboration + Coordinate teams with realms, role-based access, and shared project templates. Invite talent directly from the community directory. + - [Meet the community](/community) ### Live Operations + Run live experiences with analytics, status pages, and automated incident workflows wired into AeThex services. + - [Check status](/status) ## Collaboration Workflows ### Onboard & Align + Welcome teammates through the guided onboarding flow, capture their interests, and assign the right mentorship programs from day one. Onboarding modules cover personal info, interests, and project preferences so teams ramp quickly. ### Build Together + Kick off projects with shared canvases, synced task boards, and CLI-generated environments. Use the realm switcher to target the correct workspace. In-app toasts notify collaborators when schema changes, deployments, or reviews need attention. ### Launch & Iterate + Promote builds through AeThex Deploy, track KPIs in the analytics feed, and publish release notes via the changelog tools. Community announcements and blog posts keep players and stakeholders in the loop automatically. @@ -42,30 +53,41 @@ Community announcements and blog posts keep players and stakeholders in the loop ## Experience Modules ### Social Feed + Share updates, prototypes, and patch notes in the feed. The composer supports media, Markdown, and rollout tags for targeted audiences. + - [Visit feed](/feed) ### Mentorship Programs + Match emerging studios with veteran advisors. Outline project goals, track sessions, and graduate mentors into full collaborators. + - [Explore mentorship](/mentorship) ### Community Showcases + Highlight standout creators, publish case studies, and route interested partners to booking forms right from the community page. + - [View community](/community) ### Profile Passport + Curate public achievements, experience levels, and verified skill badges. Use the passport summary widget across marketing surfaces. + - [View profile](/profile) ## Analytics and Operations ### Realtime Insights + Project metrics stream into dashboards with per-environment filters. Combine ingestion data with custom signals exposed via the REST API. ### Governed Data + Role-aware views ensure sensitive dashboards only appear for authorized users. Export snapshots or schedule recurring digests. ### Operational History + Every deployment, incident, and advisory event lands in the shared timeline so teams can audit changes months later. ## Governance and Security diff --git a/docs-migration/04-api-reference.md b/docs-migration/04-api-reference.md index 573d4916..f1c842f5 100644 --- a/docs-migration/04-api-reference.md +++ b/docs-migration/04-api-reference.md @@ -7,6 +7,7 @@ The REST API exposes every core capability of the AeThex platform. Authenticate ## Authentication ### OAuth Client Credentials Grant + Use the OAuth client credentials grant for service-to-service integrations: ```bash @@ -19,6 +20,7 @@ curl -X POST https://api.aethex.dev/v1/auth/token \ Prefer user-scoped access? Direct builders through the hosted OAuth consent screen and exchange their authorization code using the same endpoint. ### Request Example + Call the Projects endpoint with your Bearer token and inspect pagination headers for large result sets. ```javascript @@ -37,13 +39,13 @@ Responses include `X-RateLimit-Remaining` and `X-Request-ID` headers. Share the ## Core Endpoints -| Method | Path | Description | -|--------|------|-------------| -| POST | /v1/auth/token | Exchange client credentials for an access token | -| GET | /v1/projects | List projects the current identity can access | -| POST | /v1/projects | Create a project with environment defaults | -| GET | /v1/projects/{projectId}/metrics | Retrieve runtime metrics and usage breakdowns | -| POST | /v1/webhooks/verify | Validate webhook signatures from AeThex | +| Method | Path | Description | +| ------ | -------------------------------- | ----------------------------------------------- | +| POST | /v1/auth/token | Exchange client credentials for an access token | +| GET | /v1/projects | List projects the current identity can access | +| POST | /v1/projects | Create a project with environment defaults | +| GET | /v1/projects/{projectId}/metrics | Retrieve runtime metrics and usage breakdowns | +| POST | /v1/webhooks/verify | Validate webhook signatures from AeThex | ## Webhooks @@ -58,16 +60,17 @@ Subscribe to webhooks to react to changes in real time. ## Error Handling -| Code | Label | Hint | -|------|-------|------| -| 401 | Unauthorized | Verify the Bearer token and ensure it has not expired. | -| 403 | Forbidden | The identity lacks the required scope. Request the project-admin role. | -| 429 | Too Many Requests | Respect the rate limit headers or enable adaptive backoff via the SDK. | -| 503 | Service Unavailable | Retry with exponential backoff. AeThex dashboards surface ongoing maintenance windows. | +| Code | Label | Hint | +| ---- | ------------------- | -------------------------------------------------------------------------------------- | +| 401 | Unauthorized | Verify the Bearer token and ensure it has not expired. | +| 403 | Forbidden | The identity lacks the required scope. Request the project-admin role. | +| 429 | Too Many Requests | Respect the rate limit headers or enable adaptive backoff via the SDK. | +| 503 | Service Unavailable | Retry with exponential backoff. AeThex dashboards surface ongoing maintenance windows. | ## SDK Documentation Available SDKs: + - JavaScript/TypeScript - Python - Go diff --git a/docs-migration/05-tutorials.md b/docs-migration/05-tutorials.md index b2a12586..e47ea983 100644 --- a/docs-migration/05-tutorials.md +++ b/docs-migration/05-tutorials.md @@ -7,7 +7,9 @@ Step-by-step guides for common use cases and advanced topics. ## Featured Tutorials ### AeThex Platform Quick Start + Get up and running with AeThex in under 10 minutes. Learn the basics of project creation, navigation, and core features. + - **Type:** Video - **Duration:** 8 min - **Difficulty:** Beginner @@ -15,7 +17,9 @@ Get up and running with AeThex in under 10 minutes. Learn the basics of project - **Rating:** 4.9/5 (5,420 views) ### Project Setup and Configuration + Deep dive into project configuration, environment setup, and best practices for organizing your AeThex projects. + - **Type:** Article - **Duration:** 15 min - **Difficulty:** Beginner @@ -23,7 +27,9 @@ Deep dive into project configuration, environment setup, and best practices for - **Rating:** 4.8/5 (3,240 views) ### Working with the AeThex API + Comprehensive guide to integrating with AeThex APIs, authentication, rate limiting, and error handling. + - **Type:** Interactive - **Duration:** 25 min - **Difficulty:** Intermediate @@ -31,7 +37,9 @@ Comprehensive guide to integrating with AeThex APIs, authentication, rate limiti - **Rating:** 4.7/5 (2,156 views) ### Building Games with AeThex Tools + Step-by-step tutorial for creating your first game using AeThex development tools and frameworks. + - **Type:** Video - **Duration:** 45 min - **Difficulty:** Intermediate @@ -39,7 +47,9 @@ Step-by-step tutorial for creating your first game using AeThex development tool - **Rating:** 4.9/5 (4,567 views) ### Advanced Database Patterns + Learn advanced database design patterns, optimization techniques, and performance tuning for AeThex applications. + - **Type:** Article - **Duration:** 35 min - **Difficulty:** Advanced @@ -47,7 +57,9 @@ Learn advanced database design patterns, optimization techniques, and performanc - **Rating:** 4.6/5 (1,876 views) ### AI Integration Workshop + Hands-on workshop for integrating AI and machine learning capabilities into your AeThex projects. + - **Type:** Interactive - **Duration:** 60 min - **Difficulty:** Advanced @@ -72,18 +84,21 @@ Hands-on workshop for integrating AI and machine learning capabilities into your Follow structured learning paths based on your experience level and goals: ### Beginner Track + 1. Platform Quick Start 2. Project Setup and Configuration 3. First Project Launch 4. Basic API Integration ### Intermediate Track + 1. Advanced Configuration 2. API Deep Dive 3. Database Patterns 4. Real-time Features ### Advanced Track + 1. Microservices Architecture 2. Performance Optimization 3. Security Best Practices diff --git a/docs-migration/06-cli.md b/docs-migration/06-cli.md index b66c59c7..720539f0 100644 --- a/docs-migration/06-cli.md +++ b/docs-migration/06-cli.md @@ -6,13 +6,13 @@ The AeThex CLI automates local development, environment management, and producti ## Command Catalog -| Command | Description | Usage Notes | -|---------|-------------|------------| -| `aethex init [name]` | Scaffold a new project with opinionated defaults | Creates configuration, environments, and starter services | -| `aethex login` | Authenticate the CLI with your AeThex identity | Support for browser-based login and personal access tokens | -| `aethex deploy` | Build and deploy the current project | Runs tests, packages artifacts, and promotes to the target environment | -| `aethex env pull` | Sync environment variables and secrets | Keeps local .env files mirrored with the dashboard | -| `aethex pipeline logs` | Stream deployment logs in real time | Supports filters by environment, branch, or commit SHA | +| Command | Description | Usage Notes | +| ---------------------- | ------------------------------------------------ | ---------------------------------------------------------------------- | +| `aethex init [name]` | Scaffold a new project with opinionated defaults | Creates configuration, environments, and starter services | +| `aethex login` | Authenticate the CLI with your AeThex identity | Support for browser-based login and personal access tokens | +| `aethex deploy` | Build and deploy the current project | Runs tests, packages artifacts, and promotes to the target environment | +| `aethex env pull` | Sync environment variables and secrets | Keeps local .env files mirrored with the dashboard | +| `aethex pipeline logs` | Stream deployment logs in real time | Supports filters by environment, branch, or commit SHA | Run `aethex --help` for the full command tree. @@ -25,6 +25,7 @@ aethex dev ``` Features: + - Live reload on file changes - Mock API responses for testing - Local database snapshots @@ -47,6 +48,7 @@ aethex deploy ``` Features: + - Automated testing - Build artifact caching - Transactional deployments @@ -55,12 +57,15 @@ Features: ## Automation Tips ### GitHub Actions + Use the official AeThex GitHub Action to authenticate, run smoke tests, and deploy on every pull request merge. ### Audit Trails + Every CLI deployment emits audit events. Stream them into your SIEM through the webhooks integration. ### Rollbacks + Instantly revert to the previous stable release and notify collaborators: ```bash @@ -68,6 +73,7 @@ aethex deploy --rollback latest ``` ### Preview Environments + Spin up disposable stacks tied to feature branches for stakeholder reviews: ```bash @@ -85,13 +91,13 @@ export default { runtime: "node18", environments: { staging: { - domain: "staging.example.com" + domain: "staging.example.com", }, production: { - domain: "app.example.com" - } - } -} + domain: "app.example.com", + }, + }, +}; ``` ## Troubleshooting diff --git a/docs-migration/07-examples.md b/docs-migration/07-examples.md index 73457c28..c39778cd 100644 --- a/docs-migration/07-examples.md +++ b/docs-migration/07-examples.md @@ -7,6 +7,7 @@ Explore curated examples covering backend services, realtime overlays, automatio ## Featured Examples ### Server-side Matchmaking + Quickly assemble a matchmaking service that uses AeThex queues, weighting rules, and player telemetry streams. **Language:** TypeScript @@ -41,6 +42,7 @@ export async function enqueuePlayer(player) { ``` ### Realtime Activity Overlays + Broadcast live deployment and incident updates to your in-game HUD or operations dashboard using AeThex events. **Language:** React @@ -66,7 +68,10 @@ export function ActivityOverlay() {

Live activity

    {events.map((evt) => ( -
  • +
  • {evt.type} {evt.payload.summary}
  • @@ -78,6 +83,7 @@ export function ActivityOverlay() { ``` ### Workshop Automation + Automate the packaging and publishing of custom workshop content across AeThex environments using the CLI. **Language:** Shell @@ -101,19 +107,27 @@ echo "Workshop build published" ## Integration Ideas ### Commerce Hooks + Sync AeThex purchase events into your billing or CRM system using the webhook relay template. + - [View guide](/docs/api) ### Live Operations Dashboard + Combine project metrics, incident response playbooks, and player sentiment into a single React dashboard. + - [View guide](/docs/tutorials) ### Cross-platform Presence + Mirror AeThex voice and party status with your Discord or Slack community using the presence bridge sample. + - [View community](/community) ### Analytics Pipeline + Export gameplay events to your data warehouse with the managed streaming connectors. + - [View guide](/docs/getting-started) ## Getting Started diff --git a/docs-migration/08-integrations.md b/docs-migration/08-integrations.md index f632d52b..f0b34f5a 100644 --- a/docs-migration/08-integrations.md +++ b/docs-migration/08-integrations.md @@ -7,59 +7,69 @@ AeThex Integrations wrap third-party analytics, identity, payments, and live-ops ## Architecture Overview ### Runtime Flow + Integration manifests are stored in the AeThex Integrations service and synced across the dashboard and runtime. Client components resolve connector metadata through the shared API helpers, ensuring credentials and capability flags stay consistent with server state. During hydration the runtime mounts partner SDKs behind AeThex loaders, applying sandboxed execution where required. Use lifecycle hooks to emit analytics, hydrate widgets with scoped credentials, and gate access through the same role-based policies used elsewhere in the platform. ### Theming Hook + Use the integration theming utilities to adapt partner widgets to AeThex gradients, typography, and focus states. Tokens flow through CSS variables defined in `global.css`, so embeds stay visually aligned with dashboards and consumer apps. ## Connector Configuration ### Required Fields -| Field | Description | Default Value | -|-------|-------------|----------------| -| `key` | Unique identifier referenced across dashboards, APIs, and audit logs | "analytics-segment" | -| `category` | Integration taxonomy (analytics, identity, commerce, ops) | "analytics" | -| `capabilities` | Feature flags that unlock widgets, hooks, and pipelines | ['metrics', 'webhooks'] | -| `connectionMode` | Credential management (oauth, apiKey, managedVault) | "oauth" | -| `webhookEndpoint` | Optional callback URL for outbound events | "https://app.example.com/aethex/webhooks" | -| `uiEmbeds` | Declarative config for dashboard cards and modals | [{ surface: 'dashboard', placement: 'sidebar' }] | +| Field | Description | Default Value | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------ | +| `key` | Unique identifier referenced across dashboards, APIs, and audit logs | "analytics-segment" | +| `category` | Integration taxonomy (analytics, identity, commerce, ops) | "analytics" | +| `capabilities` | Feature flags that unlock widgets, hooks, and pipelines | ['metrics', 'webhooks'] | +| `connectionMode` | Credential management (oauth, apiKey, managedVault) | "oauth" | +| `webhookEndpoint` | Optional callback URL for outbound events | "https://app.example.com/aethex/webhooks" | +| `uiEmbeds` | Declarative config for dashboard cards and modals | [{ surface: 'dashboard', placement: 'sidebar' }] | ## Common Integrations ### Analytics + Connect your analytics platform to track KPIs and user behavior. Supported platforms: + - Segment - Mixpanel - Amplitude - Custom webhooks ### Identity & Auth + Integrate third-party identity providers for single sign-on. Supported platforms: + - Auth0 - Okta - Azure AD - Custom OAuth ### Payments & Commerce + Sync purchase events and manage subscriptions. Supported platforms: + - Stripe - Paddle - Gumroad - Custom webhooks ### Live Operations + Connect incident management and status page services. Supported platforms: + - PagerDuty - OpsGenie - Datadog @@ -68,17 +78,21 @@ Supported platforms: ## Troubleshooting ### OAuth Handshake Fails + Confirm the integration's redirect URI matches the value registered in the partner console. AeThex surfaces expose the required callback under Settings → Integrations. ### Webhook Retries Exhausted + Inspect delivery attempts in the Integrations dashboard. Update retry policies or verify your endpoint responds with a 2xx status within 10 seconds. ### Embedded Widget Styling + Override component tokens through the integration theme utilities or wrap the widget in a container that inherits AeThex gradient variables. ## Building Custom Integrations ### Step 1: Register Connector + Create a manifest in your integration service: ```json @@ -91,12 +105,15 @@ Create a manifest in your integration service: ``` ### Step 2: Implement OAuth Flow + Handle the OAuth handshake to securely store credentials. ### Step 3: Create UI Components + Build dashboard cards or modal embeds using the AeThex component library. ### Step 4: Setup Webhooks + Configure event forwarding for real-time data sync. ## Best Practices @@ -111,6 +128,7 @@ Configure event forwarding for real-time data sync. ## Support For integration support and questions: + - [View API documentation](/docs/api) - [Explore examples](/docs/examples) - [Join community](/community) diff --git a/docs-migration/09-curriculum.md b/docs-migration/09-curriculum.md index 69a14924..5ac1cdd1 100644 --- a/docs-migration/09-curriculum.md +++ b/docs-migration/09-curriculum.md @@ -9,80 +9,87 @@ Progress through sequenced modules that combine documentation, interactive labs, ### Foundation Level #### AeThex Foundations + Establish core mastery of the AeThex platform, from environment setup to shipping your first interactive experience. **Duration:** 2.5 hours **Level:** Foundation **Focus Areas:** + - Workspace onboarding - Project scaffolding - Passport + identity **Learning Goals:** + - Configure a production-ready AeThex project - Understand AeThex Passport, identity, and role models - Publish your first interactive deployment **Lessons:** + 1. **Platform Orientation** (Video - 20 min) - Tour the AeThex workspace, dashboards, and navigation patterns - 2. **Project Blueprint Setup** (Article - 35 min) - Create a new AeThex project, connect Supabase, and configure environments - 3. **Passport Fundamentals** (Interactive Lab - 40 min) - Implement profiles, achievements, and realm roles using AeThex Passport APIs - 4. **Launch Checklist** (Assignment - 35 min) - Deploy to Netlify/Vercel and validate observability before inviting users **Capstone:** Foundations Launch Sprint + - Ship a small but complete AeThex experience showcasing authentication, feed updates, and deployment - Assemble a two-week plan outlining features, success metrics, and deployment artifacts ### Builder Level #### Product Builder Track + Design and scale collaborative communities with AeThex real-time tooling, automations, and membership flows. **Duration:** 3 hours **Level:** Builder **Focus Areas:** + - Community feed - Workflow automations - Admin control center **Learning Goals:** + - Compose a modular community feed that reacts to Supabase events - Automate onboarding with roles, achievements, and curriculum progression - Operate with observability dashboards and admin tooling **Lessons:** + 1. **Community Signal Architecture** (Article - 45 min) - Use AeThex feed primitives and Supabase realtime to orchestrate community updates - 2. **Role & Realm Automation** (Interactive Lab - 50 min) - Configure workflows that auto-assign mentors, progress members, and trigger cascading events - 3. **Admin Operations** (Assignment - 45 min) - Build dashboards for moderation, analytics, and bulk member management ### Advanced Level #### Advanced Integration Track + Master complex architectures combining multiple AeThex services with custom backends and third-party platforms. **Duration:** 4+ hours **Level:** Advanced **Focus Areas:** + - Microservices patterns - Performance optimization - Security hardening **Learning Goals:** + - Design scalable event-driven systems - Implement security controls and compliance workflows - Optimize for cost and performance @@ -90,18 +97,22 @@ Master complex architectures combining multiple AeThex services with custom back ## Certification Paths ### AeThex Certified Builder + Complete Foundation and Builder modules + 2 capstone projects **Benefits:** + - Verified badge on Passport - Exclusive community recognition - Priority access to new features - Direct connection with the AeThex team ### AeThex Certified Architect + Complete all modules + Advanced capstone + architecture review **Benefits:** + - Premium Passport badge - Speaking opportunities at AeThex events - Consulting partnership eligibility @@ -110,15 +121,19 @@ Complete all modules + Advanced capstone + architecture review ## Learning Format Options ### Article + Self-paced written guides with code examples and references ### Video Walkthrough + Visual step-by-step tutorials with screen recordings ### Interactive Lab + Hands-on environment with pre-configured infrastructure and guided challenges ### Hands-on Assignment + Real-world project that builds on previous lessons ## Progress Tracking diff --git a/docs-migration/MIGRATION_GUIDE.md b/docs-migration/MIGRATION_GUIDE.md index 48cec41a..033605fd 100644 --- a/docs-migration/MIGRATION_GUIDE.md +++ b/docs-migration/MIGRATION_GUIDE.md @@ -50,12 +50,14 @@ code/docs-migration/ ## Step 2: Import Markdown Content ### Option A: Manual Import + 1. Open each Markdown file 2. Copy the content 3. Paste into corresponding Gitbook page 4. Format as needed (Gitbook handles most Markdown automatically) ### Option B: Gitbook Import API + Use the Gitbook API to programmatically import content: ```bash @@ -78,7 +80,7 @@ Add a banner and fallback behavior: ```typescript

    - šŸ“š These docs are being migrated to Gitbook. + šŸ“š These docs are being migrated to Gitbook. View the latest version → @@ -145,11 +147,13 @@ For automated updates, set up periodic syncs using the Gitbook API and GitHub Ac ## Step 8: Monitor and Adjust 1. **Week 1-2:** Keep both systems active + - Local React docs as primary - Gitbook as secondary - Gather user feedback 2. **Week 3-4:** Switch primary to Gitbook + - Update all links to point to Gitbook - Keep local docs as fallback redirect @@ -169,6 +173,7 @@ If issues arise, you can quickly rollback: ## API Credentials Your Gitbook API token has been provided: + - **API Token:** gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg - **Space Name:** AeThex Docs diff --git a/docs-migration/gitbook-api-script.js b/docs-migration/gitbook-api-script.js index 7508880b..cabb96d4 100644 --- a/docs-migration/gitbook-api-script.js +++ b/docs-migration/gitbook-api-script.js @@ -1,47 +1,61 @@ /** * Gitbook API Script - * + * * Use this script to push documentation content to your Gitbook workspace * via the Gitbook API. */ -const fs = require('fs'); -const path = require('path'); -const https = require('https'); +const fs = require("fs"); +const path = require("path"); +const https = require("https"); const API_TOKEN = process.env.GITBOOK_API_TOKEN; const SPACE_ID = process.env.GITBOOK_SPACE_ID; const PAGES = [ - { title: 'Welcome to AeThex Documentation', slug: 'overview', file: '01-overview.md' }, - { title: 'Getting Started', slug: 'getting-started', file: '02-getting-started.md' }, - { title: 'Platform Guide', slug: 'platform', file: '03-platform.md' }, - { title: 'API Reference', slug: 'api-reference', file: '04-api-reference.md' }, - { title: 'Tutorials', slug: 'tutorials', file: '05-tutorials.md' }, - { title: 'CLI Tools', slug: 'cli', file: '06-cli.md' }, - { title: 'Code Examples', slug: 'examples', file: '07-examples.md' }, - { title: 'Integrations', slug: 'integrations', file: '08-integrations.md' }, - { title: 'Curriculum', slug: 'curriculum', file: '09-curriculum.md' }, + { + title: "Welcome to AeThex Documentation", + slug: "overview", + file: "01-overview.md", + }, + { + title: "Getting Started", + slug: "getting-started", + file: "02-getting-started.md", + }, + { title: "Platform Guide", slug: "platform", file: "03-platform.md" }, + { + title: "API Reference", + slug: "api-reference", + file: "04-api-reference.md", + }, + { title: "Tutorials", slug: "tutorials", file: "05-tutorials.md" }, + { title: "CLI Tools", slug: "cli", file: "06-cli.md" }, + { title: "Code Examples", slug: "examples", file: "07-examples.md" }, + { title: "Integrations", slug: "integrations", file: "08-integrations.md" }, + { title: "Curriculum", slug: "curriculum", file: "09-curriculum.md" }, ]; async function makeRequest(method, path, body = null) { return new Promise((resolve, reject) => { const options = { - hostname: 'api.gitbook.com', + hostname: "api.gitbook.com", port: 443, path: `/v1${path}`, method, headers: { Authorization: `Bearer ${API_TOKEN}`, - 'Content-Type': 'application/json', - 'User-Agent': 'AeThex-Docs-Migration', + "Content-Type": "application/json", + "User-Agent": "AeThex-Docs-Migration", }, }; const req = https.request(options, (res) => { - let data = ''; - res.on('data', (chunk) => { data += chunk; }); - res.on('end', () => { + let data = ""; + res.on("data", (chunk) => { + data += chunk; + }); + res.on("end", () => { try { resolve({ status: res.statusCode, @@ -54,17 +68,19 @@ async function makeRequest(method, path, body = null) { }); }); - req.on('error', reject); + req.on("error", reject); if (body) req.write(JSON.stringify(body)); req.end(); }); } async function syncDocs() { - console.log('šŸš€ Starting documentation sync to Gitbook...\n'); + console.log("šŸš€ Starting documentation sync to Gitbook...\n"); if (!API_TOKEN || !SPACE_ID) { - console.error('āŒ Missing environment variables: GITBOOK_API_TOKEN or GITBOOK_SPACE_ID'); + console.error( + "āŒ Missing environment variables: GITBOOK_API_TOKEN or GITBOOK_SPACE_ID", + ); process.exit(1); } @@ -80,7 +96,7 @@ async function syncDocs() { continue; } - const content = fs.readFileSync(filePath, 'utf-8'); + const content = fs.readFileSync(filePath, "utf-8"); console.log(` Updating page: ${page.title}...`); const body = { @@ -88,7 +104,11 @@ async function syncDocs() { description: `AeThex Documentation - ${page.title}`, }; - const response = await makeRequest('POST', `/spaces/${SPACE_ID}/pages`, body); + const response = await makeRequest( + "POST", + `/spaces/${SPACE_ID}/pages`, + body, + ); if (response.status >= 200 && response.status < 300) { console.log(` āœ“ ${page.title} updated successfully`); @@ -105,9 +125,11 @@ async function syncDocs() { } } - console.log(`\nāœ… Sync complete: ${successful} successful, ${failed} failed\n`); + console.log( + `\nāœ… Sync complete: ${successful} successful, ${failed} failed\n`, + ); process.exit(failed > 0 ? 1 : 0); } -const action = process.argv[2] || 'sync'; -if (action === 'sync') syncDocs(); +const action = process.argv[2] || "sync"; +if (action === "sync") syncDocs(); diff --git a/netlify/functions/sync-docs-to-gitbook.ts b/netlify/functions/sync-docs-to-gitbook.ts index af9f2b89..2d2fbe79 100644 --- a/netlify/functions/sync-docs-to-gitbook.ts +++ b/netlify/functions/sync-docs-to-gitbook.ts @@ -1,29 +1,47 @@ -import { Handler } from '@netlify/functions'; -import { readFileSync } from 'fs'; -import { join } from 'path'; +import { Handler } from "@netlify/functions"; +import { readFileSync } from "fs"; +import { join } from "path"; -const GITBOOK_API_TOKEN = process.env.GITBOOK_API_TOKEN || 'gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg'; -const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID || '37ITJTgjD56eN3ZI5qtt'; +const GITBOOK_API_TOKEN = + process.env.GITBOOK_API_TOKEN || + "gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg"; +const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID || "37ITJTgjD56eN3ZI5qtt"; const PAGES = [ - { title: 'Welcome to AeThex Documentation', slug: 'overview', file: '01-overview.md' }, - { title: 'Getting Started', slug: 'getting-started', file: '02-getting-started.md' }, - { title: 'Platform Guide', slug: 'platform', file: '03-platform.md' }, - { title: 'API Reference', slug: 'api-reference', file: '04-api-reference.md' }, - { title: 'Tutorials', slug: 'tutorials', file: '05-tutorials.md' }, - { title: 'CLI Tools', slug: 'cli', file: '06-cli.md' }, - { title: 'Code Examples', slug: 'examples', file: '07-examples.md' }, - { title: 'Integrations', slug: 'integrations', file: '08-integrations.md' }, - { title: 'Curriculum', slug: 'curriculum', file: '09-curriculum.md' }, + { + title: "Welcome to AeThex Documentation", + slug: "overview", + file: "01-overview.md", + }, + { + title: "Getting Started", + slug: "getting-started", + file: "02-getting-started.md", + }, + { title: "Platform Guide", slug: "platform", file: "03-platform.md" }, + { + title: "API Reference", + slug: "api-reference", + file: "04-api-reference.md", + }, + { title: "Tutorials", slug: "tutorials", file: "05-tutorials.md" }, + { title: "CLI Tools", slug: "cli", file: "06-cli.md" }, + { title: "Code Examples", slug: "examples", file: "07-examples.md" }, + { title: "Integrations", slug: "integrations", file: "08-integrations.md" }, + { title: "Curriculum", slug: "curriculum", file: "09-curriculum.md" }, ]; -async function makeRequest(method: string, path: string, body?: any): Promise { +async function makeRequest( + method: string, + path: string, + body?: any, +): Promise { const response = await fetch(`https://api.gitbook.com/v1${path}`, { method, headers: { Authorization: `Bearer ${GITBOOK_API_TOKEN}`, - 'Content-Type': 'application/json', - 'User-Agent': 'AeThex-Docs-Sync', + "Content-Type": "application/json", + "User-Agent": "AeThex-Docs-Sync", }, body: body ? JSON.stringify(body) : undefined, }); @@ -37,13 +55,13 @@ async function makeRequest(method: string, path: string, body?: any): Promise { // Basic auth check - const authHeader = event.headers['authorization']; - const expectedAuth = `Bearer ${process.env.SYNC_TOKEN || 'aethex-docs-sync'}`; + const authHeader = event.headers["authorization"]; + const expectedAuth = `Bearer ${process.env.SYNC_TOKEN || "aethex-docs-sync"}`; if (authHeader !== expectedAuth) { return { statusCode: 401, - body: JSON.stringify({ error: 'Unauthorized' }), + body: JSON.stringify({ error: "Unauthorized" }), }; } @@ -55,20 +73,31 @@ const handler: Handler = async (event, context) => { for (const page of PAGES) { try { // Read markdown file from docs-migration directory - const filePath = join(process.cwd(), '..', '..', 'docs-migration', page.file); - const content = readFileSync(filePath, 'utf-8'); + const filePath = join( + process.cwd(), + "..", + "..", + "docs-migration", + page.file, + ); + const content = readFileSync(filePath, "utf-8"); const body = { title: page.title, description: `AeThex Documentation - ${page.title}`, }; - await makeRequest('POST', `/spaces/${GITBOOK_SPACE_ID}/pages`, body); - results.push({ page: page.title, status: 'success' }); + await makeRequest("POST", `/spaces/${GITBOOK_SPACE_ID}/pages`, body); + results.push({ page: page.title, status: "success" }); successful++; } catch (error) { - const errorMessage = error instanceof Error ? error.message : 'Unknown error'; - results.push({ page: page.title, status: 'failed', error: errorMessage }); + const errorMessage = + error instanceof Error ? error.message : "Unknown error"; + results.push({ + page: page.title, + status: "failed", + error: errorMessage, + }); failed++; } } @@ -76,14 +105,15 @@ const handler: Handler = async (event, context) => { return { statusCode: 200, body: JSON.stringify({ - message: 'Sync complete', + message: "Sync complete", successful, failed, results, }), }; } catch (error) { - const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + const errorMessage = + error instanceof Error ? error.message : "Unknown error"; return { statusCode: 500, body: JSON.stringify({ error: errorMessage }),