RepoLens

Gallery ยท Architecture explained ยท Score ยท JavaScript

Fastify architecture: modules, API surface, dependency graph

Fast and low-overhead web framework for Node.js. Generated from fastify/fastify at 5d4c233, MIT.

Files
32
Modules
32
API routes
0
Documents
17

TypeScriptJavaScript

Executive Summary

Stakeholders ยท High-level overview for leadership, product, and stakeholders

At a Glance

AspectSummary
WhatFastify is a early-stage command-line tool
Built Withgeneral-purpose + TypeScript, JavaScript
Scale32 modules across 32 files
MaturityEarly-stage (1/3 indicators)

What This System Does

Fastify is a general-purpose command-line tool built with TypeScript, JavaScript. It operates as a command-line interface, enabling users to interact with the system through terminal commands. This architecture is optimized for automation, scripting, and integration into CI/CD pipelines.

Business Capabilities

The system is organized around 5 functional domains, each representing a distinct business capability:

DomainCapabilityScale
Shared Utilitiespath lib/config-validator.js matches lib25 modules, 25 files
API Layerpath lib/error-handler.js matches handler3 modules, 3 files
Content Managementpath lib/content-type-parser.js matches content2 modules, 2 files
OtherUncategorized module1 modules, 1 files
State Managementpath lib/context.js matches context1 modules, 1 files

Technical Foundation

LayerTechnologiesPurpose
LanguageTypeScript, JavaScriptPrimary development language

Module Composition

The codebase follows a layered architecture with clear separation of concerns:

LayerCountKey ModulesResponsibility
Other Modules1rootGeneral purpose functionality
Shared Libraries14config-validator.js, content-type-parser.jsProvides shared utilities and abstractions used across modules

Codebase Health

Overall Health: ๐ŸŸข 95/100

MetricValueStatus
Internal imports108 edgesโœ… Connected
External Packages15โœ… Manageable
Circular Dependenciescycle-freeโœ… None
Orphan Files0โœ… All connected
Key Insights
  • โœ… Clean module boundaries โ€” No circular dependencies detected, enabling safe refactoring and testing.
  • โš ๏ธ Coupling hotspot โ€” lib/symbols is imported by 20 files (63% of codebase). Consider splitting.

Key Data Flows

The system processes information through 2 identified flows:

  • fastify Request Flow (critical) โ€” Import chain starting from fastify โ€” traces how this entry point depends on 1 downstream module
  • Content Delivery Flow โ€” Research articles and content are fetched and displayed to users

Strategic Observations

  • The codebase follows Plugin system โ€” `lib/plugin-override.js`, `lib/plugin-utils.js`, Shared utility layer โ€” `lib/plugin-utils.js`, `lib/config-validator.js`, `lib/content-type-parser.js` (+28 more), Acyclic dependency graph โ€” clean layering architectural patterns, providing a familiar structure for developers.
  • With 5 distinct domains, the system has clear separation of concerns suitable for team-based development.
  • As a CLI tool, this system is automation-friendly and can integrate into existing workflows and pipelines.

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

System Overview

Mixed audience ยท Concise technical overview readable by all

The Big Picture

Fastify is a medium-sized codebase with clear structure, containing 32 modules spread across 32 files.

DimensionDetails
Total Files32
Module Count32
Functional Domains5
Interface TypeCommand-Line Tool

Technology Stack

The system is built on a modern technology foundation:

LayerTechnologiesPurpose
LanguageTypeScript, JavaScriptPrimary development language

Architecture Patterns

The codebase follows 3 identified architectural patterns:

  • Plugin system โ€” `lib/plugin-override.js`, `lib/plugin-utils.js` โ€” The system supports extensibility through a plugin architecture allowing third-party additions.
  • Shared utility layer โ€” `lib/plugin-utils.js`, `lib/config-validator.js`, `lib/content-type-parser.js` (+28 more) โ€” The system supports extensibility through a plugin architecture allowing third-party additions.
  • Acyclic dependency graph โ€” clean layering โ€” The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.

Module Architecture

The system is organized into 2 architectural layers:

LayerModulesKey ExamplesResponsibility
Other Modules1rootGeneral purpose functionality
Shared Libraries14config-validator.js, content-type-parser.jsProvides shared utilities and abstractions used across modules
Layer Details

Other Modules โ€” 1 module

  • root โ€” 1 files โ€” Core application module

Shared Libraries โ€” 14 modules

  • lib/config-validator.js โ€” 1 files โ€” Utility and helper functions
  • lib/content-type-parser.js โ€” 1 files โ€” Utility and helper functions
  • lib/content-type.js โ€” 1 files โ€” Utility and helper functions
  • lib/context.js โ€” 1 files โ€” Utility and helper functions
  • +10 more modules

Functional Domains

The following domains represent the largest functional areas by file count:

RankDomainScaleBusiness Capability
1Shared Utilities25 filespath lib/config-validator.js matches lib
2API Layer3 filespath lib/error-handler.js matches handler
3Content Management2 filespath lib/content-type-parser.js matches content
4Other1 filesUncategorized module
5State Management1 filespath lib/context.js matches context

