This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Echo Extra (echox) is a collection of examples and recipes for the Echo web framework in Go. This repository contains:
- cookbook/: Complete example applications demonstrating various Echo features (22 examples including JWT, CORS, WebSocket, file upload/download, graceful shutdown, etc.)
- website/: Docusaurus-based documentation website
# Run tests with race detection
go test -race ./...
# Or use the Makefile
make test
# Run individual cookbook examples
cd cookbook/<example-name>
go run server.go# Navigate to website directory first
cd website
# Install dependencies
npm install
# Start development server (http://localhost:3000)
npm start
# Build for production
npm run build
# Serve built site
npm run serve
# Alternative: run website in Docker
make serve
# or
docker run --rm -it --name echo-docs -v ${PWD}/website:/home/app -w /home/app -p 3000:3000 -u node node:lts /bin/bash -c "npm install && npm start -- --host=0.0.0.0"Each cookbook example is a standalone Go application in its own directory under cookbook/. Examples follow a consistent pattern:
server.go- Main application entry point using Echo v4- Additional files for complex examples (handlers, models, etc.)
- Standard Echo patterns: middleware setup, route definitions, handler functions
- Echo v4 (
github.com/labstack/echo/v4) - Core web framework - JWT libraries - Multiple JWT implementations for authentication examples
- WebSocket (
github.com/gorilla/websocket) - Real-time communication - Go 1.25.1 - Latest stable Go version, aligned with Echo project (supports 1.22+)
- Docusaurus 3.1.0 - Static site generator
- React 18.2.0 - UI framework
- MDX - Markdown with JSX support
- Custom GitHub codeblock theme for syntax highlighting
- For cookbook examples: Navigate to specific example directory and run
go run server.go - For website changes: Work in
website/directory using npm commands - Testing: Use
make testorgo test -race ./...to run all Go tests - Local preview: Use
npm startin website directory ormake servefor Docker-based development
This is an examples/recipes repository rather than a library. Focus on:
- Complete, runnable examples in cookbook/
- Clear documentation and code comments
- Following Echo v4 best practices and patterns
- Maintaining consistency across examples