# uixmat/onborda architecture

> Architecture diagram of the GitHub repository uixmat/onborda, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uixmat/onborda
- Repository: https://github.com/uixmat/onborda

## Overview

##### Main Components

a) Core Components Layer:
- Onborda Component
- OnbordaProvider (Context)
- Custom Card Component Interface

b) Integration Layer:
- Next.js Application Integration
- Framer Motion Integration
- TailwindCSS Integration

c) Feature Layer:
- Tour Management System
- Step Navigation System
- Pointer/Tooltip System

**┌─ Application Layer ─────────────────────┐**
- Next.js Application                   │
- (Consumer of Onborda)                 │
- ┬─────────────────────────┘
- ↓
**┌─ Core Layer ──────────────────────────────────────────┐**
- ┌─ OnbordaProvider ─┐     ┌─ Onborda Component ─┐   │
- Context State    │ ←→  │  Step Management    │   │
- Tour Management  │     │  Navigation Logic   │   │
- ┘     └──────────────────────┘   │
- ┬──────────────────────┬────────────────┘
- ↓                       ↓
**┌─ Feature Layer ───────┐    ┌─ UI Layer ────────────┐**
- • Tour System        │    │  • Default Card       │
- • Step Navigation    │    │  • Custom Card        │
- • Route Management   │    │  • Pointer System     │
- ┬──────────────┘    └──────────┬────────────┘
- ↓                              ↓
**┌─ Integration Layer ───────────────────────────────────┐**
- Framer Motion         TailwindCSS                   │
- (Animations)          (Styling)                     │
- ┘

##### Important Flows to Highlight

- Data flow from OnbordaProvider to Onborda component
- Step navigation flow between components
- Integration points with Next.js routing system
- Custom card component injection flow

##### Additional Details

- Step object structure
- Tour management system
- Pointer positioning system
- Card component props flow

##### Technical Specifications to Note

- TypeScript interfaces
- Component prop types
- Available configuration options
- Animation transition types

##### Implementation Notes

- The lightweight nature of the library
- The flexibility of the custom card system
- The integration with Next.js routing
- The separation between core functionality and UI components

Remember to:
- Version information
- Dependencies (framer-motion, tailwindcss)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Application
        NextApp[Next.js Application]
    end

    subgraph CoreLayer[Core Layer]
        Provider[OnbordaProvider]:::core
        OnbordaComp[Onborda Component]:::core
        Provider <--> OnbordaComp
    end

    subgraph FeatureLayer[Feature Layer]
        TourSystem[Tour Management System]:::feature
        StepNav[Step Navigation System]:::feature
        RouteManage[Route Management]:::feature
    end

    subgraph UILayer[UI Layer]
        DefaultCard[Default Card]:::ui
        CustomCard[Custom Card]:::ui
        PointerSystem[Pointer/Tooltip System]:::ui
    end

    subgraph IntegrationLayer[Integration Layer]
        FramerMotion[Framer Motion]:::integration
        TailwindCSS[TailwindCSS]:::integration
    end

    NextApp --> Provider
    Provider --> TourSystem
    Provider --> StepNav
    Provider --> RouteManage
    
    OnbordaComp --> DefaultCard
    OnbordaComp --> CustomCard
    OnbordaComp --> PointerSystem
    
    DefaultCard --> FramerMotion
    CustomCard --> FramerMotion
    PointerSystem --> FramerMotion
    
    DefaultCard --> TailwindCSS
    CustomCard --> TailwindCSS
    PointerSystem --> TailwindCSS

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef feature fill:#2ecc71,stroke:#27ae60,color:white
    classDef ui fill:#e67e22,stroke:#d35400,color:white
    classDef integration fill:#9b59b6,stroke:#8e44ad,color:white
    
    click Provider "https://github.com/uixmat/onborda/blob/main/src/OnbordaContext.tsx"
    click OnbordaComp "https://github.com/uixmat/onborda/blob/main/src/Onborda.tsx"
    click TourSystem "https://github.com/uixmat/onborda/blob/main/src/types/index.ts"
    click StepNav "https://github.com/uixmat/onborda/blob/main/src/types/index.ts"
    click RouteManage "https://github.com/uixmat/onborda/blob/main/src/types/index.ts"

    subgraph Legend
        CoreComp[Core Components]:::core
        FeatureComp[Feature Components]:::feature
        UIComp[UI Components]:::ui
        IntegrationComp[Integration Components]:::integration
    end
```