Dependency Graph

Codebase Health: ๐ŸŸข 95/100

MetricValueAssessment
Internal Imports108Modules are connected
External Packages15Lean dependencies
Circular Dependencies0โœ… Clean
Orphan Files0โœ… All connected

Hub modules (most imported):

  • lib/symbols โ€” imported by 20 files
  • lib/errors โ€” imported by 18 files
  • lib/hooks โ€” imported by 7 files
  • lib/content-type โ€” imported by 5 files

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Business Domains

Mixed audience ยท Codebase structure translated into business language

Overview

Fastify is organized into 5 functional domains, each representing a distinct area of business capability. This document maps the technical structure to business-oriented functional areas.

Quick Reference:

DomainModulesFilesPrimary Capability
Shared Utilities2525Cross-cutting utility functions
API Layer33External API interface layer
Content Management22Content creation and editorial workflow
Other11Supporting business operations
State Management11Application state and data flow management

1. Shared Utilities

Business Capability

path lib/config-validator.js matches lib

This is a significant domain with 25 modules and 25 source files.

Key Modules
ModulePurpose
lib/config-validator.jsUtility and helper functions
lib/decorate.jsUtility and helper functions
lib/error-serializer.jsUtility and helper functions
lib/error-status.jsUtility and helper functions
lib/errors.jsUtility and helper functions
Business Impact
  • Change Frequency Impact: Medium โ€” Changes here affect 25 files
  • Domain Complexity: Complex (multiple modules)

2. API Layer

Business Capability

path lib/error-handler.js matches handler

This is a focused domain with 3 modules and 3 source files.

Key Modules
ModulePurpose
lib/error-handler.jsUtility and helper functions
lib/log-controller.jsUtility and helper functions
lib/schema-controller.jsUtility and helper functions
Business Impact
  • Change Frequency Impact: Low โ€” Changes here affect 3 files
  • Domain Complexity: Moderate

3. Content Management

Business Capability

path lib/content-type-parser.js matches content

This is a focused domain with 2 modules and 2 source files.

Key Modules
ModulePurpose
lib/content-type-parser.jsUtility and helper functions
lib/content-type.jsUtility and helper functions
Business Impact
  • Change Frequency Impact: Low โ€” Changes here affect 2 files
  • Domain Complexity: Simple

4. Other

Business Capability

Uncategorized module

This is a focused domain with 1 module and 1 source file.

Key Modules
ModulePurpose
rootCore application module
Business Impact
  • Change Frequency Impact: Low โ€” Changes here affect 1 file
  • Domain Complexity: Simple

5. State Management

Business Capability

path lib/context.js matches context

This is a focused domain with 1 module and 1 source file.

Key Modules
ModulePurpose
lib/context.jsUtility and helper functions
Business Impact
  • Change Frequency Impact: Low โ€” Changes here affect 1 file
  • Domain Complexity: Simple

Cross-Domain Dependencies

The following modules serve as shared infrastructure across multiple domains:

ModuleConsumersRole
lib/symbols20 modulesUtility and helper functions
lib/errors18 modulesUtility and helper functions
lib/hooks7 modulesCustom hooks and shared state logic
lib/content-type5 modulesUtility and helper functions
Cross-Domain Integration Points

These modules facilitate communication and data sharing between domains:

  • `lib/symbols` serves as a central integration point, imported by 20 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
  • `lib/errors` serves as a central integration point, imported by 18 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
  • `lib/hooks` serves as a central integration point, imported by 7 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.

Domain Health Summary

MetricValueAssessment
Total Domains5Well-balanced
Avg Files/Domain6Appropriate size
Largest DomainShared Utilities (25 files)Consider breaking down
Domain Concentration78% in largestโš ๏ธ High concentration

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Overview

Engineers ยท Layered architecture and design patterns

Architectural Philosophy

Fastify follows a Plugin system โ€” `lib/plugin-override.js`, `lib/plugin-utils.js` architecture with elements of Shared utility layer โ€” `lib/plugin-utils.js`, `lib/config-validator.js`, `lib/content-type-parser.js` (+28 more), Acyclic dependency graph โ€” clean layering.

Pattern Analysis

Plugin system โ€” `lib/plugin-override.js`, `lib/plugin-utils.js`

The system supports extensibility through a plugin architecture allowing third-party additions.

Benefits: Extensibility, community contributions, core stability

Shared utility layer โ€” `lib/plugin-utils.js`, `lib/config-validator.js`, `lib/content-type-parser.js` (+28 more)

The system supports extensibility through a plugin architecture allowing third-party additions.

Benefits: Extensibility, community contributions, core stability

Acyclic dependency graph โ€” clean layering

The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.

Benefits: Automation-friendly, scriptable, integrates with CI/CD pipelines

System Layers

The system is organized into 5 functional layers, each encapsulating a distinct area of responsibility:

LayerResponsibilityScaleKey Insight
Shared Utilitiespath `lib/config-validator25 filesShared infrastructure โ€” high reuse
API Layerpath `lib/error-handler3 filesExternal interface โ€” versioning important
Content Managementpath `lib/content-type-parser2 filesStandard domain
OtherUncategorized module1 filesStandard domain
State Managementpath `lib/context1 filesStandard domain

