Welcome to the Civic documentation repository! This site powers our customer-facing documentation at docs.civic.com using Mintlify.
-
Clone the repository
git clone <repository-url> cd docs.civic.com
-
Install Mintlify CLI
npm install -g mintlify
-
Start local development server
npx mint dev
This will start a local preview at
http://localhost:3000
-
Make your changes and preview them locally
-
Create a branch and push
git checkout -b feature/your-update git add . git commit -m "Update documentation" git push origin feature/your-update
-
Open a Pull Request - Mintlify will automatically create a preview deployment for your branch
Use the Mintlify Web Editor for quick updates:
- Navigate to the Mintlify dashboard
- Select your documentation project
- Use the browser-based editor to make changes
- Changes are deployed automatically
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
β Best for:
- Substantial content updates
- New feature documentation
- Structural changes
- Code examples and snippets
Workflow:
- Create a feature branch
- Make changes locally with
npx mint dev
for preview - Push branch - automatic Mintlify preview is generated
- Review changes in both local and Mintlify preview
- Submit PR for team review
- Merge to main for production deployment
β 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
# Start local development server
npx mint dev
# Install Mintlify CLI globally
npm install -g mintlify
# Check for broken links and issues
npx mint check
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.
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.
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.
- Framework Prompts: React, Next.js
- Python Framework Prompts: Django, FastAPI, Flask
- Web3 Blockchain Prompts: Solana, Ethereum
AI prompts use a three-tier approach for maximum flexibility:
/snippets/
- Single source of truth for prompt content/prompts/
- Public pages for direct access (import snippets)/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
When adding new AI prompt pages:
- Create the prompt snippet: Add raw prompt content to
/snippets/your-prompt.mdx
(no frontmatter) - 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 />
- Frontmatter with
- 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.
- Proper frontmatter (
- Update navigation: Add the display page to
docs.json
navigation - Update overview: Reference the new prompt in the overview page
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
...
To ensure all links are valid and working:
lychee --verbose --root-dir $(pwd) --fallback-extensions mdx,md --include-fragments **/*.mdx
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
- Mintlify Documentation - Complete guide and reference
- Mintlify Dashboard - Access the web editor and project settings
- Mintlify Quickstart - Get started in minutes
- MDX Documentation - Learn about MDX syntax
- Civic Auth Documentation - Our live documentation site
- 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
- Follow the branch-based workflow for substantial changes
- Use the web editor for quick fixes
- Ensure all links work and code examples are tested
- Preview changes before submitting PRs
- 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!