aptos-labs
aptos-docs
MDX

Documentation for the Aptos Blockchain

Last updated Jul 7, 2026
74
Stars
31
Forks
13
Issues
+1
Stars/day
Attention Score
82
Language breakdown
MDX 72.3%
TypeScript 9.7%
Astro 7.7%
JavaScript 3.3%
HTML 2.2%
CSS 1.4%
โ–ธ Files click to expand
README

Aptos logo Aptos Docs

This repository contains the source code for the official Aptos Developer Documentation, built using Astro and Starlight.

Quick Start

# Clone the repository
git clone https://github.com/aptos-labs/aptos-docs.git
cd aptos-docs

Install dependencies

pnpm install

Set up environment variables

cp .env.example .env

Start the development server

pnpm dev

Visit http://localhost:4321 to see the documentation running locally.

Editing Documentation

The main documentation content is located in the src/content/docs/ directory:

  • Content is organized in directories that match the URL structure
  • Files are written in Markdown MDX (.mdx) format
  • Each file begins with frontmatter (metadata between --- delimiters)
Example frontmatter:
---
title: Your Page Title
description: A brief description of the page content
---

For more resources on authoring content within this environment, see:

With the development server running (pnpm dev), your changes will be reflected immediately.

Prerequisites

  • Node.js: Version 22.x (specified in .nvmrc, use nvm)
  • pnpm: Version 10.2.0 or higher (npm install -g pnpm)
  • Git: For cloning the repository

Key Features

  • Multi-language support
  • Interactive components (GraphiQL editor, Testnet Faucet)
  • API Reference via OpenAPI specifications
  • Move Reference documentation
  • Search functionality (Algolia DocSearch)
  • Dynamic OG Images

Common Commands

| Command | Description | | -------------- | ----------------------------- | | pnpm dev | Start the development server | | pnpm build | Build the site for production | | pnpm preview | Preview the production build | | pnpm lint | Check for linting issues | | pnpm format | Fix formatting issues |

Environment Variables

Key environment variables:

| Variable | Type | Purpose | Required? | | ----------------------- | ------ | ------------------------------ | ------------------------------------ | | GITHUBTOKEN | Secret | Fetching Move Reference docs | Only if ENABLEMOVE_REFERENCE=true | | ENABLEAPIREFERENCE | Public | Build REST API reference pages | Optional (default: false) | | ENABLEMOVEREFERENCE | Public | Build Move Reference docs | Optional (default: false) | | Firebase Credentials | Public | Authentication features | Required for Faucet/Auth | | Algolia Credentials | Public | Documentation search | Optional | | GTAG_ID | Public | Google Analytics tracking | Optional | | OGIMAGESSECRET | Secret | Dynamic OG image generation | Recommended for Vercel |

Project Structure

.
โ”œโ”€โ”€ config/                 # Global sidebar configuration helper
โ”œโ”€โ”€ patches/                # Patched npm dependencies
โ”œโ”€โ”€ public/                 # Static assets
โ”œโ”€โ”€ scripts/                # Utility scripts (Migration & Middleware generation)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/             # Site assets
โ”‚   โ”œโ”€โ”€ components/         # Reusable components
โ”‚   โ”œโ”€โ”€ config/             # Configuration helpers (i18n, docSearch, sidebar)
โ”‚   โ”œโ”€โ”€ content/            # Content Collections
โ”‚   โ”‚   โ”œโ”€โ”€ docs/           # Main documentation content
โ”‚   โ”‚   โ”œโ”€โ”€ i18n/           # UI translations
โ”‚   โ”‚   โ””โ”€โ”€ nav/            # Sidebar translations
โ”‚   โ”œโ”€โ”€ integrations/       # Custom integrations
โ”‚   โ”œโ”€โ”€ lib/                # Utility functions
โ”‚   โ”œโ”€โ”€ loaders/            # Content Collection loaders
โ”‚   โ”œโ”€โ”€ middlewares/        # Edge Middleware
โ”‚   โ”œโ”€โ”€ pages/              # Astro pages
โ”‚   โ”œโ”€โ”€ plugins/            # Remark/Rehype plugins
โ”‚   โ”œโ”€โ”€ starlight-overrides/ # Overridden components
โ”‚   โ”œโ”€โ”€ stores/             # State management
โ”‚   โ”œโ”€โ”€ styles/             # CSS styles
โ”‚   โ””โ”€โ”€ utils/              # General utilities
โ””โ”€โ”€ Various config files    # Configuration files

Configuration Files

| File | Purpose | | ------------------ | --------------------------------------------- | | .env.example | Example environment variables | | astro.config.mjs | Main configuration | | astro.sidebar.ts | Documentation sidebar structure | | package.json | Project dependencies and scripts | | vercel.json | Vercel deployment configuration and redirects |

Redirects

Redirects are handled in ./vercel.json for optimal performance. This approach ensures redirects are processed at the CDN level before middleware logic runs, providing faster response times for users and less potential for conflicts.

The vercel.json file contains all URL redirects with the following structure:

{
  "redirects": [
    {
      "source": "/old-path",
      "destination": "/new-path",
      "permanent": true
    }
  ]
}

Benefits of CDN-level redirects:

  • Performance: Redirects are handled at the edge, closest to users
  • Speed: No server-side processing or middleware execution required
  • Efficiency: Bypasses i18n middleware and other application logic
  • Reliability: Reduces server load and potential points of failure
When adding new redirects, always update the vercel.json file rather than implementing them in middleware to maintain optimal performance.

For more information on configuring redirects, see the Vercel redirects documentation.

Technologies Used

| Category | Technology | Description | | ------------------- | --------------------------------------------------- | ------------------------------------------ | | Framework | Astro | Web framework for content-driven sites | | Docs Framework | Starlight | Documentation toolkit for Astro | | Styling | Tailwind CSS | Utility-first CSS framework | | UI Components | React | UI library (via Astro Islands) | | Package Manager | pnpm | Fast, disk space efficient package manager | | Search | Algolia DocSearch | Documentation search | | Authentication | Firebase | Auth and backend services | | Deployment | Vercel | Hosting platform |

Contributing

  • Ensure code adheres to ESLint rules (pnpm lint)
  • Format code using Prettier (pnpm format)
๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท aptos-labs/aptos-docs ยท Updated daily from GitHub