Skip to content

Documentation for publicly accessible Opsfolio packages

Notifications You must be signed in to change notification settings

Abin-Sec/docs.opsfolio.com

Β 
Β 

Repository files navigation

Opsfolio Documentation

Unified documentation site for all Opsfolio products and services

🌐 Live Documentation

Main Site: https://docs.opsfolio.com

Product Documentation


πŸ—οΈ Repository Overview

This is a unified documentation site covering all Opsfolio products. It's built with Next.js, Fumadocs, and Tailwind CSS.

Products Covered

Product Description Docs Path
Spry Operations management & workflow automation /spry
Surveilr Surveillance & monitoring platform /surveilr
QualityFolio Quality assurance & testing /qualityfolio
EAA Enterprise Asset Assessment /eaa

🌟 Features

  • πŸ“š Comprehensive Documentation - Well-organized documentation with multiple sections
  • πŸ€– AI-Powered Search - Ask AI questions powered by Groq
  • πŸ’¬ User Feedback System - Collect feedback with JSON storage
  • 🎨 Modern UI - Beautiful, responsive design with dark mode
  • πŸ“± Mobile Friendly - Fully responsive layout
  • ⚑ Fast Performance - Built with Next.js 16 and Turbopack
  • πŸ” Full-Text Search - Integrated search across all docs
  • πŸ“§ GitHub Integration - Shows last edit time for each page
  • 🎯 Professional Branding - Consistent logo and favicon

πŸ› οΈ Tech Stack

Technology Purpose Version
Next.js React framework 16.0.1
Fumadocs Documentation framework 16.2.4
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

πŸ“ Project Structure

docs.opsfolio.com/
β”œβ”€β”€ content/
β”‚   └── docs/                         # πŸ“š All documentation
β”‚       β”œβ”€β”€ meta.json                 # Root navigation
β”‚       β”œβ”€β”€ index.mdx                 # Home page
β”‚       β”œβ”€β”€ getting-started.mdx       # Global getting started
β”‚       β”œβ”€β”€ spry/                     # Spry product docs
β”‚       β”‚   β”œβ”€β”€ meta.json
β”‚       β”‚   β”œβ”€β”€ index.mdx
β”‚       β”‚   β”œβ”€β”€ getting-started/
β”‚       β”‚   β”œβ”€β”€ core-concepts/
β”‚       β”‚   β”œβ”€β”€ reference-guides/
β”‚       β”‚   └── advanced/
β”‚       β”œβ”€β”€ surveilr/                 # Surveilr product docs
β”‚       β”œβ”€β”€ qualityfolio/             # QualityFolio product docs
β”‚       └── eaa/                      # EAA product docs
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ chat/                 # πŸ€– AI chat endpoint
β”‚   β”‚   β”‚   β”œβ”€β”€ feedback/             # πŸ‘ Feedback API
β”‚   β”‚   β”‚   └── search/               # πŸ” Search endpoint
β”‚   β”‚   β”œβ”€β”€ (docs)/                   # Dynamic docs pages
β”‚   β”‚   β”œβ”€β”€ (home)/                   # Home/landing page
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   β”œβ”€β”€ global.css
β”‚   β”‚   └── mdx-components.tsx
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ feedback.tsx
β”‚   β”‚   β”œβ”€β”€ search.tsx
β”‚   β”‚   β”œβ”€β”€ navbar.tsx
β”‚   β”‚   └── ui/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ source.ts                 # Fumadocs config
β”‚   β”‚   β”œβ”€β”€ layout.shared.tsx
β”‚   β”‚   β”œβ”€β”€ db.ts
β”‚   β”‚   └── feedback.ts
β”‚   └── mdx-components.tsx
β”œβ”€β”€ db/
β”‚   └── feedback.json                 # Auto-created
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ logo.png
β”‚   β”œβ”€β”€ logo.svg
β”‚   └── robots.txt
β”œβ”€β”€ .env.sample                       # Environment template
β”œβ”€β”€ source.config.ts                  # MDX configuration
β”œβ”€β”€ next.config.mjs
β”œβ”€β”€ tailwind.config.ts
β”œβ”€β”€ package.json
└── README.md

Key Directories:

  • content/docs/ = All documentation content
  • src/app/ = Next.js pages and layouts
  • src/components/ = React components
  • src/lib/ = Utility functions and configs
  • public/ = Static files (images, icons)

πŸš€ Quick Start

Prerequisites

  • Node.js 18 or higher
  • npm 10 or higher
  • Git
  • Groq API Key (Get free key)

Installation

  1. Clone the repository
   git clone https://github.com/opsfolio/docs.opsfolio.com.git
   cd docs.opsfolio.com
  1. Install dependencies
   npm install
  1. Set up environment variables
   cp .env.sample .env.local
  1. Add your API key to .env.local:
   # Required: Get free key at https://console.groq.com/keys
   GROQ_API_KEY=gsk_your_actual_key_here
   
   # Optional: GitHub integration
   GITHUB_TOKEN=ghp_your_token_here
   NEXT_PUBLIC_GITHUB_OWNER=opsfolio
   NEXT_PUBLIC_GITHUB_REPO=docs.opsfolio.com
   NEXT_PUBLIC_GITHUB_DOCS_PATH=content/docs
  1. Start development server
   npm run dev
  1. Open in browser

    Navigate to http://localhost:3000