Module Layers

Modules are classified into 2 architectural roles:

Other Modules

Role: General purpose functionality

ModuleFilesDescription
root1Core application module
Shared Libraries

Role: Provides shared utilities and abstractions used across modules

ModuleFilesDescription
lib/config-validator.js1Utility and helper functions
lib/content-type-parser.js1Utility and helper functions
lib/content-type.js1Utility and helper functions
lib/context.js1Utility and helper functions
lib/decorate.js1Utility and helper functions
+9 moreโ€”Additional modules

Technology Foundation

LayerTechnologiesArchitectural Implication
LanguageTypeScript, JavaScriptStatic typing enables tooling and refactoring confidence

Scale & Complexity Analysis

DimensionValueAssessment
Total Files32medium project
Module Count32medium complexity
Domain Spread5 domainsFocused scope
InterfaceCLITerminal-driven interaction

Dependency Health

Architecture Health Score: ๐ŸŸข 95/100

MetricValueStatusRecommendation
Import Edges108โœ…Healthy module connectivity
External Packages15โœ…Lean dependency set
Circular Deps0โœ…Clean module boundaries
Orphan Files0โœ…All code is connected
Architectural Strengths
  • Clean module boundaries โ€” No circular dependencies detected. This enables safe refactoring, isolated testing, and clear ownership boundaries.
  • Fully connected codebase โ€” Every file is part of the dependency graph. No dead code or forgotten modules.
Concerns
  • Central coupling hotspot โ€” lib/symbols is imported by 20 files (63%). Consider breaking into smaller modules. Priority: Medium.

Hub modules (most imported):

  • lib/symbols โ€” imported by 20 files
  • lib/errors โ€” imported by 18 files
  • lib/hooks โ€” imported by 7 files
  • lib/content-type โ€” imported by 5 files

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Module Catalog

Engineers ยท Complete inventory of code modules with AI explanations

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: 32


Module Inventory

ModuleFilesRole
root1Application module
lib/config-validator.js1Library code and third-party integrations
lib/content-type-parser.js1Library code and third-party integrations
lib/content-type.js1Library code and third-party integrations
lib/context.js1Library code and third-party integrations
lib/decorate.js1Library code and third-party integrations
lib/error-handler.js1Library code and third-party integrations
lib/error-serializer.js1Library code and third-party integrations
lib/error-status.js1Library code and third-party integrations
lib/errors.js1Library code and third-party integrations
lib/four-oh-four.js1Library code and third-party integrations
lib/handle-request.js1Library code and third-party integrations
lib/head-route.js1Library code and third-party integrations
lib/hooks.js1Hook callbacks
lib/initial-config-validation.js1Library code and third-party integrations
lib/log-controller.js1Library code and third-party integrations
lib/logger-factory.js1Library code and third-party integrations
lib/logger-pino.js1Library code and third-party integrations
lib/noop-set.js1Library code and third-party integrations
lib/plugin-override.js1Library code and third-party integrations
lib/plugin-utils.js1Shared utilities and helper functions
lib/reply.js1Library code and third-party integrations
lib/req-id-gen-factory.js1Library code and third-party integrations
lib/request.js1Library code and third-party integrations
lib/route.js1Library code and third-party integrations
lib/schema-controller.js1Library code and third-party integrations
lib/schemas.js1Library code and third-party integrations
lib/server.js1Library code and third-party integrations
lib/symbols.js1Library code and third-party integrations
lib/validation.js1Library code and third-party integrations
lib/warnings.js1Library code and third-party integrations
lib/wrap-thenable.js1Library code and third-party integrations

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Route Map

Mixed audience ยท Application routes and API endpoints with context

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 CLI tool โ€” it does not expose HTTP routes or serve web pages. This is expected behavior, not a detection failure.

CLI tools interact through terminal commands rather than URLs. See the System Overview or Developer Onboarding documents for command documentation.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

API Surface

Engineers ยท Backend API endpoints with usage examples

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Data Flows

Mixed audience ยท Major information flows through the system

Understanding Data Movement

Data flows describe how information moves through Fastify โ€” from external inputs through processing layers to storage or presentation. Understanding these flows is essential for debugging, performance optimization, and architectural decisions.

Flow Summary

5 data flows identified in the codebase:

FlowTypeComplexityCritical
fastify Request FlowIntegrationLow (2 steps)๐Ÿ”ด Yes
Content Delivery FlowIntegrationMedium (5 steps)โ€”
symbols Integration FlowIntegrationMedium (5 steps)๐Ÿ”ด Yes
errors Integration FlowIntegrationMedium (5 steps)๐Ÿ”ด Yes
hooks Integration FlowIntegrationHigh (6 steps)๐Ÿ”ด Yes

1. fastify Request Flow ๐Ÿ”ด CRITICAL FLOW

Description

Import chain starting from fastify โ€” traces how this entry point depends on 1 downstream module

