Skip to content

Repository files navigation

πŸ’… Beauty Center

Cross-platform (Windows & Android) app manager for beauty and wellness centers β€” powered by Flutter, Drift & Supabase.


πŸ“Š Status & Metrics

Build Latest Release Downloads

License wakatime Last Commit


🧰 Tech Stack

Flutter Dart Drift Supabase Riverpod


✨ What is Beauty Center?

Beauty Center is a cross-platform app (Windows & Android) built in Flutter for managing beauty and wellness centers.

🎯 Key Features

  • πŸ“… Appointments: Schedule with drag-and-drop calendar, conflict detection, service bundles
  • πŸ§β€β™€οΈ Clients: Complete CRM with phone sync, history tracking, notes
  • πŸ’†β€β™€οΈ Treatments: Service catalog with customizable prices and durations
  • πŸ“‹ Quotes: Create professional estimates, convert to packages
  • πŸ“¦ Packages: Multi-session bundles with payment tracking
  • πŸ’³ Fidelity Cards: Prepaid credit system with transaction history
  • πŸ’° Payments: Multi-method tracking (cash, card, transfer, fidelity)
  • πŸ›οΈ Product Sales: Inventory with locked pricing at sale time
  • πŸ“Š Statistics: Business insights and reporting
  • βš™οΈ Settings: Operators, cabins, work hours, blocked slots

πŸ”Œ Offline-First Architecture

🧠 Read-Only Offline Mode: When connection is lost, the app switches to read-only mode. All data remains accessible for viewing, but modifications are disabled until connection is restored.


πŸ—οΈ Architecture

lib/
β”œβ”€β”€ core/                    # Foundation layer
β”‚   β”œβ”€β”€ connectivity/        # Network state management
β”‚   β”œβ”€β”€ database/            # Drift (SQLite) + Supabase schema
β”‚   β”œβ”€β”€ providers/           # Global state (offline status, auth)
β”‚   β”œβ”€β”€ sync/                # Sync orchestration
β”‚   β”œβ”€β”€ theme/               # App theming
β”‚   └── widgets/             # Shared UI components
β”‚
β”œβ”€β”€ features/                # Feature modules
β”‚   β”œβ”€β”€ appointments/        # Calendar, scheduling, conflicts
β”‚   β”œβ”€β”€ clients/             # CRM, contacts sync
β”‚   β”œβ”€β”€ fidelity/            # Loyalty cards, transactions
β”‚   β”œβ”€β”€ packages/            # Service bundles
β”‚   β”œβ”€β”€ payments/            # Payment tracking
β”‚   β”œβ”€β”€ product_sales/       # Product inventory
β”‚   β”œβ”€β”€ products/            # Product catalog
β”‚   β”œβ”€β”€ quotes/              # Estimates & proposals
β”‚   β”œβ”€β”€ settings/            # Configuration
β”‚   β”œβ”€β”€ statistics/          # Analytics
β”‚   └── treatments/          # Services catalog
β”‚
β”œβ”€β”€ home/                    # Main dashboard
β”œβ”€β”€ l10n/                    # Localization (i18n)
└── main.dart                # App entry point

πŸ”§ Technical Design Patterns

Layer Technology Purpose
State Management Riverpod + Code Generation Reactive, testable state
Local Database Drift (SQLite) Offline data, fast queries
Remote Backend Supabase (PostgreSQL) Cloud sync, realtime, auth
Sync Strategy Delta sync + Realtime Efficient data synchronization
UI Framework Material 3 + FlexColorScheme Modern, accessible design
Logging Talker Comprehensive debugging

πŸ“¦ Install & Run

Prerequisites

  • Flutter SDK >= 3.41.6
  • Dart SDK >= 3.11.0
  • Android Studio / VS Code
  • Windows 10+ or Android SDK

Setup

# 1. Clone repository
git clone https://github.com/Fede22dev/beauty_center.git
cd beauty_center

# 2. Install dependencies
flutter pub get

# 3. Generate localization files
flutter gen-l10n

# 4. Generate code (Riverpod, Drift, etc.)
dart run build_runner build --delete-conflicting-outputs

# 5. Generate assets
dart run flutter_launcher_icons
dart run flutter_native_splash:create

Database Setup

  1. Create a Supabase project
  2. Run the SQL script in Supabase_SQL_Setup.sql in the SQL Editor
  3. Enable Realtime for all tables
  4. Set Row Level Security (RLS) policies as defined in the SQL

Configuration

Create a secure storage entry for Supabase credentials:

# Windows (PowerShell)
flutter run -d windows --dart-define=ADMIN_PIN=your_secure_pin

# Android
flutter run -d android --dart-define=ADMIN_PIN=your_secure_pin

For production builds, configure CI/CD secrets in GitHub Actions.


πŸ”„ Data Synchronization

Sync Architecture

  1. Local-First Writes: All changes saved to Drift (SQLite) immediately
  2. Async Cloud Sync: Non-blocking push to Supabase
  3. Delta Pull: Only fetch changed records since last sync
  4. Realtime Updates: Live sync from remote to local via WebSocket

Sync Order (Dependencies)

1. Settings, Clients, Services, Products (base tables)
2. Operators, Blocked Slots, Appointments
3. Quotes, Packages, Fidelity Cards
4. Payments, Product Sales

🌐 Offline Behavior

Mode Behavior Data Access
Online Full read/write All operations
Offline Read-only View-only, no edits
Poor Connection Queued writes Optimistic UI with retry

When offline:

  • All creation buttons disabled
  • All edit forms disabled
  • All delete actions disabled
  • Data remains fully viewable
  • Automatic re-sync on reconnection

πŸ§ͺ Testing

# Run unit tests
flutter test

# Run integration tests
flutter test integration_test/

# Check code analysis
flutter analyze

# Verify formatting
dart format --set-exit-if-changed .

πŸ“± Supported Platforms

Platform Status Notes
Windows 10/11 βœ… Primary Full-featured desktop app
Android βœ… Supported Mobile-optimized UI
iOS ⚠️ Untested Should work, not verified
macOS ⚠️ Untested Should work, not verified
Linux ⚠️ Untested Community testing welcome

πŸ› οΈ Development Commands

# Generate code after model changes
dart run build_runner build --delete-conflicting-outputs

# Watch for changes during development
dart run build_runner watch

# Generate database schema visualization
dart run drift_dev schema dump

# Build release APK
flutter build apk --release

# Build Windows installer
flutter build windows --release

πŸ“ Project Structure Notes

Database Schema

The app uses a unified schema across Drift (local) and Supabase (remote):

  • Core Tables: appointments, clients, services, operators, cabins
  • Business Tables: quotes, packages, fidelity_cards, payments
  • Junction Tables: appointment_services, package_items, quote_items
  • Transaction Tables: fidelity_transactions, product_sales

All tables support:

  • Soft deletes (is_active column)
  • Timestamps (created_at, updated_at)
  • UUID primary keys (v7 for local, gen_random_uuid() for remote)

Constants & Validation

Validation limits are defined in lib/core/constants/app_constants.dart:

  • String length constraints
  • Numeric ranges
  • Enum definitions (PaymentMethod, DiscountType)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file.


πŸ™ Acknowledgments


Author

Made with ❀️ by Fede22dev


About

Cross-platform (Windows & Android) flutter app manager for beauty and wellness centers.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages