Documentation

Complete API reference for aidxnCC

ParsedHTML
⌘K

Getting Started

Welcome to the aidxnCC documentation! This reference contains detailed information about all services, utilities, types, and components available in my codebase.

ServicesCore business logic for AI, Device, and Domain management
UtilsUtility functions for formatting, styling, and common operations
TypesTypeScript type definitions and interfaces
ThemeDesign tokens, colors, and surface styles
DevicesDevice specifications and portfolio management
DomainsDomain portfolio and DNS management utilities
DocsDocumentation parsing and search functionality

AIService

classServices

Service for AI usage analytics, token tracking, and cost calculations.

Source

Remarks

Provides comprehensive utilities for analyzing Claude API usage including:

  • Activity streaks - Track consecutive days of usage
  • Trend analysis - Linear regression for cost and token projections
  • Heatmap generation - GitHub-style activity visualization
  • Time-range filtering - Support for 7d, 1m, 3m, 6m, 1y, all
  • Model analytics - Usage breakdown by model
  • Token composition - Input, output, and cache token analysis
  • Statistics - Comprehensive metrics and aggregations

All date operations use UTC to ensure consistency across timezones.

DeviceService

classServices

Service for managing device data and computing device metrics.

Source

Remarks

Provides a centralized API for device portfolio management including:

  • Device enrichment with computed metrics (age, category labels)
  • Filtering by type, manufacturer, status, and release year
  • Sorting with type-safe key selection
  • Portfolio statistics and analytics
  • Related device discovery

All methods are static and operate on the device data store without side effects.

DomainService

classServices

Service for managing domain portfolio data and computing domain metrics.

Source

Remarks

This service provides comprehensive domain portfolio management:

  • Automatic metric calculation (expiration, ownership duration)
  • Flexible filtering and sorting
  • Statistical analysis
  • Renewal tracking

All date calculations use UTC to ensure consistency across timezones.

lib/github

interfaceServices

GitHub and Forgejo API integration service with server-side caching.

Source

Remarks

This module provides secure, cached access to GitHub and Forgejo APIs for:

  • Fetching recent repository updates
  • Retrieving repository metrics (stars, forks)
  • Managing featured project data

Security Features:

  • Dual-layer caching (unstable_cache + React cache) prevents API abuse
  • 1-hour revalidation protects GitHub PAT from rate limits
  • Server-side cache shared across all requests

Environment Variables:

  • GITHUB_PROJECTS_USER or GITHUB_USERNAME: Override default username
  • GITHUB_PROJECTS_PAT or GITHUB_PAT: GitHub Personal Access Token (optional)

Properties

PropertyTypeDescription
GitHubRepoSummaryanySimplified repository summary for recent repos list.
FeaturedProjectanyFeatured project with live metrics from GitHub or Forgejo.
getRecentGitHubReposobjectRetrieves recently updated GitHub repositories for the configured user.
Default: ...
getFeaturedReposWithMetricsobjectRetrieves featured projects with live star and fork counts.
Default: ...

services

interfaceServices
Source

Properties

PropertyTypeDescription
DomainServiceany
DeviceServiceany
AIServiceany

services/ai.service

interfaceServices
Source

Properties

PropertyTypeDescription
HeatmapPaletteanyConfiguration for heatmap color palette.
AIStatsResultanyComprehensive AI usage statistics and analytics.
AIServiceanyService for AI usage analytics, token tracking, and cost calculations.

services/device.service

interfaceServices
Source

Properties

PropertyTypeDescription
DevicePortfolioStatsanyStatistics and aggregated metrics for the device portfolio.
DeviceServiceanyService for managing device data and computing device metrics.

services/domain.service

interfaceServices
Source

Properties

PropertyTypeDescription
DomainServiceanyService for managing domain portfolio data and computing domain metrics.
DomainPortfolioStatsanyDomain portfolio statistics result.

Formatter

classUtils

Formatter utility class providing consistent formatting functions for various data types.

Source

Remarks

This class contains static methods for formatting numbers, dates, strings, and other common data types across the application. All methods are pure functions with no side effects.

isExternalHref

functionUtils

Type guard to check if a URL string is an external link (starts with http/https).

Source

Remarks

This function is useful for conditional rendering of external link attributes or icons. It narrows the TypeScript type to indicate an HTTP(S) URL.

Signature

isExternalHref(href?: string): any

Parameters

NameTypeDescription
href?stringURL string to check

Returns

any

Type predicate narrowing href to `http${string}` if external

Examples

1import { isExternalHref, externalLinkProps } from '@/lib/utils/styles'
2
3function Link({ href, children }) {
4  const external = isExternalHref(href)
5
6  return (
7    <a href={href} {...(external ? externalLinkProps : {})}>
8      {children}
9      {external && <ExternalIcon />}
10    </a>
11  )
12}

utils

interfaceUtils
Source

Properties

PropertyTypeDescription
Formatterany
Validatorany
externalLinkPropsany
isExternalHrefany

utils/formatting

interfaceUtils
Source

Properties

PropertyTypeDescription
FormatteranyFormatter utility class providing consistent formatting functions for various data types.

utils/styles

interfaceUtils
Source

Properties

PropertyTypeDescription
externalLinkPropsobjectProps to apply to external links for security and UX best practices.
Default: ...
isExternalHrefany

utils/validation

interfaceUtils
Source

Properties

PropertyTypeDescription
ValidatoranyValidator utility class providing type-safe validation functions with TypeScript type guards.

Validator

classUtils

Validator utility class providing type-safe validation functions with TypeScript type guards.

Source

Remarks

This class contains static methods for validating various data types and formats. Most methods use TypeScript type predicates for runtime type checking and compile-time type narrowing.

lib/types/ai

interfaceTypes

