# jayd-h/skatenext architecture

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

- Interactive diagram: https://gitdiagram.com/jayd-h/skatenext
- Repository: https://github.com/jayd-h/skatenext

## Overview

##### Main Components

a. Frontend Layer (Mobile App)
- Present this as the top layer, divided into three main tabs (based on /app/tabs):
- View (Trick Progression)
- Fitness Tracking
- Settings
- Onboarding Flow (/app/components/Onboarding)
- Acts System (Acts 1-4) as part of the progression map

b. Core Services Layer
- Storage Service
- Backup Service
- Trick Recommendation Engine
- Calorie Estimation Service
- Mastery Calculation System

c. Data Layer
- Local Storage (for user progress, settings)
- Static Data Stores (trick data, folder data, trophy data)

##### Component Relationships

- Cross-component communication between UI elements (e.g., Modals system interaction with Acts)

##### Specific Implementation Details

Key architectural elements:
**┌─ User Interface Layer ─────────────────────┐**
- ┌─ Navigation ─┐ ┌─ Acts System ─┐        │
- Tabs         │ │ Act1-4        │        │
- Routing      │ │ NodeButtons   │        │
- ┘ └──────────────┘         │
- ┌─ Modals System ─┐ ┌─ Generic UI ─┐     │
- TrickModal      │ │ Buttons      │     │
- InfoModal       │ │ Alerts       │     │
- ┘ └─────────────┘      │
- ┤
- ┌─ Core Services ──────────────────────┐ │
- StorageService  TrickRecommender     │ │
- BackupService   CalorieEstimation    │ │
- MasteryCalc     UserStats            │ │
- ┘  │
- ┤
- ┌─ Data Layer ───────────────────────┐  │
- Local Storage    Static Data       │  │
- User Progress    Trick Library     │  │
- ┘    │
- ┘

##### Additional Elements

- Data flow directions
- Component types
- Integration points with external services
- Critical user flows (onboarding, trick progression, fitness tracking)

##### Technical Stack Indicators

Following technologies:
- React Native/Expo framework
- TailwindCSS for styling (noted from config files)
- Local storage implementation
- Native device features (haptics, animations)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        direction TB
        
        subgraph NAV["Navigation"]
            MapView["Map View"]
            Fitness["Fitness Tracking"]
            Settings["Settings"]
        end
        
        subgraph ACTS["Acts System"]
            Act1["Act 1"]
            Act2["Act 2"]
            Act3["Act 3"]
            Act4["Act 4"]
            NodeButtons["Node Buttons"]
        end
        
        subgraph MOD["Modals System"]
            GenericModal["Generic Modal"]
            TrickModal["Trick Modal"]
            InfoModal["Info Modal"]
        end
        
        subgraph GEN["Generic UI"]
            Buttons["Buttons"]
            Alerts["Alerts"]
            UserStats["User Stats"]
        end
        
        Onboarding["Onboarding Flow"]
    end
    
    subgraph CORE["Core Services Layer"]
        StorageService["Storage Service"]
        BackupService["Backup Service"]
        TrickRecommender["Trick Recommender"]
        CalorieEstimation["Calorie Estimation"]
        MasteryCalc["Mastery Calculation"]
    end
    
    subgraph DATA["Data Layer"]
        LocalStorage["Local Storage"]
        TrickData["Trick Data"]
        FolderData["Folder Data"]
        TrophyData["Trophy Data"]
        InfoData["Info Data"]
    end
    
    %% Relationships
    NAV --> CORE
    ACTS --> CORE
    MOD --> CORE
    CORE --> DATA
    
    %% Click Events
    click MapView "https://github.com/Jayd-H/SkateNext/blob/master/app/tabs/map.tsx"
    click Fitness "https://github.com/Jayd-H/SkateNext/blob/master/app/tabs/fitness.tsx"
    click Settings "https://github.com/Jayd-H/SkateNext/blob/master/app/tabs/settings.tsx"
    click ACTS "https://github.com/Jayd-H/SkateNext/tree/master/app/components/Acts/"
    click Act1 "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Acts/Act1.tsx"
    click Act2 "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Acts/Act2.tsx"
    click Act3 "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Acts/Act3.tsx"
    click Act4 "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Acts/Act4.tsx"
    click Onboarding "https://github.com/Jayd-H/SkateNext/tree/master/app/components/Onboarding/"
    click StorageService "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Utils/StorageService.ts"
    click BackupService "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Utils/backupService.ts"
    click TrickRecommender "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Utils/trickRecommender.ts"
    click CalorieEstimation "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Utils/calorieEstimation.ts"
    click MasteryCalc "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Utils/masteryCalculation.ts"
    click TrickData "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Data/trickData.ts"
    click FolderData "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Data/folderData.ts"
    click TrophyData "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Data/trophyData.ts"
    click InfoData "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Data/infoData.ts"
    click GenericModal "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Modals/GenericModal.tsx"
    click TrickModal "https://github.com/Jayd-H/SkateNext/tree/master/app/components/Modals/TrickModal/"
    click InfoModal "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Modals/InfoModal.tsx"
    click Buttons "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Generic/Button.tsx"
    click Alerts "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Generic/Alert.tsx"
    click UserStats "https://github.com/Jayd-H/SkateNext/blob/master/app/components/Generic/UserStats.tsx"
    click NodeButtons "https://github.com/Jayd-H/SkateNext/tree/master/app/components/Acts/NodeButtons/"

    %% Styling
    classDef ui fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef core fill:#90EE90,stroke:#333,stroke-width:2px
    classDef data fill:#FFE5B4,stroke:#333,stroke-width:2px
    
    class MapView,Fitness,Settings,Act1,Act2,Act3,Act4,NodeButtons,GenericModal,TrickModal,InfoModal,Buttons,Alerts,UserStats,Onboarding ui
    class StorageService,BackupService,TrickRecommender,CalorieEstimation,MasteryCalc core
    class LocalStorage,TrickData,FolderData,TrophyData,InfoData data
```
