Skip to content

civicteam/docs.civic.com

Repository files navigation

Civic Documentation

Welcome to the Civic documentation repository! This site powers our customer-facing documentation at docs.civic.com using Mintlify.

πŸš€ Quick Start

For Developers (Recommended for branch-based updates)

  1. Clone the repository

    git clone <repository-url>
    cd docs.civic.com
  2. Install Mintlify CLI

    npm install -g mintlify
  3. Start local development server

    npx mint dev

    This will start a local preview at http://localhost:3000

  4. Make your changes and preview them locally

  5. Create a branch and push

    git checkout -b feature/your-update
    git add .
    git commit -m "Update documentation"
    git push origin feature/your-update
  6. Open a Pull Request - Mintlify will automatically create a preview deployment for your branch

For Non-Developers (Quick edits)

Use the Mintlify Web Editor for quick updates:

  1. Navigate to the Mintlify dashboard
  2. Select your documentation project
  3. Use the browser-based editor to make changes
  4. Changes are deployed automatically

πŸ“‹ Documentation Structure

Our documentation follows Mintlify's structure with these key files:

  • docs.json - Main configuration file for navigation, themes, and settings
  • /pages/ - Individual documentation pages (MDX format)
  • /api-reference/ - API documentation files
  • /images/ - Static assets and images
  • /snippets/ - Reusable content snippets

πŸ”„ Workflow & Best Practices

Branch-Based Development (Developers)

βœ… Best for:

  • Substantial content updates
  • New feature documentation
  • Structural changes
  • Code examples and snippets

Workflow:

  1. Create a feature branch
  2. Make changes locally with npx mint dev for preview
  3. Push branch - automatic Mintlify preview is generated
  4. Review changes in both local and Mintlify preview
  5. Submit PR for team review
  6. Merge to main for production deployment

Web Editor (Non-Developers)

βœ… Best for:

  • Quick text fixes
  • Typo corrections
  • Small content updates
  • Urgent documentation changes

Benefits:

  • No local setup required
  • Real-time preview
  • Immediate deployment
  • User-friendly interface

πŸ› οΈ Development Commands

# Start local development server
npx mint dev

# Install Mintlify CLI globally
npm install -g mintlify

# Check for broken links and issues
npx mint check

🌟 Features & Components

Our documentation leverages Mintlify's rich component library:

  • Code Blocks with syntax highlighting
  • API Playground for interactive testing
  • Callouts for important information
  • Tabs for organized content
  • Cards for feature highlights
  • Accordions for expandable sections

For a complete list of available components, see the Mintlify Components Documentation.

🎨 Custom Styling

We have a custom.css file that provides additional styling classes, particularly useful for image formatting:

Image Width Classes:

  • .image-50 - 50% width
  • .image-60 - 60% width
  • .image-70 - 70% width
  • .image-80 - 80% width

Image Styling:

  • .image-rounded - Adds border radius

Usage Example:

<Frame>
  <img
    src="/images/example.png"
    alt="Example"
    className="image-70 image-rounded"
  />
</Frame>

Note: Apply the className directly to the img tag, not the Frame component, as the editor may remove classes from Frame components.

These classes automatically adjust to 90% width on mobile devices for responsive design.

πŸ€– AI Prompts

Our documentation includes AI-assisted integration prompts that allow developers to use AI assistants (Claude, ChatGPT, etc.) to automatically integrate Civic Auth into their projects.

Available AI Prompts

Direct Prompt Access

AI prompts use a three-tier approach for maximum flexibility:

  1. /snippets/ - Single source of truth for prompt content
  2. /prompts/ - Public pages for direct access (import snippets)
  3. /ai-prompts/ - Full display pages with context (import snippets)

Directory Structure:

snippets/              # Source of truth - raw prompt content + reusable components
β”œβ”€β”€ solana.mdx        # Solana Web3 prompt
β”œβ”€β”€ ethereum.mdx      # Ethereum Web3 prompt  
β”œβ”€β”€ react.mdx         # React framework prompt
β”œβ”€β”€ nextjs.mdx        # Next.js framework prompt
β”œβ”€β”€ flask.mdx         # Flask Python prompt
β”œβ”€β”€ django.mdx        # Django Python prompt
β”œβ”€β”€ fastapi.mdx       # FastAPI Python prompt
β”œβ”€β”€ _how-to-use-basic.mdx          # Reusable "How to Use" section
β”œβ”€β”€ _how-to-use-web3.mdx           # Web3 variant of "How to Use"
β”œβ”€β”€ _web3-prerequisites.mdx        # Web3 prerequisites warning
β”œβ”€β”€ _ai-assistant-requirements.mdx # AI assistant requirements info
β”œβ”€β”€ _supported-ai-assistants.mdx   # List of supported AI assistants
└── _web3-upsell-note.mdx          # Web3 upsell note for framework prompts

