Create overview.md documentation file
cgen-b67843f5192b4e498eb63ce76a075e31
This commit is contained in:
parent
0874363a28
commit
a9c9b39ca4
12 changed files with 1293 additions and 0 deletions
67
docs-migration/01-overview.md
Normal file
67
docs-migration/01-overview.md
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Welcome to AeThex Documentation
|
||||
|
||||
## Introduction
|
||||
|
||||
Everything you need to build, deploy, and scale amazing projects with AeThex. Get started with our guides, explore our APIs, and learn from comprehensive tutorials.
|
||||
|
||||
## Quick Links
|
||||
|
||||
- [Get Started](/docs/getting-started) - Launch your first AeThex project in under 30 minutes
|
||||
- [Platform Guide](/docs/platform) - Understand dashboard, passport, and collaboration
|
||||
- [API Reference](/docs/api) - Complete API documentation with examples
|
||||
- [Tutorials](/docs/tutorials) - Step-by-step guides for common use cases
|
||||
- [CLI Tools](/docs/cli) - Operate AeThex from the command line
|
||||
- [Code Examples](/docs/examples) - Production-ready patterns
|
||||
- [Integrations](/docs/integrations) - Connect partner services to AeThex
|
||||
- [Curriculum](/docs/curriculum) - Structured learning paths
|
||||
|
||||
## 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
|
||||
- Scripts
|
||||
|
||||
## 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?
|
||||
|
||||
Our documentation team updates these guides weekly. If you're looking for tailored onboarding, architecture reviews, or migration support, reach out and we'll connect you with the right experts.
|
||||
|
||||
- [Contact Support](/support)
|
||||
- [Join the Community](/community)
|
||||
81
docs-migration/02-getting-started.md
Normal file
81
docs-migration/02-getting-started.md
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
# Getting Started
|
||||
|
||||
## Launch your first AeThex project in under 30 minutes
|
||||
|
||||
### 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
|
||||
npm install -g aethex
|
||||
```
|
||||
|
||||
### 2. Authenticate
|
||||
Log in with your AeThex credentials or paste a personal access token from the dashboard.
|
||||
|
||||
```bash
|
||||
aethex login
|
||||
```
|
||||
|
||||
### 3. Initialize a Project
|
||||
Scaffold configuration, environment files, and example services for your team.
|
||||
|
||||
```bash
|
||||
aethex init studio-hub
|
||||
```
|
||||
|
||||
### 4. Start the Dev Server
|
||||
Run the local environment with hot reloading, mocked services, and seeded sample data.
|
||||
|
||||
```bash
|
||||
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
|
||||
|
||||
- [Platform Walkthrough](/dashboard) - Tour the dashboard
|
||||
- [Platform Documentation](/docs/platform) - High-level platform overview
|
||||
- [API Reference](/docs/api) - Review authentication flows
|
||||
- [Tutorial Library](/docs/tutorials) - Follow guided builds
|
||||
- [Community Support](/community) - Ask questions and find mentors
|
||||
- [Integrations Playbook](/docs/integrations) - Extend with partner tools
|
||||
82
docs-migration/03-platform.md
Normal file
82
docs-migration/03-platform.md
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
# Platform Guide
|
||||
|
||||
## AeThex Platform Features
|
||||
|
||||
The AeThex platform provides comprehensive tools for building, deploying, and scaling applications with built-in collaboration and community features.
|
||||
|
||||
## 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.
|
||||
|
||||
## 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
|
||||
|
||||
- OAuth connections let studios link third-party identity providers for single sign-on and group provisioning.
|
||||
- Realm switcher enforces scoped access to projects, assets, and financial data.
|
||||
- Compliance exports bundle audit logs, access reviews, and deployment manifests for regulatory submissions.
|
||||
- Automated alerts surface risk when environments drift or policy checks fail during deploys.
|
||||
|
||||
## Related Resources
|
||||
|
||||
- [Explore onboarding](/onboarding) - Review builder flow
|
||||
- [Configure OAuth](/docs/api#authentication) - Manage identity
|
||||
- [View platform tour](/dashboard) - Guided walkthrough
|
||||
77
docs-migration/04-api-reference.md
Normal file
77
docs-migration/04-api-reference.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# API Reference
|
||||
|
||||
## Integrate programmatically with the AeThex API
|
||||
|
||||
The REST API exposes every core capability of the AeThex platform. Authenticate with OAuth 2.1 or personal access tokens, call idempotent endpoints, and subscribe to webhooks to react to changes in real time.
|
||||
|
||||
## Authentication
|
||||
|
||||
### OAuth Client Credentials Grant
|
||||
Use the OAuth client credentials grant for service-to-service integrations:
|
||||
|
||||
```bash
|
||||
curl -X POST https://api.aethex.dev/v1/auth/token \
|
||||
-u CLIENT_ID:CLIENT_SECRET \
|
||||
-d "grant_type=client_credentials" \
|
||||
-d "scope=projects:read deployments:write"
|
||||
```
|
||||
|
||||
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
|
||||
fetch("https://api.aethex.dev/v1/projects?page=1&limit=25", {
|
||||
headers: {
|
||||
Authorization: "Bearer ${TOKEN}",
|
||||
"AeThex-Environment": "production",
|
||||
},
|
||||
}).then(async (res) => {
|
||||
if (!res.ok) throw new Error(await res.text());
|
||||
console.log("Projects", await res.json());
|
||||
});
|
||||
```
|
||||
|
||||
Responses include `X-RateLimit-Remaining` and `X-Request-ID` headers. Share the request ID when contacting support for faster triage.
|
||||
|
||||
## 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 |
|
||||
|
||||
## Webhooks
|
||||
|
||||
Subscribe to webhooks to react to changes in real time.
|
||||
|
||||
### Webhook Events
|
||||
|
||||
- **deployment.succeeded** - Triggered when a deployment pipeline completes successfully with promoted build artifacts.
|
||||
- **deployment.failed** - Sent when a pipeline fails. Includes failure stage, summary, and recommended remediation steps.
|
||||
- **incident.opened** - Raised when monitoring detects outages or SLA breaches in production environments.
|
||||
- **member.invited** - Notify downstream systems when a collaborator invitation is created or accepted.
|
||||
|
||||
## 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. |
|
||||
|
||||
## SDK Documentation
|
||||
|
||||
Available SDKs:
|
||||
- JavaScript/TypeScript
|
||||
- Python
|
||||
- Go
|
||||
- Java
|
||||
- Ruby
|
||||
|
||||
For detailed SDK documentation, see the respective package documentation.
|
||||
90
docs-migration/05-tutorials.md
Normal file
90
docs-migration/05-tutorials.md
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
# Tutorials
|
||||
|
||||
## Documentation Tutorials
|
||||
|
||||
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
|
||||
- **Author:** AeThex Team
|
||||
- **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
|
||||
- **Author:** Sarah Chen
|
||||
- **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
|
||||
- **Author:** Alex Rodriguez
|
||||
- **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
|
||||
- **Author:** Mike Johnson
|
||||
- **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
|
||||
- **Author:** Emma Wilson
|
||||
- **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
|
||||
- **Author:** Dr. Lisa Park
|
||||
- **Rating:** 4.8/5 (2,943 views)
|
||||
- **Status:** NEW
|
||||
|
||||
## Tutorial Categories
|
||||
|
||||
- Getting Started
|
||||
- Setup
|
||||
- API Integration
|
||||
- Game Development
|
||||
- Database
|
||||
- AI/ML
|
||||
- Performance Optimization
|
||||
- Security
|
||||
- Deployment
|
||||
|
||||
## Learning Paths
|
||||
|
||||
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
|
||||
4. Custom Integrations
|
||||
101
docs-migration/06-cli.md
Normal file
101
docs-migration/06-cli.md
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
# CLI Tools
|
||||
|
||||
## Operate AeThex from the command line
|
||||
|
||||
The AeThex CLI automates local development, environment management, and production deployments. It is built with stability in mind, featuring transactional deploys, shell-friendly output, and native support for Linux, macOS, and Windows.
|
||||
|
||||
## 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 |
|
||||
|
||||
Run `aethex --help` for the full command tree.
|
||||
|
||||
## Local Development
|
||||
|
||||
Develop and test locally with hot reloading, mocked services, and seeded sample data.
|
||||
|
||||
```bash
|
||||
aethex dev
|
||||
```
|
||||
|
||||
Features:
|
||||
- Live reload on file changes
|
||||
- Mock API responses for testing
|
||||
- Local database snapshots
|
||||
- Development SSL certificates
|
||||
|
||||
## Environment Management
|
||||
|
||||
Pull secrets and configuration from your AeThex dashboard:
|
||||
|
||||
```bash
|
||||
aethex env pull
|
||||
```
|
||||
|
||||
## Production Deployment
|
||||
|
||||
Build and deploy to production environments:
|
||||
|
||||
```bash
|
||||
aethex deploy
|
||||
```
|
||||
|
||||
Features:
|
||||
- Automated testing
|
||||
- Build artifact caching
|
||||
- Transactional deployments
|
||||
- Automatic rollback on failure
|
||||
|
||||
## 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
|
||||
aethex deploy --rollback latest
|
||||
```
|
||||
|
||||
### Preview Environments
|
||||
Spin up disposable stacks tied to feature branches for stakeholder reviews:
|
||||
|
||||
```bash
|
||||
aethex preview create
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Configure your project in `aethex.config.ts`:
|
||||
|
||||
```typescript
|
||||
export default {
|
||||
name: "my-project",
|
||||
region: "us-central",
|
||||
runtime: "node18",
|
||||
environments: {
|
||||
staging: {
|
||||
domain: "staging.example.com"
|
||||
},
|
||||
production: {
|
||||
domain: "app.example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Check logs with `aethex pipeline logs`
|
||||
- Verify authentication with `aethex whoami`
|
||||
- Test configuration with `aethex validate`
|
||||
133
docs-migration/07-examples.md
Normal file
133
docs-migration/07-examples.md
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
# Code Examples
|
||||
|
||||
## Production-ready patterns you can copy
|
||||
|
||||
Explore curated examples covering backend services, realtime overlays, automation scripts, and workflow integrations. Each project includes source code, detailed comments, and deployment instructions.
|
||||
|
||||
## Featured Examples
|
||||
|
||||
### Server-side Matchmaking
|
||||
Quickly assemble a matchmaking service that uses AeThex queues, weighting rules, and player telemetry streams.
|
||||
|
||||
**Language:** TypeScript
|
||||
**Repository:** [aethex/examples/matchmaking-service](https://github.com/aethex/examples/tree/main/matchmaking-service)
|
||||
|
||||
```typescript
|
||||
import { createQueue, matchPlayers } from "@aethex/matchmaking";
|
||||
|
||||
const queue = await createQueue({
|
||||
region: "us-central",
|
||||
size: 4,
|
||||
constraints: [
|
||||
{ field: "skillRating", tolerance: 120 },
|
||||
{ field: "latency", max: 90 },
|
||||
],
|
||||
});
|
||||
|
||||
export async function enqueuePlayer(player) {
|
||||
await queue.enqueue(player.id, {
|
||||
skillRating: player.mmr,
|
||||
latency: player.ping,
|
||||
});
|
||||
|
||||
const match = await matchPlayers(queue);
|
||||
if (match) {
|
||||
await queue.lock(match.id);
|
||||
return match;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
```
|
||||
|
||||
### Realtime Activity Overlays
|
||||
Broadcast live deployment and incident updates to your in-game HUD or operations dashboard using AeThex events.
|
||||
|
||||
**Language:** React
|
||||
**Repository:** [aethex/examples/realtime-overlay](https://github.com/aethex/examples/tree/main/realtime-overlay)
|
||||
|
||||
```javascript
|
||||
import { useEffect, useState } from "react";
|
||||
import { subscribe } from "@aethex/events";
|
||||
|
||||
export function ActivityOverlay() {
|
||||
const [events, setEvents] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = subscribe("deployment.*", (event) => {
|
||||
setEvents((current) => [event, ...current].slice(0, 5));
|
||||
});
|
||||
|
||||
return () => unsubscribe();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<aside className="rounded-xl border border-purple-500/40 bg-black/60 p-4">
|
||||
<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">
|
||||
<span className="font-mono text-purple-300">{evt.type}</span>
|
||||
<span className="ml-2 text-gray-400">{evt.payload.summary}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
### Workshop Automation
|
||||
Automate the packaging and publishing of custom workshop content across AeThex environments using the CLI.
|
||||
|
||||
**Language:** Shell
|
||||
**Repository:** [aethex/examples/workshop-automation](https://github.com/aethex/examples/tree/main/workshop-automation)
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
WORKSPACE=${1:-"mods"}
|
||||
|
||||
npm install
|
||||
aethex login --token "$AETHEX_TOKEN"
|
||||
|
||||
aethex workshop package "$WORKSPACE" --out dist/
|
||||
aethex deploy --environment production --artifact dist/workshop.tgz
|
||||
|
||||
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
|
||||
|
||||
1. Visit the [GitHub repository](https://github.com/aethex/examples)
|
||||
2. Clone the example you want to explore
|
||||
3. Follow the README instructions
|
||||
4. Customize for your use case
|
||||
|
||||
## Contributing Examples
|
||||
|
||||
Have a great example? Submit it to the community!
|
||||
|
||||
- Fork the repository
|
||||
- Add your example with detailed comments
|
||||
- Submit a pull request
|
||||
- Your example will be featured in our library
|
||||
116
docs-migration/08-integrations.md
Normal file
116
docs-migration/08-integrations.md
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
# Integrations
|
||||
|
||||
## Connecting partner services to AeThex
|
||||
|
||||
AeThex Integrations wrap third-party analytics, identity, payments, and live-ops tooling behind a consistent runtime, security model, and visual system. Use this guide to register new connectors, surface partner UI in product flows, and automate data exchange without hand-rolled plumbing.
|
||||
|
||||
## 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' }] |
|
||||
|
||||
## 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
|
||||
- Custom webhooks
|
||||
|
||||
## 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
|
||||
{
|
||||
"key": "my-integration",
|
||||
"category": "analytics",
|
||||
"capabilities": ["metrics", "webhooks"],
|
||||
"connectionMode": "oauth"
|
||||
}
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
- Always validate webhook signatures
|
||||
- Use managed vaults for sensitive credentials
|
||||
- Implement rate limiting for API calls
|
||||
- Test integrations in preview environments first
|
||||
- Monitor webhook delivery and retry failures
|
||||
- Document your integration with examples
|
||||
|
||||
## Support
|
||||
|
||||
For integration support and questions:
|
||||
- [View API documentation](/docs/api)
|
||||
- [Explore examples](/docs/examples)
|
||||
- [Join community](/community)
|
||||
144
docs-migration/09-curriculum.md
Normal file
144
docs-migration/09-curriculum.md
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
# Curriculum
|
||||
|
||||
## Structured Learning Paths
|
||||
|
||||
Progress through sequenced modules that combine documentation, interactive labs, and project-based assignments. Graduate with certification and unlock new opportunities.
|
||||
|
||||
## Learning Modules
|
||||
|
||||
### 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
|
||||
|
||||
## 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
|
||||
- Leadership role in community
|
||||
|
||||
## 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
|
||||
|
||||
- Track your progress through modules
|
||||
- View completed lessons and remaining assignments
|
||||
- Earn badges and certificates
|
||||
- Share your achievements on your Passport
|
||||
- Connect with mentors and cohort members
|
||||
|
||||
## Support
|
||||
|
||||
- Ask questions in lesson forums
|
||||
- Get feedback on capstone projects
|
||||
- One-on-one mentoring available for advanced tracks
|
||||
- Community study groups
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. Start with [AeThex Foundations](#aethex-foundations) if you're new to the platform
|
||||
2. Progress to [Product Builder Track](#product-builder-track) to build communities
|
||||
3. Advance to specialized tracks based on your goals
|
||||
4. Earn certifications and unlock new opportunities
|
||||
201
docs-migration/MIGRATION_GUIDE.md
Normal file
201
docs-migration/MIGRATION_GUIDE.md
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
# AeThex Documentation Migration Guide
|
||||
|
||||
## Overview
|
||||
|
||||
This guide explains how to migrate the AeThex documentation from the React-based local docs system to Gitbook.
|
||||
|
||||
## Migration Structure
|
||||
|
||||
The migration package includes:
|
||||
|
||||
1. **Markdown Files** - 9 documentation pages in Markdown format
|
||||
2. **JSON Structure** - Structured data for programmatic import
|
||||
3. **Implementation Guide** - Instructions for local fallback system
|
||||
4. **Gitbook API Guide** - How to push content to Gitbook
|
||||
|
||||
### Files Included
|
||||
|
||||
```
|
||||
code/docs-migration/
|
||||
├── 01-overview.md # Welcome to AeThex Documentation
|
||||
├── 02-getting-started.md # Getting Started
|
||||
├── 03-platform.md # Platform Guide
|
||||
├── 04-api-reference.md # API Reference
|
||||
├── 05-tutorials.md # Tutorials
|
||||
├── 06-cli.md # CLI Tools
|
||||
├── 07-examples.md # Code Examples
|
||||
├── 08-integrations.md # Integrations
|
||||
├── 09-curriculum.md # Curriculum
|
||||
├── MIGRATION_GUIDE.md # This file
|
||||
├── docs-structure.json # Gitbook structure definition
|
||||
├── migration-implementation.ts # Implementation helper
|
||||
└── gitbook-api-script.js # Script to push to Gitbook
|
||||
```
|
||||
|
||||
## Step 1: Prepare Gitbook Workspace
|
||||
|
||||
1. Go to your Gitbook workspace "AeThex Docs"
|
||||
2. Create a new space or use existing one
|
||||
3. Create the following page structure:
|
||||
- Overview
|
||||
- Getting Started
|
||||
- Platform
|
||||
- API Reference
|
||||
- Tutorials
|
||||
- CLI Tools
|
||||
- Code Examples
|
||||
- Integrations
|
||||
- Curriculum
|
||||
|
||||
## 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
|
||||
# Set up environment variables
|
||||
export GITBOOK_API_TOKEN=gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg
|
||||
export GITBOOK_SPACE_ID=your-space-id
|
||||
|
||||
# Run the sync script
|
||||
node code/docs-migration/gitbook-api-script.js sync
|
||||
```
|
||||
|
||||
## Step 3: Set Up Fallback System (Local)
|
||||
|
||||
Keep your local React docs as a fallback while you confirm everything is synced:
|
||||
|
||||
### Update DocsLayout.tsx
|
||||
|
||||
Add a banner and fallback behavior:
|
||||
|
||||
```typescript
|
||||
<div className="mb-4 rounded-lg border border-yellow-500/40 bg-yellow-900/20 p-4">
|
||||
<p className="text-sm text-yellow-200">
|
||||
📚 These docs are being migrated to Gitbook.
|
||||
<a href="https://docs.aethex.tech" className="underline">
|
||||
View the latest version →
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Add Gitbook Embed (Optional)
|
||||
|
||||
For seamless integration, embed Gitbook content directly:
|
||||
|
||||
```typescript
|
||||
<iframe
|
||||
src="https://docs.aethex.tech/your-page"
|
||||
style={{ width: '100%', height: '100vh', border: 'none' }}
|
||||
title="AeThex Documentation"
|
||||
/>
|
||||
```
|
||||
|
||||
## Step 4: Update Navigation Links
|
||||
|
||||
Update your app to link to Gitbook:
|
||||
|
||||
1. Keep internal `/docs/*` routes during transition
|
||||
2. Update external links to point to Gitbook: `https://docs.aethex.tech`
|
||||
3. Monitor analytics to track transition
|
||||
|
||||
## Step 5: Verify Content Migration
|
||||
|
||||
### Checklist
|
||||
|
||||
- [ ] All 9 sections present in Gitbook
|
||||
- [ ] Code examples render correctly
|
||||
- [ ] Tables display properly
|
||||
- [ ] Links work (may need to update internal links)
|
||||
- [ ] Images and assets load
|
||||
- [ ] Navigation structure matches original
|
||||
- [ ] Search functionality works
|
||||
|
||||
### Testing
|
||||
|
||||
1. Visit each page in Gitbook
|
||||
2. Test links and navigation
|
||||
3. Verify code snippets are highlighted correctly
|
||||
4. Check mobile responsiveness
|
||||
5. Test search functionality
|
||||
|
||||
## Step 6: Update Internal Links
|
||||
|
||||
Before fully migrating, update links throughout your app:
|
||||
|
||||
### Links to Update
|
||||
|
||||
1. Header navigation: `/docs` → `https://docs.aethex.tech`
|
||||
2. Footer links
|
||||
3. In-content links
|
||||
4. Breadcrumbs
|
||||
5. Cards and CTAs
|
||||
|
||||
## Step 7: Set Up API Sync (Optional)
|
||||
|
||||
For automated updates, set up periodic syncs using the Gitbook API and GitHub Actions.
|
||||
|
||||
## 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
|
||||
|
||||
3. **Week 5+:** Full migration complete
|
||||
- Remove local docs pages (or archive)
|
||||
- Update all documentation links
|
||||
|
||||
## Rollback Plan
|
||||
|
||||
If issues arise, you can quickly rollback:
|
||||
|
||||
1. Revert link changes
|
||||
2. Keep local docs active
|
||||
3. Fix issues in Gitbook
|
||||
4. Re-attempt migration when ready
|
||||
|
||||
## API Credentials
|
||||
|
||||
Your Gitbook API token has been provided:
|
||||
- **API Token:** gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg
|
||||
- **Space Name:** AeThex Docs
|
||||
|
||||
Store these securely as environment variables.
|
||||
|
||||
## Quick Start Commands
|
||||
|
||||
```bash
|
||||
# 1. Install dependencies (if needed)
|
||||
npm install
|
||||
|
||||
# 2. Sync documentation to Gitbook
|
||||
export GITBOOK_API_TOKEN=gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg
|
||||
export GITBOOK_SPACE_ID=your-space-id
|
||||
node code/docs-migration/gitbook-api-script.js sync
|
||||
|
||||
# 3. Verify all pages migrated
|
||||
node code/docs-migration/gitbook-api-script.js validate
|
||||
|
||||
# 4. List all pages in workspace
|
||||
node code/docs-migration/gitbook-api-script.js list
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. Find your Gitbook Space ID from Gitbook settings
|
||||
2. Run the sync script to push content
|
||||
3. Verify content in Gitbook
|
||||
4. Update your app links as needed
|
||||
5. Monitor usage during transition period
|
||||
88
docs-migration/docs-structure.json
Normal file
88
docs-migration/docs-structure.json
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"workspace": {
|
||||
"name": "AeThex Docs",
|
||||
"description": "Comprehensive guides, tutorials, and API references for AeThex platform"
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"id": "overview",
|
||||
"title": "Welcome to AeThex Documentation",
|
||||
"slug": "overview",
|
||||
"order": 0,
|
||||
"description": "Getting started with AeThex documentation",
|
||||
"file": "01-overview.md"
|
||||
},
|
||||
{
|
||||
"id": "getting-started",
|
||||
"title": "Getting Started",
|
||||
"slug": "getting-started",
|
||||
"order": 1,
|
||||
"description": "Launch your first AeThex project in under 30 minutes",
|
||||
"file": "02-getting-started.md"
|
||||
},
|
||||
{
|
||||
"id": "platform",
|
||||
"title": "Platform Guide",
|
||||
"slug": "platform",
|
||||
"order": 2,
|
||||
"description": "Understand AeThex platform features and experiences",
|
||||
"file": "03-platform.md"
|
||||
},
|
||||
{
|
||||
"id": "api-reference",
|
||||
"title": "API Reference",
|
||||
"slug": "api-reference",
|
||||
"order": 3,
|
||||
"description": "Complete API documentation with examples",
|
||||
"file": "04-api-reference.md"
|
||||
},
|
||||
{
|
||||
"id": "tutorials",
|
||||
"title": "Tutorials",
|
||||
"slug": "tutorials",
|
||||
"order": 4,
|
||||
"description": "Step-by-step guides for common use cases",
|
||||
"file": "05-tutorials.md"
|
||||
},
|
||||
{
|
||||
"id": "cli",
|
||||
"title": "CLI Tools",
|
||||
"slug": "cli",
|
||||
"order": 5,
|
||||
"description": "Operate AeThex from the command line",
|
||||
"file": "06-cli.md"
|
||||
},
|
||||
{
|
||||
"id": "examples",
|
||||
"title": "Code Examples",
|
||||
"slug": "examples",
|
||||
"order": 6,
|
||||
"description": "Production-ready patterns you can copy",
|
||||
"file": "07-examples.md"
|
||||
},
|
||||
{
|
||||
"id": "integrations",
|
||||
"title": "Integrations",
|
||||
"slug": "integrations",
|
||||
"order": 7,
|
||||
"description": "Connecting partner services to AeThex",
|
||||
"file": "08-integrations.md"
|
||||
},
|
||||
{
|
||||
"id": "curriculum",
|
||||
"title": "Curriculum",
|
||||
"slug": "curriculum",
|
||||
"order": 8,
|
||||
"description": "Structured learning paths for AeThex platform",
|
||||
"file": "09-curriculum.md"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"siteUrl": "https://docs.aethex.tech",
|
||||
"defaultLanguage": "en",
|
||||
"branding": {
|
||||
"title": "AeThex Docs",
|
||||
"favicon": "https://docs.aethex.tech/favicon.ico"
|
||||
}
|
||||
}
|
||||
}
|
||||
113
docs-migration/gitbook-api-script.js
Normal file
113
docs-migration/gitbook-api-script.js
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/**
|
||||
* 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 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' },
|
||||
];
|
||||
|
||||
async function makeRequest(method, path, body = null) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = {
|
||||
hostname: 'api.gitbook.com',
|
||||
port: 443,
|
||||
path: `/v1${path}`,
|
||||
method,
|
||||
headers: {
|
||||
Authorization: `Bearer ${API_TOKEN}`,
|
||||
'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', () => {
|
||||
try {
|
||||
resolve({
|
||||
status: res.statusCode,
|
||||
data: data ? JSON.parse(data) : null,
|
||||
headers: res.headers,
|
||||
});
|
||||
} catch (error) {
|
||||
resolve({ status: res.statusCode, data, headers: res.headers });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
req.on('error', reject);
|
||||
if (body) req.write(JSON.stringify(body));
|
||||
req.end();
|
||||
});
|
||||
}
|
||||
|
||||
async function syncDocs() {
|
||||
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');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let successful = 0;
|
||||
let failed = 0;
|
||||
|
||||
for (const page of PAGES) {
|
||||
try {
|
||||
const filePath = path.join(__dirname, page.file);
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.error(` ✗ File not found: ${page.file}`);
|
||||
failed++;
|
||||
continue;
|
||||
}
|
||||
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
console.log(` Updating page: ${page.title}...`);
|
||||
|
||||
const body = {
|
||||
title: page.title,
|
||||
description: `AeThex Documentation - ${page.title}`,
|
||||
};
|
||||
|
||||
const response = await makeRequest('POST', `/spaces/${SPACE_ID}/pages`, body);
|
||||
|
||||
if (response.status >= 200 && response.status < 300) {
|
||||
console.log(` ✓ ${page.title} updated successfully`);
|
||||
successful++;
|
||||
} else {
|
||||
console.error(` ✗ Failed: ${response.status}`);
|
||||
failed++;
|
||||
}
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
} catch (error) {
|
||||
console.error(` ✗ Error: ${error.message}`);
|
||||
failed++;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
Loading…
Reference in a new issue