Gallery · Architecture explained · Score · Rust
Axum architecture: modules, API surface, dependency graph
Ergonomic HTTP routing and request handling for Rust. Generated from tokio-rs/axum at 86aa615, MIT.
Scanned axum and axum-core. Macros and extra extractors are not included.
- Files
- 72
- Modules
- 25
- API routes
- 0
- Documents
- 17
Rust
Executive Summary
At a Glance
| Aspect | Summary |
|---|---|
| What | Axum is a early-stage software system |
| Built With | general-purpose + Rust |
| Scale | 25 modules across 72 files |
| Maturity | Early-stage (0/3 indicators) |
What This System Does
Axum is a general-purpose software system built with Rust. The codebase contains 25 modules organized into 7 functional domains.
Business Capabilities
The system is organized around 7 functional domains, each representing a distinct business capability:
| Domain | Capability | Scale |
|---|---|---|
| Other | Uncategorized module | 9 modules, 35 files |
| Core Engine | path axum-core/src/extract matches core | 7 modules, 18 files |
| API Layer | path axum/src/middleware matches middleware | 2 modules, 9 files |
| Shared Utilities | path axum/src/test_helpers matches helper | 4 modules, 7 files |
| Plugin System | path axum/src/extension.rs matches extension | 1 modules, 1 files |
| UI Components | path axum/src/form.rs matches form | 1 modules, 1 files |
| +1 more | Additional functional areas | — |
Technical Foundation
| Layer | Technologies | Purpose |
|---|---|---|
| Language | Rust | Primary development language |
Module Composition
The codebase follows a layered architecture with clear separation of concerns:
| Layer | Count | Key Modules | Responsibility |
|---|---|---|---|
| Other Modules | 5 | extract, routing | General purpose functionality |
| core | 7 | extract, response | Supporting application functionality |
| middleware | 1 | middleware | Supporting application functionality |
| test | 1 | test_helpers | Supporting application functionality |
| Shared Libraries | 1 | lib.rs | Provides shared utilities and abstractions used across modules |
Codebase Health
Strategic Observations
- The codebase follows Core/kernel architecture — `axum-core/src/extract`, `axum-core/src/response`, `axum-core/src/ext_traits` (+5 more), Plugin system — `axum/src/extension.rs`, Middleware pipeline — `axum/src/middleware`, Shared utility layer — `axum/src/util.rs`, `axum/src/test_helpers`, `axum-core/src/lib.rs` (+1 more), Dedicated test infrastructure — `axum/src/test_helpers` architectural patterns, providing a familiar structure for developers.
- With 7 distinct domains, the system has clear separation of concerns suitable for team-based development.
This executive summary was generated from comprehensive repository analysis including dependency graphs, data flow detection, and architectural pattern recognition. Enable AI enhancement with `GITHUB_TOKEN` for strategic recommendations, risk assessments, and plain-language explanations tailored for non-technical stakeholders.
<!-- repolens:docs-badge -->  · Examples
System Overview
The Big Picture
Axum is a medium-sized codebase with clear structure, containing 25 modules spread across 72 files.
| Dimension | Details |
|---|---|
| Total Files | 72 |
| Module Count | 25 |
| Functional Domains | 7 |
Technology Stack
The system is built on a modern technology foundation:
| Layer | Technologies | Purpose |
|---|---|---|
| Language | Rust | Primary development language |
Architecture Patterns
The codebase follows 5 identified architectural patterns:
- Core/kernel architecture — `axum-core/src/extract`, `axum-core/src/response`, `axum-core/src/ext_traits` (+5 more) — A structured approach to organizing code and managing complexity.
- Plugin system — `axum/src/extension.rs` — The system supports extensibility through a plugin architecture allowing third-party additions.
- Middleware pipeline — `axum/src/middleware` — A structured approach to organizing code and managing complexity.
- Shared utility layer — `axum/src/util.rs`, `axum/src/test_helpers`, `axum-core/src/lib.rs` (+1 more) — A structured approach to organizing code and managing complexity.
- Dedicated test infrastructure — `axum/src/test_helpers` — A structured approach to organizing code and managing complexity.
Module Architecture
The system is organized into 5 architectural layers:
| Layer | Modules | Key Examples | Responsibility |
|---|---|---|---|
| Other Modules | 5 | extract, routing | General purpose functionality |
| core | 7 | extract, response | Supporting application functionality |
| middleware | 1 | middleware | Supporting application functionality |
| test | 1 | test_helpers | Supporting application functionality |
| Shared Libraries | 1 | lib.rs | Provides shared utilities and abstractions used across modules |
Layer Details
Other Modules — 5 modules
axum/src/extract— 15 files — Core application moduleaxum/src/routing— 10 files — Core application moduleaxum/src/handler— 3 files — Core application moduleaxum/src/response— 3 files — Core application module- +1 more modules
core — 7 modules
axum-core/src/extract— 7 files — Core application moduleaxum-core/src/response— 4 files — Core application moduleaxum-core/src/ext_traits— 3 files — Core application moduleaxum-core/src/body.rs— 1 files — Core application module- +3 more modules
middleware — 1 module
axum/src/middleware— 6 files — Request/response middleware
test — 1 module
axum/src/test_helpers— 4 files — Utility and helper functions
Shared Libraries — 1 module
axum-core/src/lib.rs— 1 files — Utility and helper functions
Functional Domains
The following domains represent the largest functional areas by file count:
| Rank | Domain | Scale | Business Capability |
|---|---|---|---|
| 1 | Other | 35 files | Uncategorized module |
| 2 | Core Engine | 18 files | path axum-core/src/extract matches core |
| 3 | API Layer | 9 files | path axum/src/middleware matches middleware |
| 4 | Shared Utilities | 7 files | path axum/src/test_helpers matches helper |
| 5 | Plugin System | 1 files | path axum/src/extension.rs matches extension |
| 6 | UI Components | 1 files | path axum/src/form.rs matches form |
| — | +1 more | — | Additional domains |
This system overview was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative context, architectural rationale, technology trade-off analysis, and scalability recommendations.
<!-- repolens:docs-badge -->  · Examples
Business Domains
Overview
Axum is organized into 7 functional domains, each representing a distinct area of business capability. This document maps the technical structure to business-oriented functional areas.
Quick Reference:
| Domain | Modules | Files | Primary Capability |
|---|---|---|---|
| Other | 9 | 35 | Supporting business operations |
| Core Engine | 7 | 18 | Supporting business operations |
| API Layer | 2 | 9 | External API interface layer |
| Shared Utilities | 4 | 7 | Cross-cutting utility functions |
| Plugin System | 1 | 1 | Extensibility and plugin architecture |
| UI Components | 1 | 1 | Reusable visual interface elements |
| Services | 1 | 1 | Supporting business operations |
1. Other
Business Capability
Uncategorized module
This is a significant domain with 9 modules and 35 source files.
Key Modules
| Module | Purpose |
|---|---|
axum/src/extract | Core application module |
axum/src/routing | Core application module |
axum/src/response | Core application module |
axum/src/serve | Core application module |
axum/src/body | Core application module |
Business Impact
- Change Frequency Impact: Medium — Changes here affect 35 files
- Domain Complexity: Complex (multiple modules)
2. Core Engine
Business Capability
path axum-core/src/extract matches core
This is a focused domain with 7 modules and 18 source files.
Key Modules
| Module | Purpose |
|---|---|
axum-core/src/extract | Core application module |
axum-core/src/response | Core application module |
axum-core/src/ext_traits | Core application module |
axum-core/src/body.rs | Core application module |
axum-core/src/error.rs | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 18 files
- Domain Complexity: Complex (multiple modules)
3. API Layer
Business Capability
path axum/src/middleware matches middleware
This is a focused domain with 2 modules and 9 source files.
Key Modules
| Module | Purpose |
|---|---|
axum/src/middleware | Request/response middleware |
axum/src/handler | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 9 files
- Domain Complexity: Simple
4. Shared Utilities
Business Capability
path axum/src/test_helpers matches helper
This is a focused domain with 4 modules and 7 source files.
Key Modules
| Module | Purpose |
|---|---|
axum/src/test_helpers | Utility and helper functions |
axum-core/src/lib.rs | Utility and helper functions |
axum/src/lib.rs | Utility and helper functions |
axum/src/util.rs | Utility and helper functions |
Business Impact
- Change Frequency Impact: Low — Changes here affect 7 files
- Domain Complexity: Moderate
5. Plugin System
Business Capability
path axum/src/extension.rs matches extension
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
axum/src/extension.rs | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
6. UI Components
Business Capability
path axum/src/form.rs matches form
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
axum/src/form.rs | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
7. Services
Business Capability
path axum/src/service_ext.rs matches service
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
axum/src/service_ext.rs | Service layer / business logic |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
Domain Health Summary
| Metric | Value | Assessment |
|---|---|---|
| Total Domains | 7 | Well-balanced |
| Avg Files/Domain | 10 | Appropriate size |
| Largest Domain | Other (35 files) | Reasonable |
| Domain Concentration | 49% in largest | ✅ Well distributed |
Domain mapping is based on directory naming conventions and code organization patterns. Enable AI enhancement with `GITHUB_TOKEN` for business-language descriptions, stakeholder impact analysis, strategic recommendations, and cross-domain relationship narratives.
<!-- repolens:docs-badge -->  · Examples
Architecture Overview
Architectural Philosophy
Axum follows a Core/kernel architecture — `axum-core/src/extract`, `axum-core/src/response`, `axum-core/src/ext_traits` (+5 more) architecture with elements of Plugin system — `axum/src/extension.rs`, Middleware pipeline — `axum/src/middleware`, Shared utility layer — `axum/src/util.rs`, `axum/src/test_helpers`, `axum-core/src/lib.rs` (+1 more), Dedicated test infrastructure — `axum/src/test_helpers`.
Pattern Analysis
Core/kernel architecture — `axum-core/src/extract`, `axum-core/src/response`, `axum-core/src/ext_traits` (+5 more)
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Plugin system — `axum/src/extension.rs`
The system supports extensibility through a plugin architecture allowing third-party additions.
Benefits: Extensibility, community contributions, core stability
Middleware pipeline — `axum/src/middleware`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Shared utility layer — `axum/src/util.rs`, `axum/src/test_helpers`, `axum-core/src/lib.rs` (+1 more)
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Dedicated test infrastructure — `axum/src/test_helpers`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
System Layers
The system is organized into 7 functional layers, each encapsulating a distinct area of responsibility:
| Layer | Responsibility | Scale | Key Insight |
|---|---|---|---|
| Other | Uncategorized module | 35 files | Standard domain |
| Core Engine | path axum-core/src/extract matches core | 18 files | Standard domain |
| API Layer | path axum/src/middleware matches middleware | 9 files | External interface — versioning important |
| Shared Utilities | path axum/src/test_helpers matches helper | 7 files | Shared infrastructure — high reuse |
| Plugin System | path `axum/src/extension | 1 files | Standard domain |
| UI Components | path `axum/src/form | 1 files | Standard domain |
| Services | path `axum/src/service_ext | 1 files | Standard domain |
Module Layers
Modules are classified into 5 architectural roles:
Other Modules
Role: General purpose functionality
| Module | Files | Description |
|---|---|---|
axum/src/extract | 15 | Core application module |
axum/src/routing | 10 | Core application module |
axum/src/handler | 3 | Core application module |
axum/src/response | 3 | Core application module |
axum/src/serve | 2 | Core application module |
core
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
axum-core/src/extract | 7 | Core application module |
axum-core/src/response | 4 | Core application module |
axum-core/src/ext_traits | 3 | Core application module |
axum-core/src/body.rs | 1 | Core application module |
axum-core/src/error.rs | 1 | Core application module |
| +2 more | — | Additional modules |
middleware
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
axum/src/middleware | 6 | Request/response middleware |
test
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
axum/src/test_helpers | 4 | Utility and helper functions |
Shared Libraries
Role: Provides shared utilities and abstractions used across modules
| Module | Files | Description |
|---|---|---|
axum-core/src/lib.rs | 1 | Utility and helper functions |
Technology Foundation
| Layer | Technologies | Architectural Implication |
|---|---|---|
| Language | Rust | Memory safety, zero-cost abstractions |
Scale & Complexity Analysis
| Dimension | Value | Assessment |
|---|---|---|
| Total Files | 72 | medium project |
| Module Count | 25 | medium complexity |
| Domain Spread | 7 domains | Good separation |
This architecture overview was generated from comprehensive dependency graph analysis and pattern detection. Enable AI enhancement with `GITHUB_TOKEN` for architectural narratives, design rationale explanations, scalability analysis, and refactoring recommendations.
<!-- repolens:docs-badge -->  · Examples
Module Catalog
A complete inventory of all code modules in the repository, organized by location and size. Each module represents a distinct area of responsibility within the codebase.
Total modules: 25
Module Inventory
| Module | Files | Role |
|---|---|---|
axum/src/extract | 15 | Application module |
axum/src/routing | 10 | Application module |
axum-core/src/extract | 7 | Core business logic and shared foundations |
axum/src/middleware | 6 | Request middleware and interceptors |
axum-core/src/response | 4 | Core business logic and shared foundations |
axum/src/test_helpers | 4 | Test suites and fixtures |
axum-core/src/ext_traits | 3 | Core business logic and shared foundations |
axum/src/handler | 3 | Application module |
axum/src/response | 3 | Application module |
axum/src/serve | 2 | Application module |
axum-core/src/body.rs | 1 | Core business logic and shared foundations |
axum-core/src/error.rs | 1 | Core business logic and shared foundations |
axum-core/src/lib.rs | 1 | Core business logic and shared foundations |
axum-core/src/macros.rs | 1 | Core business logic and shared foundations |
axum-core/src/body | 1 | Core business logic and shared foundations |
axum/src/body | 1 | Application module |
axum/src/boxed.rs | 1 | Application module |
axum/src/extension.rs | 1 | Plugin system and extensions |
axum/src/form.rs | 1 | Application module |
axum/src/json.rs | 1 | Application module |
axum/src/lib.rs | 1 | Library code and third-party integrations |
axum/src/macros.rs | 1 | Application module |
axum/src/service_ext.rs | 1 | Service layer and external integrations |
axum/src/util.rs | 1 | Shared utilities and helper functions |
axum/src/error_handling | 1 | Application module |
Module detection is based on the `module_roots` setting in your RepoLens configuration. Adjust this setting to change how modules are grouped.
<!-- repolens:docs-badge -->  · Examples
Route Map
A complete listing of user-facing pages and backend API endpoints. This map shows every URL a user or client can interact with, along with the source file that handles each route.
Route Detection
This project is a library/package — it does not define its own routes or pages. Libraries are consumed by other applications that define their own routing.
<!-- repolens:docs-badge -->  · Examples
API Surface
This page documents both the API endpoints the application exposes and the external services it integrates with. Use it as a reference for understanding the system's interfaces.
Internal API Endpoints
These are the backend services the application provides to handle incoming requests.
No API routes were detected in this scan. If your project uses a routing framework (Express, Fastify, NestJS, etc.), ensure the relevant directories are included in your scan.include patterns.
External API Integrations
Third-party services the application connects to, grouped by category.
No external API integrations were detected. This section populates automatically when RepoLens identifies SDK imports or API client usage in your codebase.
HTTP method reference — GET: retrieve data, POST: create, PUT/PATCH: update, DELETE: remove.
<!-- repolens:docs-badge -->  · Examples
Data Flows
Understanding Data Movement
Data flows describe how information moves through Axum — from external inputs through processing layers to storage or presentation. Understanding these flows is essential for debugging, performance optimization, and architectural decisions.
Flow Detection Results
No data flows were detected in the codebase. This typically indicates one of the following:
- Simple request-response pattern — The system uses straightforward HTTP request/response patterns without complex pipelines
- Event-driven architecture — Data flows through event listeners that are harder to detect statically
- External orchestration — Flow control happens outside this codebase (e.g., in a parent service or message queue)
Recommendations
To help RepoLens detect flows more accurately, consider:
- Adding descriptive naming conventions (e.g.,
processOrder,handlePayment) - Using consistent file patterns for flow entry points
- Documenting flows explicitly in code comments
Flow detection is based on naming conventions and import patterns. Enable AI enhancement with `GITHUB_TOKEN` for intelligent flow inference from code structure, even when explicit patterns are absent.
<!-- repolens:docs-badge -->  · Examples
Architecture Diff
No changes detected.
<!-- repolens:docs-badge -->  · Examples
System Map
What is this? This visual diagram shows how different parts of your codebase connect to each other. Arrows indicate dependencies (which modules use which).
Showing: 25 modules and 0 relationships
Source: Heuristic inference (run full publish for import-based analysis)
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ 🏗️ SYSTEM ARCHITECTURE MAP │
└─────────────────────────────────────────────────────────────┘
⚙️ CORE LOGIC
│
├── extract (7 files)
├── response (4 files)
├── ext_traits (3 files)
├── body.rs (1 file)
├── error.rs (1 file)
├── lib.rs (1 file)
├── macros.rs (1 file)
└── body (1 file)
│
🧩 PLUGINS
│
└── extension.rs (1 file)
│
🔀 MIDDLEWARE
│
└── middleware (6 files)
│
⚡ SERVICES
│
└── service_ext.rs (1 file)
│
🛠️ UTILITIES
│
├── lib.rs (1 file)
└── util.rs (1 file)
│
✅ TESTING
│
└── test_helpers (4 files)
│
📦 OTHER
│
├── extract (15 files)
├── routing (10 files)
├── handler (3 files)
├── response (3 files)
├── serve (2 files)
├── body (1 file)
├── boxed.rs (1 file)
├── form.rs (1 file)
├── json.rs (1 file)
├── macros.rs (1 file)
└── error_handling (1 file)
│
Legend:
→ imports / depends on
╌→ tests
<!-- repolens:docs-badge -->  · Examples
Developer Onboarding
Welcome to Axum! 👋
This guide will help you get up to speed quickly. Axum is a general-purpose tools project built with Rust, containing 25 modules across 72 files.
What You'll Learn
- ✅ Repository structure and organization
- ✅ Technology stack and tools
- ✅ Key modules to understand first
- ✅ How data flows through the system
- ✅ How to start contributing
Quick Reference Card
| Aspect | Details |
|---|---|
| Languages | Rust |
| Frameworks | general-purpose tools |
| Build Tools | Standard toolchain |
| Size | 25 modules, 72 files |
| Domains | 7 functional areas |
Repository Structure
Understanding the directory layout is your first step to navigating the codebase:
| Directory | Purpose | Start Here? |
|---|---|---|
axum/src | Project files | ⭐ Yes |
axum-core/src | Project files | ⭐ Yes |
Where to Begin
Focus on these directories first:
- `axum/src` — Project files
- `axum-core/src` — Project files
Technology Stack
| Layer | Technologies | What to Learn |
|---|---|---|
| Language | Rust | Review language idioms used in the codebase |
Core Modules to Understand
These are the most important modules by size and centrality. Understanding them will unlock the rest of the codebase:
| Priority | Module | Files | Type | Why It Matters |
|---|---|---|---|---|
| ⭐ High | axum/src/extract | 15 | Other Modules | Key system component |
| ⭐ High | axum/src/routing | 10 | Other Modules | Key system component |
| ⭐ High | axum-core/src/extract | 7 | core | Key system component |
| Medium | axum/src/middleware | 6 | middleware | Key system component |
| Medium | axum-core/src/response | 4 | core | Key system component |
| Medium | axum/src/test_helpers | 4 | test | Key system component |
| Low | axum-core/src/ext_traits | 3 | core | Key system component |
| Low | axum/src/handler | 3 | Other Modules | Key system component |
| Low | axum/src/response | 3 | Other Modules | Key system component |
| Low | axum/src/serve | 2 | Other Modules | Key system component |
Getting Started Checklist
Follow these steps to set up your development environment:
1. Clone and Install
git clone <repository-url>
cd axum
npm install # or yarn, pnpm
2. Explore the Structure
- Review the directory structure above
- Open the
README.mdfor project-specific instructions - Look for
CONTRIBUTING.mdfor contribution guidelines
3. Understand Core Modules
Start with the high-priority modules listed above. Read the code and comments to understand:
- What problem each module solves
- How modules interact with each other
- What data structures are used
4. Make Your First Change
Start small:
- Find a small bug or typo to fix
- Make the change in a feature branch
- Run tests to ensure nothing breaks
- Submit a pull request for review
Common Pitfalls
New contributors often run into these issues:
- Environment setup — Check for
.env.examplefiles and ensure you have all required environment variables. - Branch naming — Follow the team's branch naming conventions (usually
feature/,fix/,docs/).
Additional Resources
| Resource | Purpose |
|---|---|
README.md | Project overview and quick start |
CONTRIBUTING.md | Contribution guidelines (if exists) |
CHANGELOG.md | Recent changes and release history |
package.json | Available scripts and dependencies |
This onboarding guide was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative walkthroughs, common pitfall documentation, debugging tips, architecture deep-dives, and personalized contribution recommendations.
Welcome to the team! Happy coding! 🚀
<!-- repolens:docs-badge -->  · Examples
GraphQL Schema
No GraphQL schema was detected in this repository.
RepoLens scans for .graphql and .gql schema files, inline SDL via tagged template literals (e.g. gql\...\``), resolver patterns, and popular GraphQL libraries including Apollo, Yoga, Nexus, Pothos, Mercurius, type-graphql, Relay, and urql.
If your project uses GraphQL, ensure the relevant source directories are included in your scan.include configuration.
<!-- repolens:docs-badge -->  · Examples
TypeScript Type Graph
No TypeScript type declarations were detected in this repository.
RepoLens analyzes .ts and .tsx files for interface declarations, type aliases, classes, and enums. Ensure your TypeScript source directories are included in the scan.include configuration.
<!-- repolens:docs-badge -->  · Examples
Dependency Graph
No source files were found to analyze for import dependencies.
Ensure your scan.include patterns cover the relevant source directories.
<!-- repolens:docs-badge -->  · Examples
Architecture Drift
No baseline found. Run
repolens publishonce to establish a baseline.
A baseline snapshot of the current architecture has been saved. On subsequent runs, this report will track structural changes across the following dimensions:
| Dimension | What is Tracked |
|---|---|
| Modules | New, removed, or significantly resized modules |
| API Endpoints | Added or removed backend routes |
| Dependencies | Changes to external package imports |
| Frameworks | Technology stack additions or removals |
| Circular Dependencies | Increases in dependency cycles |
| GraphQL Schema | Type additions or removals |
| Codebase Scale | Overall file count changes |
<!-- repolens:docs-badge -->  · Examples
Security Hotspots
No security anti-patterns were detected in the scanned source files.
RepoLens scans JavaScript and TypeScript source files for common security risks including code injection (eval), XSS (innerHTML), SQL injection, command injection, prototype pollution, hardcoded credentials, and insecure randomness.
Test files, configs, and build outputs are excluded from analysis to reduce false positives.
<!-- repolens:docs-badge -->  · Examples
Code Health Report
No source files were available for health analysis.
RepoLens computes a health score (0–100) per module by synthesizing cyclomatic complexity, coupling (fan-in × fan-out), documentation coverage, and security findings. Ensure your scan.include patterns cover the relevant source directories.
<!-- repolens:docs-badge -->  · Examples