prompts/              # Public pages - direct access (imports snippets)
β”œβ”€β”€ solana.mdx        # /prompts/solana
β”œβ”€β”€ ethereum.mdx      # /prompts/ethereum
β”œβ”€β”€ react.mdx         # /prompts/react
β”œβ”€β”€ nextjs.mdx        # /prompts/nextjs
β”œβ”€β”€ flask.mdx         # /prompts/flask
β”œβ”€β”€ django.mdx        # /prompts/django
└── fastapi.mdx       # /prompts/fastapi

ai-prompts/           # Display pages - rich context (imports snippets)
β”œβ”€β”€ react.mdx         # /ai-prompts/react
β”œβ”€β”€ nextjs.mdx        # /ai-prompts/nextjs
β”œβ”€β”€ web3/
β”‚   β”œβ”€β”€ solana.mdx    # /ai-prompts/web3/solana
β”‚   └── ethereum.mdx  # /ai-prompts/web3/ethereum
└── python/
    β”œβ”€β”€ flask.mdx     # /ai-prompts/python/flask
    β”œβ”€β”€ django.mdx    # /ai-prompts/python/django
    └── fastapi.mdx   # /ai-prompts/python/fastapi

Direct Access Examples:

# Web3 prompts
curl https://docs.civic.com/prompts/solana
curl https://docs.civic.com/prompts/ethereum

# Framework prompts  
curl https://docs.civic.com/prompts/react
curl https://docs.civic.com/prompts/nextjs

# Python framework prompts
curl https://docs.civic.com/prompts/flask
curl https://docs.civic.com/prompts/django
curl https://docs.civic.com/prompts/fastapi

Benefits:

  • Direct URL access via /prompts/ for automation and tools (raw prompt only)
  • Rich display pages via /ai-prompts/ with context and instructions
  • Single source of truth via /snippets/ - content defined once, imported everywhere
  • Reusable components - common sections (prerequisites, how-to-use, etc.) shared across pages
  • DRY principle - eliminate duplication in both prompt content AND page structure
  • Easy maintenance - update common sections once, reflected across all pages
  • Clean URLs - easy to remember and curl

Adding New AI Prompts

When adding new AI prompt pages:

  1. Create the prompt snippet: Add raw prompt content to /snippets/your-prompt.mdx (no frontmatter)
  2. Create the public page: Add to /prompts/your-prompt.mdx:
    • Frontmatter with title, public: true
    • Import: import YourPrompt from '/snippets/your-prompt.mdx';
    • Display: <YourPrompt />
  3. Create the display page: Create main page in /ai-prompts/ with:
    • Proper frontmatter (title, icon, public: true)
    • Import prompt snippet: import YourPrompt from '/snippets/your-prompt.mdx';
    • Import reusable components: import HowToUseBasic from '/snippets/_how-to-use-basic.mdx';
    • Use components: <HowToUseBasic />, <YourPrompt />, etc.
  4. Update navigation: Add the display page to docs.json navigation
  5. Update overview: Reference the new prompt in the overview page

Reusable Components

Common sections are available as reusable snippets (prefixed with _):

  • _how-to-use-basic.mdx - Standard 4-step instructions
  • _how-to-use-web3.mdx - Web3 variant with setup verification
  • _web3-prerequisites.mdx - Warning about needing basic auth first
  • _ai-assistant-requirements.mdx - Info about terminal/file access
  • _supported-ai-assistants.mdx - List of tested AI assistants
  • _web3-upsell-note.mdx - Upsell note for Web3 functionality

Example Files:

Snippet (/snippets/your-prompt.mdx):

# Your Framework Integration Prompt
...raw prompt content here...

Public Access (/prompts/your-prompt.mdx):

---
title: "Your Framework Prompt"
public: true
---

import YourPrompt from '/snippets/your-prompt.mdx';

<YourPrompt />

Display Page (/ai-prompts/your-page.mdx):

---
title: "Your Framework"
icon: "your-icon"  
public: true
---

import YourPrompt from '/snippets/your-prompt.mdx';

## Prerequisites
<Warning>...</Warning>

## How to Use
1. Copy the prompt below...

## Integration Prompt

\```text
<YourPrompt />
\```

## What the AI Assistant Will Do
...

πŸ”— Link Checker

To ensure all links are valid and working:

lychee --verbose --root-dir $(pwd) --fallback-extensions mdx,md --include-fragments **/*.mdx

πŸ“¦ Preview Deployments

Every branch automatically gets a preview deployment:

  • Main branch: docs.civic.com
  • Feature branches: Preview URLs provided in PR comments
  • Local development: http://localhost:3000

πŸ“š Useful Resources

πŸ†˜ Getting Help

  • For Mintlify-specific questions: Check the Mintlify docs or their community
  • For content questions: Reach out to the documentation team
  • For technical issues: Create an issue in this repository

πŸ“ Contributing

  1. Follow the branch-based workflow for substantial changes
  2. Use the web editor for quick fixes
  3. Ensure all links work and code examples are tested
  4. Preview changes before submitting PRs
  5. Write clear commit messages describing your changes

Need to make an update?

  • πŸ‘©β€πŸ’» Developer? Use the branch workflow with local preview
  • πŸ–ŠοΈ Quick edit? Use the Mintlify web editor

Happy documenting! πŸš€ Thanks!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 21

Languages