# seharbashir/groomify architecture

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

- Interactive diagram: https://gitdiagram.com/seharbashir/groomify
- Repository: https://github.com/seharbashir/groomify

## Overview

##### Project type and purpose
- This is a React Native mobile application (“Groomify”) that connects salon owners and clients.
- Users can browse services (haircuts, facials, massage, etc.), book appointments, rate services; salons can manage services, view appointments, and collect feedback.
- It integrates with a chatbot, Firebase for configuration/auth, and a custom Groomify backend API.

##### File structure
- Top-level files:
- index.js & App.js: app entry points
- app.json: React Native configuration
- firebaseConfig.js & config/config.js: environment and Firebase settings
- package.json / package-lock.json: dependencies
- Directories:
- assets/: animations & images used by UI
- components/: all React components, subdivided into common, salons, users
- services/: wrappers for external HTTP APIs (ChatbotAPI.js, GroomifyAPI.js)
- hooks/: custom React hooks (useChatbot.js)
- utils/: shared utilities (network, email, chat rendering)
- constants/: application-wide constants for chat flows
- config/: potential toggles and environment abstractions
- No backend code here—only API clients. Deployment is purely mobile (iOS/Android), calling external services.

##### README for additional insights
- README is minimal but project name “Groomify” indicates salon-booking focus.
- docs/ contains CHATBOT_INTEGRATION.md and IMAGE_PICKER_FIX_GUIDE.md, pointing to specialized subsystems (chatbot, image picker).

##### Detail
- Within UI, group screens by domain (users vs. salons).
- Flows:
- “User taps BookService → GroomifyAPI POST /bookings”
- “Chat message → useChatbot → ChatbotAPI → Dialogflow”
- “Login → Firebase Auth → returns token”
- Avoid over-splitting; capture each logical module and its dependencies to reflect the structure in the file tree.

## Diagram (Mermaid)

```mermaid
graph TB
  %% Mobile Application
  subgraph "Groomify Mobile App" 
    direction TB
    %% Entry Points
    Index["index.js"]:::client
    AppFile["App.js"]:::client
    AppJson["app.json"]:::client

    %% Layers
    subgraph "UI Layer"
      direction TB
      Common["Common Components"]:::client
      SalonUI["Salon Screens & Components"]:::client
      UserUI["User Screens & Components"]:::client
    end

    subgraph "Business Logic Layer"
      direction TB
      Hook["useChatbot Hook"]:::client
      UtilChat["ChatUtils"]:::client
      UtilNetwork["NetworkUtils"]:::client
      UtilEmail["EmailService"]:::client
      Const["ChatConstants"]:::client
    end

    subgraph "Service Layer"
      direction TB
      ChatAPI["ChatbotAPI"]:::client
      GroomifyAPI["GroomifyAPI"]:::client
      ConfigFirebase["Firebase Config"]:::client
      ConfigEnv["Env & Feature Config"]:::client
    end

    subgraph "Assets"
      direction TB
      Animations["Animations"]:::client
      Images["Images"]:::client
    end

    %% Flows within App
    Index -->|launches| AppFile
    AppFile -->|renders UI| Common
    AppFile -->|renders UI| SalonUI
    AppFile -->|renders UI| UserUI
    Common -->|"uses hooks/utils"| Hook
    SalonUI -->|"uses hooks/utils"| Hook
    UserUI -->|"uses hooks/utils"| Hook
    Hook -->|calls| ChatAPI
    Hook -->|calls| GroomifyAPI
    Hook -->|reads| Const
    Common -->|loads assets| Animations
    Common -->|loads assets| Images
    SalonUI -->|loads assets| Images
  end

  %% External Services
  GroomifyBackend["Groomify Backend API"]:::external
  Firebase["Firebase Auth & Database"]:::external
  ChatbotService["Chatbot Service"]:::external
  AssetStorage["Assets Storage/CDN"]:::external

  %% Service Layer to External
  ChatAPI -->|sends chat message| ChatbotService
  GroomifyAPI -->|booking/feedback calls| GroomifyBackend
  ConfigFirebase -->|auth requests| Firebase
  ConfigEnv -->|config fetch| Firebase
  Animations -->|optional remote fetch| AssetStorage
  Images -->|optional remote fetch| AssetStorage

  %% Click Events
  click Common "https://github.com/seharbashir/groomify/tree/main/components/common/"
  click SalonUI "https://github.com/seharbashir/groomify/tree/main/components/salons/"
  click UserUI "https://github.com/seharbashir/groomify/tree/main/components/users/"
  click ChatAPI "https://github.com/seharbashir/groomify/blob/main/services/ChatbotAPI.js"
  click GroomifyAPI "https://github.com/seharbashir/groomify/blob/main/services/GroomifyAPI.js"
  click Hook "https://github.com/seharbashir/groomify/blob/main/hooks/useChatbot.js"
  click UtilChat "https://github.com/seharbashir/groomify/blob/main/utils/ChatUtils.js"
  click UtilNetwork "https://github.com/seharbashir/groomify/blob/main/utils/NetworkUtils.js"
  click UtilEmail "https://github.com/seharbashir/groomify/blob/main/utils/emailservice.js"
  click Const "https://github.com/seharbashir/groomify/blob/main/constants/ChatConstants.js"
  click ConfigFirebase "https://github.com/seharbashir/groomify/blob/main/firebaseConfig.js"
  click ConfigEnv "https://github.com/seharbashir/groomify/blob/main/config/config.js"
  click Animations "https://github.com/seharbashir/groomify/tree/main/assets/animations/"
  click Images "https://github.com/seharbashir/groomify/tree/main/assets/images/"
  click Index "https://github.com/seharbashir/groomify/blob/main/index.js"
  click AppFile "https://github.com/seharbashir/groomify/blob/main/App.js"
  click AppJson "https://github.com/seharbashir/groomify/blob/main/app.json"

  %% Styles
  classDef client fill:#e0f7fa,stroke:#006064,color:#000;
  classDef external fill:#e8f5e9,stroke:#2e7d32,color:#000;
```
