A modern, feature-rich documentation site built with Next.js, Fumadocs, and AI-powered search capabilities.
- π Comprehensive Documentation - Well-organized documentation with multiple sections (Getting Started, Core Concepts, Reference Guides, Advanced, Contributing & Support)
- π€ AI-Powered Search - Ask AI questions about the documentation powered by Groq
- π¬ User Feedback System - Collect user feedback with opinions, messages, and metadata stored in JSON
- π¨ Modern UI - Beautiful, responsive design with dark mode support using Tailwind CSS
- π± Mobile Friendly - Fully responsive layout optimized for all device sizes
- β‘ Fast Performance - Built with Next.js 16, Turbopack, and optimized for speed
- π Full-Text Search - Integrated search functionality across all documentation
- π§ GitHub Integration - Shows last edit time for each page (with error handling)
- π― Professional Branding - Logo and favicon for consistent branding
| Technology | Purpose | Version |
|---|---|---|
| Next.js | React framework | 16.0.1 |
| Fumadocs | Documentation framework | 16.1.0 |
| Tailwind CSS | Styling | 4.1.16 |
| TypeScript | Type safety | 5.9.3 |
| Groq | AI provider | Latest |
| AI SDK | AI integration | 5.0.104 |
| Lucide React | Icons | 0.552.0 |
| Zod | Validation | 4.1.13 |
| npm | Package manager | 10.0.0+ |
fuma-docs-spry/
βββ content/
β βββ docs/ # MDX documentation files
β βββ getting-started/
β βββ core-concepts/
β βββ reference-guides/
β βββ advanced/
β βββ contributing-and-support/
βββ src/
β βββ app/
β β βββ api/
β β β βββ chat/ # AI chat endpoint
β β β βββ feedback/ # Feedback API
β β β βββ search/ # Search endpoint
β β βββ docs/ # Documentation pages
β β βββ (home)/ # Home/landing pages
β β βββ global.css
β β βββ layout.tsx
β βββ components/
β β βββ feedback.tsx # User feedback component
β β βββ search.tsx # AI search component
β β βββ markdown.tsx
β β βββ ui/ # UI components
β βββ lib/
β β βββ db.ts # Database layer (JSON-based)
β β βββ feedback.ts # Feedback handling
β β βββ github-config.ts # GitHub configuration
β β βββ source.ts # Content source config
β β βββ layout.shared.tsx # Shared layout options
β β βββ cn.ts # Utility functions
β βββ mdx-components.tsx # MDX component mappings
βββ db/
β βββ feedback.json # Feedback database (auto-created)
βββ public/
β βββ favicon.ico # Browser tab icon
β βββ logo.png # Navigation logo
β βββ logo.svg # SVG logo variant
βββ .env.local.example # Environment template
βββ source.config.ts # Fumadocs MDX config
βββ next.config.mjs
βββ tsconfig.json
βββ package.json
- Node.js 18 or higher
- npm 10 or higher (comes with Node.js)
- Git
- Groq API Key (free at https://console.groq.com/keys)
-
Clone the repository
git clone https://github.com/programmablemd/spry-docs.git cd fuma-docs-spry -
Install dependencies
npm install
-
Set up environment variables
cp .env.local.example .env.local
-
Add required API keys to
.env.local:# Required: Get free key at https://console.groq.com/keys GROQ_API_KEY=gsk_your_actual_key_here
-
Start development server
npm run dev
-
Open in browser Navigate to http://localhost:3000
| Variable | Description | Get Value |
|---|---|---|
GROQ_API_KEY |
Groq AI API key for search | console.groq.com/keys |
| Variable | Description | Default |
|---|---|---|
GITHUB_TOKEN |
GitHub token for last edit time | (not set) |
NEXT_PUBLIC_GITHUB_OWNER |
GitHub repository owner | vidhyagopinadh |
NEXT_PUBLIC_GITHUB_REPO |
GitHub repository name | fuma-docs-spry |
NEXT_PUBLIC_GITHUB_DOCS_PATH |
Path to docs in repo | content/docs |
# .env.local
# AI Search (Required)
GROQ_API_KEY=gsk_abcdef123456...
## π Documentation Guide
### Adding New Documentation
1. Create a new `.mdx` file in `content/docs/` subdirectory
2. Add frontmatter:
```mdx
---
title: Your Page Title
description: Brief description of the page
---
Your content here using MDX syntax...- Update corresponding
meta.jsonto include your page in navigation
- Getting Started - Installation, quick-start, and introductory guides
- Core Concepts - Fundamental concepts and theory
- Reference Guides - CLI commands, configuration options
- Advanced - Best practices and troubleshooting
- Contributing & Support - Contribution guidelines and help
Users can access AI search by:
- Clicking the Ask AI button (bottom-right)
- Using keyboard shortcut:
Cmd+/(Mac) orCtrl+/(Windows/Linux)
Features:
- Natural language questions
- AI-powered answers with relevant links
- Retry/regenerate responses
- Full conversation history
- Powered by Groq (Llama 3.3 70B model)
Users can provide feedback on individual pages:
- Thumbs Up - Mark page as helpful
- Thumbs Down - Mark page as unhelpful
- Optional Message - Add detailed feedback
- Automatic Metadata - Captures user agent, timezone, platform
Storage:
- Saved to
db/feedback.json(auto-created) - Session tracking for feedback sessions
- Full timestamp information
Built-in full-text search across all documentation:
- Fast and responsive
- Shows relevant results
- Easy navigation to found pages
Customize navigation, title, and branding:
- Logo: Displays
public/logo.png - Title: "Sprymd Docs"
- Navigation options
- Tailwind CSS 4: Main styling framework
- CSS-in-JS: PostCSS for advanced styling
- Dark Mode: Built-in support via Fumadocs
Feedback is stored in db/feedback.json:
[
{
"id": 1,
"url": "/docs/getting-started",
"opinion": "good",
"message": "Very helpful!",
"session_id": "1701520800000-abc123",
"metadata": "{\"userAgent\":\"...\",\"ip\":\"...\"}",
"created_at": "2024-12-02T10:00:00Z"
}
]Save user feedback
{
"type": "good" | "bad",
"page": "/docs/page-path",
"timestamp": "2024-12-02T10:00:00Z"
}Response: { success: true }
AI-powered chat for documentation Q&A
- Uses Groq API (Llama 3.3 70B)
- Context-aware responses
- Error handling for missing API key
Full-text search across documentation
- Query parameter:
q - Returns relevant pages
# Development
npm run dev # Start dev server on :3000
npm run build # Build for production
npm start # Start production server
# Code Quality
npm run lint # Run ESLint
npm run types:check # Check TypeScript types- Push code to GitHub
- Import project at Vercel Dashboard
- Add environment variables:
GROQ_API_KEYGITHUB_TOKEN(optional)NEXT_PUBLIC_GITHUB_*variables
- Deploy
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]# Build
npm run build
# Deploy the following to your server:
# - .next/ directory
# - db/ directory
# - public/ directory
# - package.json
# - package-lock.json
# Set environment variables and run:
npm install --prod
npm start| Issue | Solution |
|---|---|
| AI Search not working | Verify GROQ_API_KEY is set in .env.local, check /api/chat route |
| Feedback not saving | Check db/ directory permissions, verify feedback.json exists |
| GitHub last edit not showing | Add GITHUB_TOKEN to .env.local, check path format |
| Build fails | Clear .next with rm -rf .next, reinstall deps with npm install |
| TypeScript errors | Run npm run types:check to identify issues |
| Module not found | Run npm install to ensure all dependencies installed |
| Favicon not showing | Hard refresh browser (Cmd+Shift+R / Ctrl+Shift+R) |
- Build Time: ~2-3s (dev), ~30s (production)
- Page Load: < 1s (optimized)
- Search: < 100ms
- AI Response: 2-5s (depends on Groq)
See Contributing Guide for:
- Reporting issues
- Creating pull requests
- Documentation standards
- Code style guidelines
MIT License - see LICENSE file for details
- π Documentation
- π Report Issues
- π¬ Discussions
- π§ Contact: support@example.com
- β Documentation structure setup
- β AI-powered search integration with Groq
- β User feedback system with JSON storage
- β Responsive design with dark mode
- β GitHub integration with error handling
- β Professional branding (logo & favicon)
- β Environment variable configuration
- β Complete API documentation
- Initial project setup
- Built with Fumadocs
- Powered by Groq
- Styled with Tailwind CSS
Made with β€οΈ by the Sprymd team
Last Updated: December 2, 2025