Type definitions for AI usage analytics and token tracking.

Source

Remarks

This module contains interfaces for Claude AI usage data, including:

  • Token consumption metrics (input, output, cache)
  • Cost calculations
  • Daily aggregations
  • Trend analysis
  • Model-specific breakdowns

Properties

PropertyTypeDescription
ModelBreakdownanyBreakdown of AI usage metrics for a specific model.
DailyDataanyAggregated AI usage data for a single day.
TotalsanyAggregated totals across all time periods.
CCDataanyComplete AI usage dataset with daily breakdowns and totals.
ExtendedCCDataanyExtended AI usage data supporting multiple sources (Claude Code, Codex, etc.).
TimeRangeKey"7d" | "1m" | "3m" | "6m" | "1y" | "all"Time range selector keys for filtering AI usage data.
HeatmapDayanySingle day cell data for heatmap visualization.
DailyDataWithTrendanyDaily data extended with trend analysis for chart visualizations.
ModelUsageanyModel usage statistics for pie/bar charts.
TokenTypeUsageanyToken type usage statistics for composition charts.

lib/types/common

interfaceTypes

Common utility types used across my website

Source

Remarks

This module provides fundamental type definitions for date handling, filtering, and pagination. These types are used throughout the application to ensure type safety and consistency.

Properties

PropertyTypeDescription
DateRangeanyRepresents a time range with start and end dates.
FormattedDateanyDate object with pre-computed formatted strings.

lib/types/device

interfaceTypes

Device type definitions for portfolio showcase. Provides comprehensive type safety for device specifications, statistics, sections, and UI components. Supports both mobile devices and DAPs (Digital Audio Players).

Source

Properties

PropertyTypeDescription
DeviceIconReact.ComponentTypeIcon component type for device-related icons.
DeviceType"mobile" | "dap"Device type classification.
StarState"full" | "half" | "empty"Star rating display state.
ExternalHrefanyType-safe external URL starting with http or https.
DeviceBadgeanyBadge display configuration for device highlights.
DeviceStatItemanyIndividual stat item within a stat group.
DeviceStatGroupanyGroup of related device statistics.
DeviceSectionRowanyRow item within a device section showing key-value pairs.
DeviceSectionListItemanyList item within a device section.
DeviceSectionRatinganyRating configuration for device sections.
DeviceSectionanyDevice section containing grouped information.
DeviceSpecanyComplete device specification. Contains all data needed to render a device page including metadata, statistics, sections, and related devices.
DeviceCollectionRecordCollection of devices indexed by slug.
DeviceWithMetricsanyEnriched device with computed metrics. Extends DeviceSpec with age calculations and display labels.
DevicePageShellPropsanyProps for DevicePageShell component.
DeviceHeroPropsanyProps for DeviceHero component.
StatsGridPropsanyProps for StatsGrid component.
StatItemPropsanyProps for StatItem component.
SectionsGridPropsanyProps for SectionsGrid component.
SectionCardPropsanyProps for SectionCard component.
SectionRowPropsanyProps for SectionRow component.
RatingPropsanyProps for Rating component.

lib/types/domain

interfaceTypes

Domain type definitions for portfolio management. Provides comprehensive type safety for domain data, metrics, and UI components. All domain-related interfaces include renewal tracking, ownership metrics, and categorization for portfolio organization.

Source

Properties

PropertyTypeDescription
DomainStatus"active" | "parked" | "reserved"Domain status indicating current usage state.
DomainCategory"personal" | "service" | "project" | "fun" | "legacy"Domain category for portfolio organization.
DomainRegistrarId"Spaceship" | "Namecheap" | "Name.com" | "Dynadot"Supported domain registrar identifiers.
DomainSortOption"name" | "expiration" | "ownership" | "registrar"Sort options for domain lists.
DomainTimelineEventType"registration" | "renewal"Timeline event types for domain history.
RenewalanyDomain renewal record tracking renewal history.
RegistrarConfiganyRegistrar configuration for UI display.
DomainanyCore domain data structure. Base interface containing all raw domain information without computed metrics. Use DomainWithMetrics for enriched data with ownership calculations.
DomainWithMetricsanyEnriched domain data with computed ownership and expiration metrics. Extends Domain with calculated fields for ownership duration, expiration tracking, and renewal progress.
DomainVisualOptionanyVisual styling configuration for domain status/category badges.
DomainVisualConfiganyComplete visual configuration mapping for all domain statuses and categories.
DomainRegistrarMapRecordMapping of registrar IDs to their configuration.
DomainTimelineEventanyDomain timeline event for renewal/registration history display.
DomainCardPropsanyProps for DomainCard component.
DomainDetailsPropsanyProps for DomainDetails component.
DomainTimelinePropsanyProps for DomainTimeline component.
DomainFiltersPropsanyProps for DomainFilters component.

lib/types/service

interfaceTypes

Shared type definitions for service layer operations.

Source

Remarks

This module contains reusable types for common service patterns:

  • Filtering and sorting configurations
  • Statistics and aggregation results
  • Query options and pagination

Properties

PropertyTypeDescription
SortOrder"asc" | "desc"Sort order direction for list operations.
SortConfiganyConfiguration for sorting operations on typed entities.
FilterConfigPartialGeneric filter configuration for entity queries.
StatsResultanyStatistics result containing aggregate metrics.
DateRangeConfiganyDate range configuration for time-based queries.
PaginationConfiganyPagination configuration for list operations.
PaginatedResultanyPaginated result set with metadata.
QueryOptionsanyQuery options combining common patterns.
ServiceResultanyService method result wrapper with metadata.
FilterOperator"eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "nin" | "exists"Comparison operator for advanced filtering.
FilterExpressionanyAdvanced filter expression with operators.
Documentation | aidxnCC