# dalpat98/barber-booking-app architecture

> Architecture diagram of the GitHub repository dalpat98/barber-booking-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dalpat98/barber-booking-app
- Repository: https://github.com/dalpat98/barber-booking-app

## Overview

#### Purpose and runtime
This is a Flutter/Dart mobile client for discovering nearby barber shops, viewing their services/gallery/reviews, and selecting appointment slots. It is described as part of a larger fashion-recommendation concept, but this repository contains the barber-booking app UI and local data layer. It targets Android and iOS; run through Flutter from the repository root.

#### Entry points and host integration
Flutter starts at `lib/main.dart`, which composes the application and its screen flow. Native hosts bootstrap Flutter and register plugins:
- `android/app/src/main/kotlin/com/example/basp/MainActivity.kt`
- `ios/Runner/AppDelegate.swift`
- `android/app/src/main/AndroidManifest.xml`

The Android manifest and iOS app delegate are also the documented integration boundary for Google Maps API-key configuration.

#### Discovery and map stage
Map/location discovery is centered on the map screen and map-specific provider/model:
- `lib/screens/mapsScreen.dart`
- `lib/Provider/map_data_provider.dart`
- `lib/core/Data_models/map_data_model.dart`

This stage presents Google Maps preview and location/barber search, then supplies selected shop/map information to detail and booking-oriented UI. Map records appear to be sourced from bundled temporary JSON rather than a repository-visible backend: `lib/Temporary_data/map_data.json`.

#### Barber detail and catalog stage
Barber-specific content is represented separately from map data, including service offerings and comments/reviews:
- `lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart`
- `lib/core/Data_models/barber_data_from_map/service_mode.dart`
- `lib/core/Data_models/barber_data_from_map/comment_model.dart`

`lib/Provider/barber_data_from_map_provider.dart` is the intended boundary for converting selected-map-barber context into detail data. A duplicated nested provider path, `lib/Provider/barber_data_from_map_provider.dart/barber_data_from_map_provider.dart`, should be treated carefully when tracing the effective implementation.

#### Detail presentation
Reusable detail sections split the barber profile into visual/gallery and service catalog views:
- `lib/Views/gallerybody.dart`
- `lib/Views/serviceBody.dart`

These views consume barber detail data and lead users toward choosing a service and starting booking, rather than owning discovery or native-map concerns.

#### Appointment flow
Booking is implemented as a screen-level workflow, with a separate appointment-oriented screen:
- `lib/screens/bookingScreen.dart`
- `lib/screens/AppointmentScreen.dart`

The intended control flow is map/search → barber detail/gallery/services → preferred time slot → appointment confirmation. The README advertises payment and discounts, but no explicit payment-service integration or backend API layer is present in the supplied tree; treat payment as UI/product scope until implementation is verified.

#### Data and service boundaries
The app’s visible data source is local fixture-style JSON:
- `lib/Temporary_data/map_data.json`
- `lib/Temporary_data/barber_data_from_map.json`

Providers isolate screens from these records, while models define the app’s domain shape. There is no visible server, authentication system, database, payment SDK, or API client, so availability, appointments, reviews, and pricing likely remain static/demo data unless dependencies reveal otherwise.

#### Infrastructure
Flutter is the primary runtime, with Gradle Android packaging under `android/app/build.gradle` and Xcode/iOS Runner packaging under `ios/Runner.xcodeproj/project.pbxproj`. Google Maps is the material external platform dependency and requires platform API-key setup. Internet connectivity is stated as a dependency, but no concrete remote service endpoint is represented in the repository tree.

Main entry points: [`lib/Provider/barber_data_from_map_provider.dart`](https://github.com/dalpat98/barber-booking-app/tree/main/lib/Provider/barber_data_from_map_provider.dart) (Barber detail provider), [`lib/screens/mapsScreen.dart`](https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/mapsScreen.dart) (Map & discovery), [`lib/Provider/map_data_provider.dart`](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Provider/map_data_provider.dart) (Map data provider), [`lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart`](https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart) (Barber detail model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter app"]
  node_main["App entry &amp; navigation<br/>Flutter entry<br/>[main.dart]"]
  node_map_screen["Map &amp; discovery<br/>Flutter screen<br/>[mapsScreen.dart]"]
  node_map_provider["Map data provider"]
  node_detail_provider["Barber detail provider"]
  node_gallery["Gallery detail section<br/>Flutter view<br/>[gallerybody.dart]"]
  node_services["Service catalog section<br/>Flutter view<br/>[serviceBody.dart]"]
  node_booking["Booking workflow<br/>Flutter screen<br/>[bookingScreen.dart]"]
  node_appointment["Appointment confirmation<br/>Flutter screen"]
end

subgraph group_data["Local data layer"]
  node_map_model["Map record model<br/>Dart model"]
  node_map_fixture["Map fixture data<br/>JSON fixture<br/>[map_data.json]"]
  node_barber_model["Barber detail model<br/>Dart model"]
  node_service_model["Service model<br/>Dart model<br/>[service_mode.dart]"]
  node_comment_model["Review model<br/>Dart model<br/>[comment_model.dart]"]
  node_barber_fixture["Barber detail fixture<br/>JSON fixture"]
end

subgraph group_platform["Native platforms"]
  node_android_host["Android Flutter host<br/>Android host<br/>[MainActivity.kt]"]
  node_android_manifest["Android map configuration<br/>Android manifest"]
  node_ios_host["iOS Flutter host<br/>iOS host<br/>[AppDelegate.swift]"]
end

node_google_maps{{"Google Maps<br/>External platform"}}

node_android_host -->|"boots Flutter"| node_main
node_ios_host -->|"boots Flutter"| node_main
node_main -->|"starts discovery"| node_map_screen
node_map_screen -->|"reads map data"| node_map_provider
node_map_provider -->|"loads"| node_map_fixture
node_map_provider -->|"maps records"| node_map_model
node_map_screen -->|"renders map"| node_google_maps
node_android_manifest -.->|"configures API key"| node_google_maps
node_ios_host -.->|"configures API key"| node_google_maps
node_map_screen -->|"selects barber"| node_detail_provider
node_detail_provider -->|"loads"| node_barber_fixture
node_detail_provider -->|"builds detail"| node_barber_model
node_barber_model -->|"includes services"| node_service_model
node_barber_model -->|"includes reviews"| node_comment_model
node_detail_provider -->|"supplies profile"| node_gallery
node_detail_provider -->|"supplies catalog"| node_services
node_services -->|"chosen service"| node_booking
node_gallery -->|"starts booking"| node_booking
node_booking -->|"confirms slot"| node_appointment

click node_main "https://github.com/dalpat98/barber-booking-app/blob/main/lib/main.dart"
click node_map_screen "https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/mapsScreen.dart"
click node_map_provider "https://github.com/dalpat98/barber-booking-app/blob/main/lib/Provider/map_data_provider.dart"
click node_map_model "https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/map_data_model.dart"
click node_map_fixture "https://github.com/dalpat98/barber-booking-app/blob/main/lib/Temporary_data/map_data.json"
click node_detail_provider "https://github.com/dalpat98/barber-booking-app/tree/main/lib/Provider/barber_data_from_map_provider.dart"
click node_barber_model "https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart"
click node_service_model "https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/service_mode.dart"
click node_comment_model "https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/comment_model.dart"
click node_barber_fixture "https://github.com/dalpat98/barber-booking-app/blob/main/lib/Temporary_data/barber_data_from_map.json"
click node_gallery "https://github.com/dalpat98/barber-booking-app/blob/main/lib/Views/gallerybody.dart"
click node_services "https://github.com/dalpat98/barber-booking-app/blob/main/lib/Views/serviceBody.dart"
click node_booking "https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/bookingScreen.dart"
click node_appointment "https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/AppointmentScreen.dart"
click node_android_host "https://github.com/dalpat98/barber-booking-app/blob/main/android/app/src/main/kotlin/com/example/basp/MainActivity.kt"
click node_android_manifest "https://github.com/dalpat98/barber-booking-app/blob/main/android/app/src/main/AndroidManifest.xml"
click node_ios_host "https://github.com/dalpat98/barber-booking-app/blob/main/ios/Runner/AppDelegate.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_map_screen,node_map_provider,node_detail_provider,node_gallery,node_services,node_booking,node_appointment toneBlue
class node_map_model,node_map_fixture,node_barber_model,node_service_model,node_comment_model,node_barber_fixture toneAmber
class node_android_host,node_android_manifest,node_ios_host toneMint
class node_google_maps toneNeutral
```

## Components

### Flutter app

- [App entry & navigation](https://github.com/dalpat98/barber-booking-app/blob/main/lib/main.dart): Flutter entry · Composes the screen flow. · `lib/main.dart`
- [Map & discovery](https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/mapsScreen.dart): Flutter screen · Searches nearby barbers and shows a Google Maps preview. · `lib/screens/mapsScreen.dart`
- [Map data provider](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Provider/map_data_provider.dart): Provider · `lib/Provider/map_data_provider.dart`
- [Barber detail provider](https://github.com/dalpat98/barber-booking-app/tree/main/lib/Provider/barber_data_from_map_provider.dart): Provider · Transforms the selected map barber into detail content. · `lib/Provider/barber_data_from_map_provider.dart`
- [Gallery detail section](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Views/gallerybody.dart): Flutter view · `lib/Views/gallerybody.dart`
- [Service catalog section](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Views/serviceBody.dart): Flutter view · Lets users choose a service before booking. · `lib/Views/serviceBody.dart`
- [Booking workflow](https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/bookingScreen.dart): Flutter screen · Selects a preferred appointment slot. · `lib/screens/bookingScreen.dart`
- [Appointment confirmation](https://github.com/dalpat98/barber-booking-app/blob/main/lib/screens/AppointmentScreen.dart): Flutter screen · `lib/screens/AppointmentScreen.dart`

### Local data layer

- [Map record model](https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/map_data_model.dart): Dart model · `lib/core/Data_models/map_data_model.dart`
- [Map fixture data](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Temporary_data/map_data.json): JSON fixture · Bundled temporary discovery records. · `lib/Temporary_data/map_data.json`
- [Barber detail model](https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart): Dart model · `lib/core/Data_models/barber_data_from_map/barber_data_from_map_model.dart`
- [Service model](https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/service_mode.dart): Dart model · `lib/core/Data_models/barber_data_from_map/service_mode.dart`
- [Review model](https://github.com/dalpat98/barber-booking-app/blob/main/lib/core/Data_models/barber_data_from_map/comment_model.dart): Dart model · `lib/core/Data_models/barber_data_from_map/comment_model.dart`
- [Barber detail fixture](https://github.com/dalpat98/barber-booking-app/blob/main/lib/Temporary_data/barber_data_from_map.json): JSON fixture · Bundled service and review data. · `lib/Temporary_data/barber_data_from_map.json`

### Native platforms

- [Android Flutter host](https://github.com/dalpat98/barber-booking-app/blob/main/android/app/src/main/kotlin/com/example/basp/MainActivity.kt): Android host · `android/app/src/main/kotlin/com/example/basp/MainActivity.kt`
- [Android map configuration](https://github.com/dalpat98/barber-booking-app/blob/main/android/app/src/main/AndroidManifest.xml): Android manifest · Google Maps API-key integration boundary. · `android/app/src/main/AndroidManifest.xml`
- [iOS Flutter host](https://github.com/dalpat98/barber-booking-app/blob/main/ios/Runner/AppDelegate.swift): iOS host · Google Maps API-key integration boundary. · `ios/Runner/AppDelegate.swift`

### Other components

- **Google Maps**: External platform · Requires API-key setup in native hosts.

## Connections

- Android Flutter host → App entry & navigation: boots Flutter
- iOS Flutter host → App entry & navigation: boots Flutter
- App entry & navigation → Map & discovery: starts discovery
- Map & discovery → Map data provider: reads map data
- Map data provider → Map fixture data: loads
- Map data provider → Map record model: maps records
- Map & discovery → Google Maps: renders map
- Android map configuration → Google Maps: configures API key
- iOS Flutter host → Google Maps: configures API key
- Map & discovery → Barber detail provider: selects barber
- Barber detail provider → Barber detail fixture: loads
- Barber detail provider → Barber detail model: builds detail
- Barber detail model → Service model: includes services
- Barber detail model → Review model: includes reviews
- Barber detail provider → Gallery detail section: supplies profile
- Barber detail provider → Service catalog section: supplies catalog
- Service catalog section → Booking workflow: chosen service
- Gallery detail section → Booking workflow: starts booking
- Booking workflow → Appointment confirmation: confirms slot
