Getting Started
This guide walks you through setting up DocSite from scratch.
Installation
Clone the repository and install dependencies:
git clone https://github.com/your-username/docs-site.git
cd docs-site
npm install
Environment Variables
Copy and configure the environment file:
cp .env.example .env
Edit .env:
NODE_ENV=development
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_GITHUB_REPO_URL=https://github.com/your-username/docs-site
Development Server
npm run dev
Open http://localhost:3000 β it redirects to /en/docs/v1/introduction.
Production Build
npm run build
npm start
Docker Deployment
docker-compose up --build -d
The health check confirms the app is ready within 2 minutes at http://localhost:3000.
Project Structure
docs-site/
βββ app/
β βββ layout.tsx # Root layout
β βββ [locale]/
β β βββ layout.tsx # Locale layout (NextIntlClientProvider)
β β βββ page.tsx # Redirect β docs
β β βββ docs/[version]/[slug]/ # ISR doc pages
β β βββ api-reference/ # Swagger UI
β βββ api/search-data/ # FlexSearch data API
βββ components/ # React components
βββ _docs/{locale}/{version}/ # Markdown content
βββ messages/ # i18n translation strings
βββ public/openapi.json # OpenAPI 3.0 spec
βββ middleware.ts # next-intl locale routing
Adding New Documentation
Create a Markdown file in _docs/{locale}/{version}/:
---
title: My New Page
description: A short description for SEO
order: 4
---
# My New Page
Your content here...
The page appears automatically in the sidebar at the next build or ISR revalidation.