Commands & Deployment
Project Commands
# Install dependencies npm install # Build the page index (required for search + AI) npm run build:graph # Start dev server npm run dev # Build for production npm run build # Start production server npm start # TypeScript check npx tsc --noEmit
Adding Documentation Pages
Create .md files in the content/ directory. The folder structure becomes your URL structure:
content/
├── index.md → /
├── getting-started/
│ └── quickstart.md → /docs/getting-started/quickstart
├── guides/
│ ├── configuration.md → /docs/guides/configuration
│ └── api-keys.md → /docs/guides/api-keys
├── api/
│ └── reference.md → /docs/api/reference
└── topics/
├── how-it-works.md → /docs/topics/how-it-works
└── search.md → /docs/topics/search
After adding or changing pages, rebuild the index:
npm run build:graph
Customizing the Theme
SmartDocs uses CSS custom properties for theming. Override them in app/globals.css:
:root {
--primary: #2563eb;
--bg: #ffffff;
--text: #1e293b;
/* etc. */
}
.dark {
--primary: #60a5fa;
--bg: #0f172a;
/* etc. */
}
Navigation
Edit the NAV_ITEMS arrays in:
components/Sidebar.tsx(desktop)components/MobileNav.tsx(mobile)
Add new sections and pages there. Update the ORDER list in lib/markdoc.ts to control the previous/next pagination order.
Deploy
Vercel (Recommended)
- Push to GitHub
- Go to vercel.com/new and import your repo
- Add environment variables:
SMARTDOCS_API_KEYSMARTDOCS_AI_PROVIDERSMARTDOCS_MODEL
- Deploy
Vercel automatically detects Next.js and configures the build.
Static Export
npm run build # Output in out/
Deploy the out/ folder to any host (Netlify, GitHub Pages, S3). Note: static export does not support the /api/chat route.
Custom Domain
Add your domain in the Vercel dashboard. SmartDocs supports any domain.
Next: How the AI Works — the graph-backed retrieval pipeline