DocSite

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.

Was this page helpful?