Characteristics
PropertyValue
Steps2
Modules Involved2
CriticalityCritical
Processing Steps
StepActionPurpose
1fastify (entry point, imports 18 modules)Data acquisition
2symbols (shared infrastructure, used by 20 files)Processing step
Flow Diagram
โ”Œโ”€ START โ”€โ”
โ”‚ `fastify` (entry point, imports 18 modules)        โ”‚
โ”‚         โ†“
โ”‚ `symbols` (shared infrastructure, used by 20 fi... โ”‚
โ””โ”€ END โ”€โ”€โ”€โ”˜
Involved Modules
ModuleRole
fastifyCore application module
symbolsUtility and helper functions
Dependencies

Shared libraries used: lib/config-validator.js, lib/content-type-parser.js, lib/content-type.js, lib/context.js, lib/decorate.js

Insights
  • โš ๏ธ Critical path โ€” Failures here have significant business impact
  • ๐Ÿ“Š Consider adding monitoring and alerting
  • ๐Ÿงช Ensure comprehensive test coverage

2. Content Delivery Flow

Description

Research articles and content are fetched and displayed to users

Characteristics
PropertyValue
Steps5
Modules Involved2
CriticalityStandard
Processing Steps
StepActionPurpose
1User browses content sectionsProcessing step
2Content components load articlesData acquisition
3Articles may be fetched from CMS or databaseData acquisition
4Content is rendered with formattingOutput generation
5User can interact with content featuresProcessing step
Flow Diagram
โ”Œโ”€ START โ”€โ”
โ”‚ User browses content sections                      โ”‚
โ”‚         โ†“
โ”‚ Content components load articles                   โ”‚
โ”‚         โ†“
โ”‚ Articles may be fetched from CMS or database       โ”‚
โ”‚         โ†“
โ”‚ Content is rendered with formatting                โ”‚
โ”‚         โ†“
โ”‚ User can interact with content features            โ”‚
โ””โ”€ END โ”€โ”€โ”€โ”˜
Involved Modules
ModuleRole
content-type-parser.jsUtility and helper functions
content-type.jsUtility and helper functions
Dependencies

Shared libraries used: lib/config-validator.js, lib/content-type-parser.js, lib/content-type.js, lib/context.js, lib/decorate.js

External services: Content management system

Insights
  • Standard integration flow with 5 processing steps

3. symbols Integration Flow ๐Ÿ”ด CRITICAL FLOW

Description

lib/symbols is a central module imported by 20 files, acting as an integration point for data and logic

Characteristics
PropertyValue
Steps5
Modules Involved4
CriticalityCritical
Processing Steps
StepActionPurpose
1fastify imports symbolsData acquisition
2content-type-parser imports symbolsData acquisition
3context imports symbolsData acquisition
4decorate imports symbolsData acquisition
5error-handler imports symbolsData acquisition
Flow Diagram
โ”Œโ”€ START โ”€โ”
โ”‚ `fastify` imports `symbols`                        โ”‚
โ”‚         โ†“
โ”‚ `content-type-parser` imports `symbols`            โ”‚
โ”‚         โ†“
โ”‚ `context` imports `symbols`                        โ”‚
โ”‚         โ†“
โ”‚ `decorate` imports `symbols`                       โ”‚
โ”‚         โ†“
โ”‚ `error-handler` imports `symbols`                  โ”‚
โ””โ”€ END โ”€โ”€โ”€โ”˜
Involved Modules
ModuleRole
symbolsUtility and helper functions
fastifyCore application module
content-type-parserUtility and helper functions
contextUtility and helper functions
Dependencies

Shared libraries used: lib/config-validator.js, lib/content-type-parser.js, lib/content-type.js, lib/context.js, lib/decorate.js

Insights
  • โš ๏ธ Critical path โ€” Failures here have significant business impact
  • ๐Ÿ“Š Consider adding monitoring and alerting
  • ๐Ÿงช Ensure comprehensive test coverage

4. errors Integration Flow ๐Ÿ”ด CRITICAL FLOW

Description

lib/errors is a central module imported by 18 files, acting as an integration point for data and logic

Characteristics
PropertyValue
Steps5
Modules Involved4
CriticalityCritical
Processing Steps
StepActionPurpose
1fastify imports errorsData acquisition
2content-type-parser imports errorsData acquisition
3context imports errorsData acquisition
4decorate imports errorsData acquisition
5error-handler imports errorsData acquisition
Flow Diagram
โ”Œโ”€ START โ”€โ”
โ”‚ `fastify` imports `errors`                         โ”‚
โ”‚         โ†“
โ”‚ `content-type-parser` imports `errors`             โ”‚
โ”‚         โ†“
โ”‚ `context` imports `errors`                         โ”‚
โ”‚         โ†“
โ”‚ `decorate` imports `errors`                        โ”‚
โ”‚         โ†“
โ”‚ `error-handler` imports `errors`                   โ”‚
โ””โ”€ END โ”€โ”€โ”€โ”˜
Involved Modules
ModuleRole
errorsUtility and helper functions
fastifyCore application module
content-type-parserUtility and helper functions
contextUtility and helper functions
Dependencies

Shared libraries used: lib/config-validator.js, lib/content-type-parser.js, lib/content-type.js, lib/context.js, lib/decorate.js

Insights
  • โš ๏ธ Critical path โ€” Failures here have significant business impact
  • ๐Ÿ“Š Consider adding monitoring and alerting
  • ๐Ÿงช Ensure comprehensive test coverage

5. hooks Integration Flow ๐Ÿ”ด CRITICAL FLOW

Description

lib/hooks is a central module imported by 7 files, acting as an integration point for data and logic

Characteristics
PropertyValue
Steps6
Modules Involved4
CriticalityCritical
Processing Steps
StepActionPurpose
1fastify imports hooksData acquisition
2four-oh-four imports hooksData acquisition
3handle-request imports hooksData acquisition
4plugin-override imports hooksData acquisition
5reply imports hooksData acquisition
6hooks depends on errors, symbolsProcessing step
Flow Diagram
โ”Œโ”€ START โ”€โ”
โ”‚ `fastify` imports `hooks`                          โ”‚
โ”‚         โ†“
โ”‚ `four-oh-four` imports `hooks`                     โ”‚
โ”‚         โ†“
โ”‚ `handle-request` imports `hooks`                   โ”‚
โ”‚         โ†“
โ”‚ `plugin-override` imports `hooks`                  โ”‚
โ”‚         โ†“
โ”‚ `reply` imports `hooks`                            โ”‚
โ”‚         โ†“
โ”‚ `hooks` depends on `errors`, `symbols`             โ”‚
โ””โ”€ END โ”€โ”€โ”€โ”˜
Involved Modules
ModuleRole
hooksCustom hooks and shared state logic
fastifyCore application module
four-oh-fourUtility and helper functions
handle-requestUtility and helper functions
Dependencies

Shared libraries used: lib/config-validator.js, lib/content-type-parser.js, lib/content-type.js, lib/context.js, lib/decorate.js

Insights
  • โš ๏ธ Critical path โ€” Failures here have significant business impact
  • ๐Ÿ“Š Consider adding monitoring and alerting
  • ๐Ÿงช Ensure comprehensive test coverage

Import Network

The system has 108 internal import edges connecting 32 source files.

Network Topology
MetricValueMeaning
Total Edges108Direct import relationships
Hub Count4Central integration points
Avg Connections~3.4 per fileCoupling density
Key Integration Points

These modules aggregate data from multiple sources:

HubInboundRole
symbols20 filesUtility and helper functions
errors18 filesUtility and helper functions
hooks7 filesCustom hooks and shared state logic
content-type5 filesUtility and helper functions

Flow detection uses naming conventions, import patterns, and dependency graph analysis. Enable AI enhancement with `GITHUB_TOKEN` for end-to-end flow narratives, failure mode analysis, data transformation descriptions, and performance bottleneck identification.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Diff

Mixed audience ยท Git diff analysis and impact assessment

No changes detected.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

System Map

Mixed audience ยท Visual dependency graph with explanation

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: 30 modules and 83 relationships

Source: Real import analysis


Architecture Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              ๐Ÿ—๏ธ  SYSTEM ARCHITECTURE MAP                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ  UTILITIES
โ”‚
โ”œโ”€โ”€ config-validator.js (1 file)
โ”œโ”€โ”€ content-type-parser.js (1 file)
โ”‚      โ†’ content-type.js
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ content-type.js (1 file)
โ”œโ”€โ”€ context.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ decorate.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ error-handler.js (1 file)
โ”‚      โ†’ error-status.js
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”‚      ... +2 more
โ”œโ”€โ”€ error-serializer.js (1 file)
โ”œโ”€โ”€ error-status.js (1 file)
โ”‚      โ†’ symbols.js
โ”œโ”€โ”€ errors.js (1 file)
โ”œโ”€โ”€ four-oh-four.js (1 file)
โ”‚      โ†’ reply.js
โ”‚      โ†’ request.js
โ”‚      โ†’ context.js
โ”‚      ... +6 more
โ”œโ”€โ”€ handle-request.js (1 file)
โ”‚      โ†’ validation.js
โ”‚      โ†’ hooks.js
โ”‚      โ†’ errors.js
โ”‚      ... +3 more
โ”œโ”€โ”€ head-route.js (1 file)
โ”œโ”€โ”€ hooks.js (1 file)
โ”‚      โ†’ errors.js
โ”‚      โ†’ symbols.js
โ”œโ”€โ”€ initial-config-validation.js (1 file)
โ”‚      โ†’ config-validator.js
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ log-controller.js (1 file)
โ”œโ”€โ”€ logger-factory.js (1 file)
โ”‚      โ†’ errors.js
โ”‚      โ†’ symbols.js
โ”‚      โ†’ log-controller.js
โ”‚      ... +1 more
โ”œโ”€โ”€ logger-pino.js (1 file)
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ noop-set.js (1 file)
โ”œโ”€โ”€ plugin-override.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ reply.js
โ”‚      โ†’ request.js
โ”‚      ... +4 more
โ”œโ”€โ”€ plugin-utils.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ decorate.js
โ”‚      โ†’ errors.js
โ”œโ”€โ”€ reply.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ hooks.js
โ”‚      โ†’ handle-request.js
โ”‚      ... +6 more
โ”œโ”€โ”€ req-id-gen-factory.js (1 file)
โ”‚      โ†’ symbols.js
โ”œโ”€โ”€ request.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”‚      โ†’ decorate.js
โ”‚      ... +1 more
โ”œโ”€โ”€ route.js (1 file)
โ”‚      โ†’ context.js
โ”‚      โ†’ handle-request.js
โ”‚      โ†’ hooks.js
โ”‚      ... +9 more
โ”œโ”€โ”€ schema-controller.js (1 file)
โ”‚      โ†’ schemas.js
โ”œโ”€โ”€ schemas.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ errors.js
โ”‚      โ†’ content-type.js
โ”œโ”€โ”€ server.js (1 file)
โ”‚      โ†’ symbols.js
โ”‚      โ†’ hooks.js
โ”‚      โ†’ errors.js
โ”‚      ... +1 more
โ”œโ”€โ”€ symbols.js (1 file)
โ””โ”€โ”€ validation.js (1 file)
       โ†’ symbols.js
       โ†’ errors.js
โ”‚
๐Ÿ“ฆ  OTHER
โ”‚
โ””โ”€โ”€ root (1 file)
โ”‚

Legend:
  โ†’  imports / depends on
  โ•Œโ†’ tests

Key Connections

Most depended-on modules (highest import count):

ModuleImported by
lib/symbols.js18 modules
lib/errors.js17 modules
lib/hooks.js6 modules
lib/content-type.js5 modules
lib/schemas.js4 modules

Most dependent modules (highest dependency count):

ModuleDepends on
lib/route.js12 modules
lib/four-oh-four.js9 modules
lib/reply.js9 modules
lib/plugin-override.js7 modules
lib/handle-request.js6 modules

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Developer Onboarding

Engineers ยท Quick start guide for new developers

Welcome to Fastify! ๐Ÿ‘‹

This guide will help you get up to speed quickly. Fastify is a general-purpose tools project built with TypeScript, JavaScript, containing 32 modules across 32 files.

What You'll Learn
  1. โœ… Repository structure and organization
  2. โœ… Technology stack and tools
  3. โœ… Key modules to understand first
  4. โœ… How data flows through the system
  5. โœ… How to start contributing

Quick Reference Card

AspectDetails
LanguagesTypeScript, JavaScript
Frameworksgeneral-purpose tools
Build ToolsStandard toolchain
Size32 modules, 32 files
Domains5 functional areas
TypeCommand-line interface

Repository Structure

Understanding the directory layout is your first step to navigating the codebase:

DirectoryPurposeStart Here?
libApplication source codeโญ Yes
Where to Begin

Focus on these directories first:

  1. `lib` โ€” Application source code

Technology Stack

LayerTechnologiesWhat to Learn
LanguageTypeScript, JavaScriptStrong typing โ€” check types when debugging

Core Modules to Understand

These are the most important modules by size and centrality. Understanding them will unlock the rest of the codebase:

PriorityModuleFilesTypeWhy It Matters
โญ Highroot1Other ModulesKey system component
โญ Highlib/config-validator.js1Shared LibrariesShared code โ€” reused throughout
โญ Highlib/content-type-parser.js1Shared LibrariesShared code โ€” reused throughout
Mediumlib/content-type.js1Shared LibrariesShared code โ€” reused throughout
Mediumlib/context.js1Shared LibrariesShared code โ€” reused throughout
Mediumlib/decorate.js1Shared LibrariesShared code โ€” reused throughout
Lowlib/error-handler.js1Shared LibrariesShared code โ€” reused throughout
Lowlib/error-serializer.js1Shared LibrariesShared code โ€” reused throughout
Lowlib/error-status.js1Shared LibrariesShared code โ€” reused throughout
Lowlib/errors.js1Shared LibrariesShared code โ€” reused throughout
Key Integration Points

These modules are imported by many other files. Changes here have wide impact:

  • `lib/symbols` โ€” Used by 20 files โ€” Utility and helper functions
  • `lib/errors` โ€” Used by 18 files โ€” Utility and helper functions
  • `lib/hooks` โ€” Used by 7 files โ€” Custom hooks and shared state logic
  • `lib/content-type` โ€” Used by 5 files โ€” Utility and helper functions

โš ๏ธ Caution: Be extra careful when modifying these files. Consider the ripple effects.


How Data Flows

Understanding these flows helps you see how the system processes information end-to-end:

FlowDescriptionKey Modules
fastify Request FlowImport chain starting from fastify โ€” traces how this entry...fastify, symbols
Content Delivery FlowResearch articles and content are fetched and displayed to u...content-type-parser.js, content-type.js

Debugging tip: When investigating issues, trace the data flow from input to output to identify where problems occur.


Getting Started Checklist

Follow these steps to set up your development environment:

1. Clone and Install
git clone <repository-url>
cd fastify
npm install  # or yarn, pnpm
2. Explore the Structure
  • Review the directory structure above
  • Open the README.md for project-specific instructions
  • Look for CONTRIBUTING.md for 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:

  1. Find a small bug or typo to fix
  2. Make the change in a feature branch
  3. Run tests to ensure nothing breaks
  4. Submit a pull request for review

Common Pitfalls

New contributors often run into these issues:

  • High-impact modules โ€” symbols is used by 63% of the codebase. Changes here need thorough testing.
  • Environment setup โ€” Check for .env.example files and ensure you have all required environment variables.
  • Branch naming โ€” Follow the team's branch naming conventions (usually feature/, fix/, docs/).

Additional Resources

ResourcePurpose
README.mdProject overview and quick start
CONTRIBUTING.mdContribution guidelines (if exists)
CHANGELOG.mdRecent changes and release history
package.jsonAvailable 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

GraphQL Schema

Engineers ยท GraphQL types, queries, mutations, and resolver map

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

TypeScript Type Graph

Engineers ยท TypeScript interfaces, types, classes, and relationships

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Dependency Graph

Engineers ยท Module dependency analysis with cycle detection

32 files ยท 108 imports ยท 15 external packages ยท โœ“ no circular dependencies

This document maps every import relationship in the codebase, identifies the most-connected modules, and flags circular dependencies that may complicate refactoring or increase build times.

Overview

MetricValue
Source files32
Import edges108
External packages15
Circular dependencies0
Orphan files (no imports or importers)0

Hub Modules

These are the most-imported modules in the codebase. Changes to hub modules have the widest blast radius and should be reviewed carefully:

ModuleImported By
lib/symbols20 files
lib/errors18 files
lib/hooks7 files
lib/content-type5 files

External Dependencies

The codebase imports 15 external packages. These are third-party modules (not the language standard library):

Package
---------
@fastify/ajv-compiler
@fastify/error
@fastify/fast-json-stringify-compiler
@fastify/proxy-addr
abstract-logging
avvio
fast-json-stringify
find-my-way
light-my-request
pino
process-warning
rfdc
secure-json-parse
semver
toad-cache

Generated by RepoLens import analysis. Dependency detection covers JavaScript and TypeScript (ES modules, dynamic import, CommonJS, re-exports; comments, strings, and type-only imports are skipped), Python (`import` / `from ... import`, including relative imports), and Go (`go.mod` module paths). Go `_test.go` files are not part of the graph.*

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Drift

Mixed audience ยท Structural changes compared to baseline snapshot

No baseline found. Run repolens publish once 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:

DimensionWhat is Tracked
ModulesNew, removed, or significantly resized modules
API EndpointsAdded or removed backend routes
DependenciesChanges to external package imports
FrameworksTechnology stack additions or removals
Circular DependenciesIncreases in dependency cycles
GraphQL SchemaType additions or removals
Codebase ScaleOverall file count changes

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Security Hotspots

Engineers ยท Security anti-pattern detection with CWE classification

19 security finding(s) ยท 19 low severity ยท across 11 file(s)

This report identifies code patterns that are commonly associated with security vulnerabilities. Each finding includes the relevant CWE classification and a recommended remediation.

Severity Overview

SeverityCount
๐Ÿ”ต Low19

32 source files scanned ยท 11 files with findings

Prototype Pollution

Deep merge utilities may be vulnerable to prototype pollution if they don't check hasOwnProperty. Verify the implementation.

FileLinePatternSeverityCWE
fastify.js784Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
fastify.js894Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
fastify.js914Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
fastify.js977Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/four-oh-four.js150Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/logger-factory.js100Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/logger-factory.js126Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/logger-pino.js34Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/plugin-override.js64Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/request.js284Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/route.js163Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/route.js288Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/route.js674Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/schema-controller.js16Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/schema-controller.js89Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/schema-controller.js111Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/schemas.js41Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321
lib/server.js172Recursive object merge without prototype check๐Ÿ”ต LowCWE-1321

ReDoS

Dynamic regex construction from user input can cause ReDoS. Use static regex or input validation.

FileLinePatternSeverityCWE
lib/config-validator.js8Potentially catastrophic regex๐Ÿ”ต LowCWE-1333

Affected Files

  • fastify.js
  • lib/config-validator.js
  • lib/four-oh-four.js
  • lib/logger-factory.js
  • lib/logger-pino.js
  • lib/plugin-override.js
  • lib/request.js
  • lib/route.js
  • lib/schema-controller.js
  • lib/schemas.js
  • lib/server.js

Generated by RepoLens security pattern analysis. Detection is regex-based and may produce false positives. Findings should be triaged by a security-aware engineer.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Code Health Report

Mixed audience ยท Per-module health scores from complexity, coupling, docs, and security

32 files analyzed ยท Average health: 75/100 ยท 15 A, 7 B, 10 C, 0 D, 0 F

This report synthesizes complexity, coupling, documentation, and security signals into a single health score per module. Lower scores indicate higher risk and maintenance burden.

Overview

MetricValue
Files analyzed32
Average health score75/100
Average complexity51
Hotspots (score < 60)10

Grade Distribution

GradeCountMeaning
๐ŸŸข A (80โ€“100)15Healthy โ€” low complexity, well-documented
๐Ÿ”ต B (60โ€“79)7Acceptable โ€” minor improvements possible
๐ŸŸก C (40โ€“59)10Needs attention โ€” elevated complexity or coupling
๐ŸŸ  D (20โ€“39)0At risk โ€” multiple quality signals degraded
๐Ÿ”ด F (0โ€“19)0Critical โ€” immediate refactoring recommended

Hotspots โ€” Priority Refactoring Targets

These modules have the lowest health scores and should be prioritized for improvement:

ModuleScoreGradeComplexityCouplingDoc%Security
lib/reply.js44๐ŸŸก C1853โ†“ 9โ†‘โ€”โ€”
fastify.js45๐ŸŸก C1190โ†“ 18โ†‘โ€”4 (0 high)
lib/config-validator.js45๐ŸŸก C4381โ†“ 0โ†‘โ€”1 (0 high)
lib/content-type-parser.js45๐ŸŸก C672โ†“ 4โ†‘โ€”โ€”
lib/request.js45๐ŸŸก C563โ†“ 4โ†‘โ€”1 (0 high)
lib/route.js45๐ŸŸก C1461โ†“ 12โ†‘โ€”3 (0 high)
lib/schemas.js45๐ŸŸก C494โ†“ 3โ†‘โ€”1 (0 high)
lib/server.js45๐ŸŸก C621โ†“ 5โ†‘โ€”1 (0 high)
lib/validation.js45๐ŸŸก C1452โ†“ 3โ†‘โ€”โ€”
lib/handle-request.js55๐ŸŸก C352โ†“ 7โ†‘โ€”โ€”

Most Complex Functions

These functions have the highest cyclomatic complexity and are the most likely sources of bugs:

FunctionFileLineComplexity
validate10()lib/config-validator.js10438
Reply()lib/reply.js6677
addNewRoute()lib/route.js27761
lowerCaseHeadersSchema()lib/validation.js7852
onSendEnd()lib/reply.js59934
ContentTypeParser()lib/content-type-parser.js3332
onAbort()lib/request.js22832
anonymous0()lib/error-serializer.js4428
addHook()fastify.js60027
validate()lib/validation.js38723
_findRoute()fastify.js23622
processOptions()fastify.js88822
route()lib/route.js20622
buildSchemaController()lib/schema-controller.js1122
compileSchemasForValidation()lib/validation.js27321

All Modules by Health Score

ModuleScoreGradeLinesComplexityFan-InFan-Out
lib/reply.js44๐ŸŸก C109918539
fastify.js45๐ŸŸก C1044119018
lib/config-validator.js45๐ŸŸก C118943810
lib/content-type-parser.js45๐ŸŸก C4476724
lib/request.js45๐ŸŸก C4035634
lib/route.js45๐ŸŸก C702146112
lib/schemas.js45๐ŸŸก C2184943
lib/server.js45๐ŸŸก C4416215
lib/validation.js45๐ŸŸก C51914523
lib/handle-request.js55๐ŸŸก C2183527
lib/decorate.js60๐Ÿ”ต B1614142
lib/hooks.js60๐Ÿ”ต B4345872
lib/schema-controller.js73๐Ÿ”ต B1652221
lib/content-type.js75๐Ÿ”ต B2152050
lib/plugin-utils.js77๐Ÿ”ต B1703123
lib/four-oh-four.js79๐Ÿ”ต B1822119
lib/wrap-thenable.js79๐Ÿ”ต B851622
lib/log-controller.js81๐ŸŸข A1681510
lib/error-handler.js82๐ŸŸข A1562446
lib/error-serializer.js85๐ŸŸข A135410
lib/logger-factory.js87๐ŸŸข A1581944
lib/context.js91๐ŸŸข A971332
lib/plugin-override.js97๐ŸŸข A921317
lib/error-status.js100๐ŸŸข A17731
lib/errors.js100๐ŸŸข A5561180
lib/head-route.js100๐ŸŸข A46710
lib/initial-config-validation.js100๐ŸŸข A38722
lib/logger-pino.js100๐ŸŸข A69811
lib/noop-set.js100๐ŸŸข A11110
lib/req-id-gen-factory.js100๐ŸŸข A56431
lib/symbols.js100๐ŸŸข A741200
lib/warnings.js100๐ŸŸข A59130

Scoring Methodology

The health score (0โ€“100) is computed from four dimensions:

FactorWeightHow It's Measured
Complexityโ€“1/pt above 10, โ€“2/pt above 30Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST)
Function complexityโ€“2/pt above 8 per functionHighest complexity function in the file
Couplingโ€“1/5 units above 20Fan-in ร— Fan-out (import connections)
Documentationโ€“10 if <50%, โ€“5 if <80%JSDoc/TSDoc coverage of exports
Securityโ€“10/high, โ€“5/medium findingSecurity anti-pattern findings in file

Generated by RepoLens code health analysis. Complexity covers JavaScript/TypeScript, Python, and Go. It is regex-based and may differ from AST-based tools. Scores are relative indicators, not absolute quality measures.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples