A Next.js documentation site for MAX API.
Run the development server:
bun install
bun devOpen http://localhost:33301 with your browser to see the result.
Build the application for production:
bun run buildThis project is a Next.js application with server routes such as /api/chat
and /api/search, so it should be deployed as a running Node/Bun service after
bun run build. Do not deploy only the .next directory.
cd /opt
git clone <your-repository-url> max-api-docs
cd max-api-docs
bun install
cp env.example .env.localEdit .env.local for your deployment:
NEXT_PUBLIC_SITE_URL=https://docs.your-domain.com
# Optional: enable the Ask AI assistant
INKEEP_API_KEY=your_api_key
AI_MODEL=your_model_name
AI_BASE_URL=https://your-max-api-domain/v1Keep .env.local private. It is ignored by .gitignore and should not be
committed or uploaded to public locations.
bun run build
bun run startThe current start script listens on port 33301:
http://127.0.0.1:33301
For long-running production use, run it with a process manager such as PM2:
npm i -g pm2
pm2 start "bun run start" --name max-api-docs
pm2 save
pm2 startupserver {
listen 80;
server_name docs.your-domain.com;
location / {
proxy_pass http://127.0.0.1:33301;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}After changing .env.local, restart the running service so Next.js can read the
new environment variables.
| Path | Description |
|---|---|
app/(home) |
Landing page and home pages |
app/[lang]/docs |
Documentation pages (i18n) |
app/api/search/route.ts |
Search API endpoint |
content/docs/ |
Documentation content (MDX) |
lib/source.ts |
Content source configuration |
- Next.js Documentation - Next.js features and API