🌍 Environment Variables

Required

Variable Description Get Value
GROQ_API_KEY Groq AI API key for search console.groq.com/keys

Optional

Variable Description Default
GITHUB_TOKEN GitHub token for last edit time (not set)
NEXT_PUBLIC_GITHUB_OWNER GitHub repository owner opsfolio
NEXT_PUBLIC_GITHUB_REPO GitHub repository name docs.opsfolio.com
NEXT_PUBLIC_GITHUB_DOCS_PATH Path to docs in repo content/docs

πŸ“– Documentation Guide

Adding New Documentation

  1. Create a new .mdx file in content/docs/ subdirectory
   touch content/docs/spry/section/new-page.mdx
  1. Add frontmatter:
   ---
   title: "Your Page Title"
   description: "Brief description for SEO"
   icon: "FileText"
   ---

   # Your Content Here

   Content using MDX syntax...
  1. Update meta.json to include your page in navigation:
   {
     "title": "Section Name",
     "pages": ["existing-page", "new-page"]
   }
  1. Preview changes:
   npm run dev

Documentation Structure

Each product follows this structure:

product-name/
β”œβ”€β”€ meta.json              # Navigation config
β”œβ”€β”€ index.mdx             # Product overview
β”œβ”€β”€ getting-started/      # Getting started guides
β”œβ”€β”€ core-concepts/        # Fundamental concepts
β”œβ”€β”€ reference-guides/     # API/CLI references
└── advanced/             # Advanced topics

Writing Guidelines

  • Clear & Concise: Use simple language
  • Action-Oriented: Start with verbs
  • Code Examples: Include working snippets
  • Consistent Terminology: Use same terms across products
  • Visual Aids: Add diagrams/screenshots where helpful

πŸ’¬ Features Guide

πŸ€– AI Search

Users can access AI search by:

  • Clicking the Ask AI button (bottom-right)
  • Using keyboard shortcut: Cmd+/ (Mac) or Ctrl+/ (Windows/Linux)

Capabilities:

  • Natural language questions
  • AI-powered answers with relevant links
  • Retry/regenerate responses
  • Full conversation history
  • Powered by Groq (Llama 3.3 70B)

πŸ‘ Feedback System

Users can provide feedback on 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)

πŸ” Search

Built-in full-text search:

  • Fast and responsive
  • Shows relevant results
  • Easy navigation

πŸ”§ Configuration

Site Settings

Configure in src/lib/layout.shared.tsx:

  • Logo: public/logo.png
  • Title: "Opsfolio Documentation"
  • Navigation options

Styling

  • Tailwind CSS 4: Main styling framework
  • PostCSS: Advanced styling
  • Dark Mode: Built-in support

πŸ“Š Database

Feedback Storage

Stored in db/feedback.json:

[
  {
    "id": 1,
    "url": "/spry/getting-started",
    "opinion": "good",
    "message": "Very helpful!",
    "session_id": "1701520800000-abc123",
    "metadata": "{\"userAgent\":\"...\"}",
    "created_at": "2024-12-02T10:00:00Z"
  }
]

🌐 API Routes

POST /api/feedback

Save user feedback

Request:

{
  "type": "good" | "bad",
  "page": "/docs/page-path",
  "timestamp": "2024-12-02T10:00:00Z"
}

Response: { "success": true }

POST /api/chat

AI-powered documentation Q&A

  • Uses Groq API (Llama 3.3 70B)
  • Context-aware responses
  • Error handling

GET /api/search

Full-text search

  • Query parameter: q
  • Returns relevant pages

πŸ“¦ Available Scripts

# Development
npm run dev              # Start dev server (:3000)
npm run build            # Build for production
npm start                # Start production server

# Code Quality
npm run lint             # Run ESLint
npm run types:check      # TypeScript validation

🚒 Deployment

Vercel (Recommended)

  1. Push code to GitHub
  2. Import at Vercel Dashboard
  3. Add environment variables:
    • GROQ_API_KEY
    • GITHUB_TOKEN (optional)
  4. Deploy

Docker

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]

Self-Hosted

npm run build
# Deploy .next/, db/, public/, package.json
npm install --prod
npm start

πŸ› Troubleshooting

Issue Solution
AI Search not working Verify GROQ_API_KEY in .env.local
Feedback not saving Check db/ permissions
GitHub last edit missing Add GITHUB_TOKEN to .env.local
Build fails Run rm -rf .next && npm install
TypeScript errors Run npm run types:check

🀝 Contributing

We welcome contributions!

  1. Fork the repository
  2. Create feature branch (git checkout -b docs/feature)
  3. Make changes
  4. Test locally (npm run dev)
  5. Commit with clear messages
  6. Push and create Pull Request

Guidelines

  • Follow existing structure
  • Use consistent terminology
  • Include code examples
  • Test all links
  • Update meta.json files

πŸ“ž Support


πŸ”— Resources


πŸ™ Acknowledgments


πŸ“š Additional Documentation

For detailed guidelines, see:

About

Documentation for publicly accessible Opsfolio packages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MDX 92.9%
  • TypeScript 5.7%
  • HTML 1.1%
  • Other 0.3%