Skip to content

Latest commit

Β 

History

History
110 lines (84 loc) Β· 4.15 KB

File metadata and controls

110 lines (84 loc) Β· 4.15 KB

Fox Web Framework Website

Official documentation website for the Fox web framework, built with Astro and Starlight.

🌐 Live Site: https://fox-gonic.github.io

✨ Features

Fox is a powerful extension of Gin that provides:

  • πŸš€ Automatic Parameter Binding - Bind parameters from URI, query strings, and JSON bodies with struct tags
  • 🌐 Multi-Domain Routing - Route traffic based on domain names with exact and regex pattern matching
  • πŸ“ Structured Logging - Built-in logger with TraceID, structured fields, and automatic file rotation
  • πŸ›‘οΈ Crash Protection - Graceful panic recovery with detailed error logging and stack traces
  • ⚑ High Performance - Minimal overhead above Gin's routing engine
  • πŸ”Œ Middleware Support - Full compatibility with Gin middleware ecosystem
  • βœ… Custom Validation - Implement IsValider interface for complex business validation logic
  • πŸ”„ 100% Gin Compatible - Use any existing Gin middleware and handlers seamlessly

πŸš€ Project Structure

β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   └── fox-logo.svg
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   └── docs/
β”‚   β”‚       β”œβ”€β”€ index.mdx              # Homepage with feature showcase
β”‚   β”‚       β”œβ”€β”€ guides/                # Getting started documentation
β”‚   β”‚       β”‚   β”œβ”€β”€ introduction.md
β”‚   β”‚       β”‚   β”œβ”€β”€ quickstart.md
β”‚   β”‚       β”‚   └── installation.md
β”‚   β”‚       β”œβ”€β”€ features/              # Core features documentation
β”‚   β”‚       β”‚   β”œβ”€β”€ binding.md
β”‚   β”‚       β”‚   β”œβ”€β”€ multi-domain.md
β”‚   β”‚       β”‚   β”œβ”€β”€ logging.md
β”‚   β”‚       β”‚   └── validation.md
β”‚   β”‚       β”œβ”€β”€ api/                   # API reference
β”‚   β”‚       β”‚   β”œβ”€β”€ router.md
β”‚   β”‚       β”‚   └── context.md
β”‚   β”‚       β”œβ”€β”€ examples/              # Code examples
β”‚   β”‚       β”‚   └── basic.md
β”‚   β”‚       └── zh-cn/                 # Chinese translations (11 files)
β”‚   └── styles/
β”‚       └── custom.css
β”œβ”€β”€ astro.config.mjs
β”œβ”€β”€ package.json
└── tsconfig.json

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying

🌐 Supported Languages

  • English (en)
  • Simplified Chinese (zh-CN)

πŸ“ Documentation Structure

The documentation is organized into four main sections:

  • Getting Started: Introduction, Quick Start, Installation
  • Features: Parameter Binding, Multi-Domain Routing, Structured Logging, Validation
  • API Reference: Router, Context
  • Examples: Basic Usage

All content is available in both English and Simplified Chinese.

🎨 Customization

The website uses a custom CSS file (src/styles/custom.css) to match the design of gin-gonic.com, featuring:

  • Dark theme by default
  • Colorful feature cards (orange, green, red, blue)
  • Gradient effects
  • Responsive design

βš™οΈ Technical Details

Dependencies:

  • Astro v5.16.15
  • Starlight v0.37.4
  • TypeScript v5.7.3
  • Sharp v0.34.5 (image optimization)

Development:

  • Full TypeScript support with strict type checking
  • Hot module replacement (HMR) for fast development
  • Optimized production builds with automatic asset optimization

πŸ“„ License

MIT License - see the LICENSE file for details

πŸ”— Links