Prettier format pending files

This commit is contained in:
Builder.io 2025-11-05 02:45:56 +00:00
parent dea4a6c9ed
commit 7fcc818a1c
15 changed files with 395 additions and 157 deletions

View file

@ -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<any> {
async function makeRequest(
method: string,
path: string,
body?: any,
): Promise<any> {
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<an
return response.json();
}
export default async function handler(
req: VercelRequest,
res: VercelResponse,
) {
export default async function handler(req: VercelRequest, res: VercelResponse) {
// Only allow POST requests
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method not allowed' });
if (req.method !== "POST") {
return res.status(405).json({ error: "Method not allowed" });
}
try {
@ -52,8 +67,8 @@ export default async function handler(
for (const page of PAGES) {
try {
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,
@ -63,12 +78,17 @@ export default async function handler(
},
};
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++;
}
@ -77,13 +97,14 @@ export default async function handler(
}
return res.status(200).json({
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 res.status(500).json({ error: errorMessage });
}
}

View file

@ -197,18 +197,26 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
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;
}

View file

@ -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() {
<div className="mb-12">
<div className="flex items-center gap-3 mb-4">
<BookOpen className="h-8 w-8 text-purple-400" />
<h1 className="text-4xl font-bold text-white">Documentation Sync</h1>
<h1 className="text-4xl font-bold text-white">
Documentation Sync
</h1>
</div>
<p className="text-gray-300 text-lg max-w-2xl">
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.
</p>
</div>
{/* Sync Card */}
<Card className="bg-slate-800/50 border-slate-700 mb-8">
<CardHeader>
<CardTitle className="text-white">Sync Documentation to Gitbook</CardTitle>
<CardTitle className="text-white">
Sync Documentation to Gitbook
</CardTitle>
<CardDescription className="text-gray-400">
This will push all 9 documentation pages to your Gitbook workspace
This will push all 9 documentation pages to your Gitbook
workspace
</CardDescription>
</CardHeader>
<CardContent className="space-y-6">
@ -127,19 +139,25 @@ export default function DocsSync() {
{/* Results */}
{result && (
<Card className={`${result.failed === 0 ? 'bg-emerald-900/20 border-emerald-500/40' : 'bg-slate-800/50 border-slate-700'} mb-8`}>
<Card
className={`${result.failed === 0 ? "bg-emerald-900/20 border-emerald-500/40" : "bg-slate-800/50 border-slate-700"} mb-8`}
>
<CardHeader>
<div className="flex items-center justify-between">
<CardTitle className="text-white">Sync Results</CardTitle>
<div className="flex gap-4">
<div className="text-right">
<p className="text-sm text-gray-400">Successful</p>
<p className="text-2xl font-bold text-emerald-400">{result.successful}</p>
<p className="text-2xl font-bold text-emerald-400">
{result.successful}
</p>
</div>
{result.failed > 0 && (
<div className="text-right">
<p className="text-sm text-gray-400">Failed</p>
<p className="text-2xl font-bold text-red-400">{result.failed}</p>
<p className="text-2xl font-bold text-red-400">
{result.failed}
</p>
</div>
)}
</div>
@ -148,9 +166,12 @@ export default function DocsSync() {
<CardContent>
<div className="space-y-2">
{result.results.map((item, index) => (
<div key={index} className="flex items-center justify-between p-3 bg-slate-900/50 rounded-lg">
<div
key={index}
className="flex items-center justify-between p-3 bg-slate-900/50 rounded-lg"
>
<div className="flex items-center gap-3">
{item.status === 'success' ? (
{item.status === "success" ? (
<CheckCircle2 className="h-5 w-5 text-emerald-400" />
) : (
<AlertCircle className="h-5 w-5 text-red-400" />
@ -159,9 +180,9 @@ export default function DocsSync() {
</div>
<Badge
className={
item.status === 'success'
? 'bg-emerald-500/20 text-emerald-200'
: 'bg-red-500/20 text-red-200'
item.status === "success"
? "bg-emerald-500/20 text-emerald-200"
: "bg-red-500/20 text-red-200"
}
>
{item.status}
@ -173,7 +194,8 @@ export default function DocsSync() {
{result.failed === 0 && (
<div className="mt-6 p-4 bg-emerald-500/10 border border-emerald-500/40 rounded-lg">
<p className="text-emerald-200 text-sm">
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
</p>
</div>
)}
@ -190,13 +212,21 @@ export default function DocsSync() {
<div>
<p className="font-semibold text-white mb-2">Before syncing:</p>
<ol className="list-decimal list-inside space-y-1 text-sm">
<li>Verify Vercel environment variables are set:
<code className="bg-black/40 px-2 py-1 rounded text-purple-200 ml-2">GITBOOK_API_TOKEN</code>
<li>
Verify Vercel environment variables are set:
<code className="bg-black/40 px-2 py-1 rounded text-purple-200 ml-2">
GITBOOK_API_TOKEN
</code>
and
<code className="bg-black/40 px-2 py-1 rounded text-purple-200 ml-2">GITBOOK_SPACE_ID</code>
<code className="bg-black/40 px-2 py-1 rounded text-purple-200 ml-2">
GITBOOK_SPACE_ID
</code>
</li>
<li>Ensure your Gitbook workspace "AeThex Docs" is ready</li>
<li>Have pages created in Gitbook (Overview, Getting Started, etc.)</li>
<li>
Have pages created in Gitbook (Overview, Getting Started,
etc.)
</li>
</ol>
</div>

View file

@ -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?

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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() {
<h3 className="text-sm font-semibold text-purple-200">Live activity</h3>
<ul className="mt-3 space-y-2 text-xs text-gray-200">
{events.map((evt) => (
<li key={evt.id} className="rounded border border-purple-500/20 bg-purple-900/20 p-2">
<li
key={evt.id}
className="rounded border border-purple-500/20 bg-purple-900/20 p-2"
>
<span className="font-mono text-purple-300">{evt.type}</span>
<span className="ml-2 text-gray-400">{evt.payload.summary}</span>
</li>
@ -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

View file

@ -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)

View file

@ -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

View file

@ -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
@ -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

View file

@ -5,43 +5,57 @@
* 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();

View file

@ -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<any> {
async function makeRequest(
method: string,
path: string,
body?: any,
): Promise<any> {
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<an
const handler: Handler = async (event, context) => {
// 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 }),