Skip to content

Add Gorilla Mux HTTP Router Package Challenge Series #473

@RezaSi

Description

@RezaSi

Add Gorilla Mux HTTP Router Package Challenge Series

Issue Description

Create a comprehensive Gorilla Mux package challenge series to teach developers powerful HTTP routing in Go, covering everything from basic routing to advanced patterns used in production REST APIs and web services.

What needs to be implemented

Package Structure

Create packages/gorilla-mux/ with the following challenges:

  1. Challenge 1: Basic Routing & Path Variables (Beginner)

    • Setting up Mux router
    • Route patterns and path variables
    • Query parameters and form handling
    • Build a simple REST API for a bookstore
  2. Challenge 2: Advanced Routing & Middleware (Intermediate)

    • Route constraints and matchers
    • Subrouters and route grouping
    • Custom middleware chains
    • CORS and authentication middleware
  3. Challenge 3: REST API Patterns & Validation (Intermediate)

    • RESTful resource routing
    • Content negotiation (JSON, XML)
    • Request validation and error handling
    • Build a complete blog API with CRUD operations
  4. Challenge 4: Production Features & Testing (Advanced)

    • Route testing and HTTP testing
    • Rate limiting and throttling
    • API versioning strategies
    • Graceful shutdown and health checks

Required Files for Each Challenge

  • README.md - Challenge description and requirements
  • solution-template.go - Starting code template with TODOs
  • solution-template_test.go - Comprehensive test suite
  • learning.md - Educational content (400+ lines)
  • hints.md - Step-by-step guidance
  • metadata.json - Challenge metadata
  • go.mod and go.sum - Dependencies
  • run_tests.sh - Testing script

Package Metadata (package.json)

{
  "name": "gorilla-mux",
  "display_name": "Gorilla Mux HTTP Router",
  "description": "Powerful HTTP router and URL matcher for building Go web servers",
  "version": "v1.8.1",
  "github_url": "https://github.com/gorilla/mux",
  "documentation_url": "https://pkg.go.dev/github.com/gorilla/mux",
  "stars": 20000,
  "category": "web",
  "difficulty": "beginner_to_advanced",
  "prerequisites": ["basic_go", "http_concepts", "rest_api"],
  "learning_path": [
    "challenge-1-basic-routing-variables",
    "challenge-2-advanced-middleware",
    "challenge-3-rest-patterns-validation",
    "challenge-4-production-testing"
  ],
  "tags": ["http", "router", "rest", "api", "web", "middleware"],
  "estimated_time": "5-7 hours",
  "real_world_usage": [
    "REST API development",
    "Web service backends",
    "Microservice routing",
    "API gateways",
    "Content management systems",
    "E-commerce platforms"
  ]
}

Learning Objectives

  • Master HTTP routing with Gorilla Mux
  • Learn advanced routing patterns and constraints
  • Implement middleware chains and authentication
  • Build production-ready REST APIs
  • Understand API design best practices
  • Practice comprehensive HTTP testing

Resources

Acceptance Criteria

  • All 4 challenges implemented with complete file structure
  • Each challenge demonstrates different routing patterns
  • Comprehensive HTTP tests covering all endpoints
  • Learning materials explain REST API best practices
  • Code follows existing repository patterns and style
  • Examples of middleware implementation and testing
  • Documentation covers production deployment considerations

Getting Started

  1. Study existing package challenges structure
  2. Review Gorilla Mux documentation and examples
  3. Set up sample REST API for testing
  4. Follow the package challenge guidelines from CONTRIBUTING.md
  5. Start with basic routing and progress to advanced patterns

Need Help?

  • Check out our Contributing Guidelines
  • Look at existing package implementations for patterns
  • Ask questions in the comments below

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions