# abdelrahman-osama174/core-fit architecture

> Architecture diagram of the GitHub repository abdelrahman-osama174/core-fit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdelrahman-osama174/core-fit
- Repository: https://github.com/abdelrahman-osama174/core-fit

## Overview

CoreFit is a backend API for a Flutter app and provider dashboard. Users authenticate, then manage wallets, shop from provider markets, or discover and reserve playground slots; providers also manage listings and review performance. Shared capabilities include notifications, reference content, and provider statistics. The graph preserves these documented product areas, but sampled source does not show most controller-to-service wiring, so those links are omitted rather than inferred. Source-index references support the few internal calls shown.

Main entry points: [`src/main/java/com/corefit/service/auth/WalletService.java`](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/auth/WalletService.java) (Wallet Payments), [`src/main/java/com/corefit/service/playground/ReservationService.java`](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/playground/ReservationService.java) (Reservations), [`src/main/java/com/corefit/service/helper/ProviderStatisticsService.java`](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/ProviderStatisticsService.java) (Provider Statistics), [`src/main/java/com/corefit/service/helper/NotificationService.java`](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/NotificationService.java) (Notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Wallet"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_user[("User Accounts<br/>[User.java]")]
  node_wallet["Wallet Payments<br/>[WalletService.java]"]
  node_paymentmethod["Payment Methods<br/>[PaymentMethod.java]"]
end

subgraph group_market["Sports Marketplace"]
  node_marketapi["Market API"]
  node_markets["Market Listings<br/>[MarketService.java]"]
  node_products["Product Catalog"]
  node_orders["Cart and Orders<br/>[OrderService.java]"]
  node_marketdata[("Market Data<br/>[Market.java]")]
end

subgraph group_playground["Playground Booking"]
  node_playgrounds["Playground Listings"]
  node_reservations["Reservations"]
  node_playgrounddata[("Playground Data<br/>[Playground.java]")]
end

subgraph group_shared["Shared Platform"]
  node_notifications["Notifications"]
  node_statistics["Provider Statistics"]
  node_response["API Responses"]
  node_errors["Domain Errors"]
  node_city[("City Data<br/>[City.java]")]
end

node_client(("Mobile App / Dashboard"))
node_stripe["Stripe"]
node_fcm["Firebase Cloud Messaging"]

node_client -->|"register or log in"| node_auth
node_client -->|"manage wallet"| node_wallet
node_client -->|"use market APIs"| node_marketapi
node_client -->|"book playground"| node_reservations
node_client -->|"view provider stats"| node_statistics
node_marketapi -->|"delegates"| node_markets
node_markets -.->|"manages"| node_marketdata
node_products -->|"uses listings"| node_marketdata
node_orders -->|"uses wallet payment"| node_wallet
node_orders -->|"sends updates"| node_notifications
node_orders -->|"checks method"| node_paymentmethod
node_wallet -->|"creates and checks sessions"| node_stripe
node_wallet -->|"updates balance"| node_user
node_wallet -->|"notifies withdrawal"| node_notifications
node_playgrounds -->|"manages listings"| node_playgrounddata
node_reservations -->|"loads playground"| node_playgrounds
node_reservations -->|"books slots"| node_playgrounddata
node_reservations -->|"uses wallet payment"| node_wallet
node_reservations -->|"sends updates"| node_notifications
node_notifications -->|"sends push"| node_fcm
node_auth -->|"creates and verifies"| node_user
node_statistics -->|"checks provider"| node_user
node_statistics -->|"aggregates market activity"| node_marketdata
node_statistics -->|"aggregates booking activity"| node_playgrounddata

click node_auth "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/auth/AuthService.java"
click node_user "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/auth/User.java"
click node_wallet "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/auth/WalletService.java"
click node_marketapi "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/controller/market/MarketController.java"
click node_markets "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/MarketService.java"
click node_products "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/ProductService.java"
click node_orders "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/OrderService.java"
click node_marketdata "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/market/Market.java"
click node_playgrounds "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/playground/PlaygroundService.java"
click node_reservations "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/playground/ReservationService.java"
click node_playgrounddata "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/playground/Playground.java"
click node_notifications "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/NotificationService.java"
click node_statistics "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/ProviderStatisticsService.java"
click node_response "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/dto/response/GeneralResponse.java"
click node_errors "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/exceptions/GeneralException.java"
click node_paymentmethod "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/enums/PaymentMethod.java"
click node_city "https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/helper/City.java"

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_auth,node_user,node_wallet,node_paymentmethod toneBlue
class node_marketapi,node_markets,node_products,node_orders,node_marketdata toneAmber
class node_playgrounds,node_reservations,node_playgrounddata toneMint
class node_notifications,node_statistics,node_response,node_errors,node_city toneRose
class node_client,node_stripe,node_fcm toneIndigo
```

## Components

### Identity and Wallet

- [Authentication](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/auth/AuthService.java): `src/main/java/com/corefit/service/auth/AuthService.java`
- [User Accounts](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/auth/User.java): `src/main/java/com/corefit/entity/auth/User.java`
- [Wallet Payments](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/auth/WalletService.java): `src/main/java/com/corefit/service/auth/WalletService.java`
- [Payment Methods](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/enums/PaymentMethod.java): `src/main/java/com/corefit/enums/PaymentMethod.java`

### Sports Marketplace

- [Market API](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/controller/market/MarketController.java): `src/main/java/com/corefit/controller/market/MarketController.java`
- [Market Listings](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/MarketService.java): `src/main/java/com/corefit/service/market/MarketService.java`
- [Product Catalog](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/ProductService.java): `src/main/java/com/corefit/service/market/ProductService.java`
- [Cart and Orders](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/market/OrderService.java): `src/main/java/com/corefit/service/market/OrderService.java`
- [Market Data](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/market/Market.java): `src/main/java/com/corefit/entity/market/Market.java`

### Playground Booking

- [Playground Listings](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/playground/PlaygroundService.java): `src/main/java/com/corefit/service/playground/PlaygroundService.java`
- [Reservations](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/playground/ReservationService.java): `src/main/java/com/corefit/service/playground/ReservationService.java`
- [Playground Data](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/playground/Playground.java): `src/main/java/com/corefit/entity/playground/Playground.java`

### Shared Platform

- [Notifications](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/NotificationService.java): `src/main/java/com/corefit/service/helper/NotificationService.java`
- [Provider Statistics](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/service/helper/ProviderStatisticsService.java): `src/main/java/com/corefit/service/helper/ProviderStatisticsService.java`
- [API Responses](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/dto/response/GeneralResponse.java): `src/main/java/com/corefit/dto/response/GeneralResponse.java`
- [Domain Errors](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/exceptions/GeneralException.java): `src/main/java/com/corefit/exceptions/GeneralException.java`
- [City Data](https://github.com/abdelrahman-osama174/core-fit/blob/main/src/main/java/com/corefit/entity/helper/City.java): `src/main/java/com/corefit/entity/helper/City.java`

### Other components

- **Mobile App / Dashboard**
- **Stripe**
- **Firebase Cloud Messaging**

## Connections

- Mobile App / Dashboard → Authentication: register or log in
- Mobile App / Dashboard → Wallet Payments: manage wallet
- Mobile App / Dashboard → Market API: use market APIs
- Mobile App / Dashboard → Reservations: book playground
- Mobile App / Dashboard → Provider Statistics: view provider stats
- Market API → Market Listings: delegates (evidence: `src/main/java/com/corefit/controller/market/MarketController.java`)
- Market Listings → Market Data: manages (evidence: `src/main/java/com/corefit/service/market/MarketService.java`)
- Product Catalog → Market Data: uses listings (evidence: `src/main/java/com/corefit/service/market/ProductService.java`)
- Cart and Orders → Wallet Payments: uses wallet payment (evidence: `src/main/java/com/corefit/service/market/OrderService.java`)
- Cart and Orders → Notifications: sends updates (evidence: `src/main/java/com/corefit/service/market/OrderService.java`)
- Cart and Orders → Payment Methods: checks method (evidence: `src/main/java/com/corefit/service/market/OrderService.java`)
- Wallet Payments → Stripe: creates and checks sessions
- Wallet Payments → User Accounts: updates balance (evidence: `src/main/java/com/corefit/service/auth/WalletService.java`)
- Wallet Payments → Notifications: notifies withdrawal (evidence: `src/main/java/com/corefit/service/auth/WalletService.java`)
- Playground Listings → Playground Data: manages listings (evidence: `src/main/java/com/corefit/service/playground/PlaygroundService.java`)
- Reservations → Playground Listings: loads playground (evidence: `src/main/java/com/corefit/service/playground/ReservationService.java`)
- Reservations → Playground Data: books slots (evidence: `src/main/java/com/corefit/service/playground/ReservationService.java`)
- Reservations → Wallet Payments: uses wallet payment (evidence: `src/main/java/com/corefit/service/playground/ReservationService.java`)
- Reservations → Notifications: sends updates (evidence: `src/main/java/com/corefit/service/playground/ReservationService.java`)
- Notifications → Firebase Cloud Messaging: sends push (evidence: `src/main/java/com/corefit/service/helper/NotificationService.java`)
- Authentication → User Accounts: creates and verifies (evidence: `src/main/java/com/corefit/service/auth/AuthService.java`)
- Provider Statistics → User Accounts: checks provider (evidence: `src/main/java/com/corefit/service/helper/ProviderStatisticsService.java`)
- Provider Statistics → Market Data: aggregates market activity (evidence: `src/main/java/com/corefit/service/helper/ProviderStatisticsService.java`)
- Provider Statistics → Playground Data: aggregates booking activity (evidence: `src/main/java/com/corefit/service/helper/ProviderStatisticsService.java`)
