Skip to content
Team-6-CUFEPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

270 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HARMONICA 🎡

Cross-Platform Music & Social Experience

A beautiful, feature-rich Flutter application built for music discovery, social interaction, and premium streaming experience. Built with modern architecture patterns and clean code principles.


πŸ“‹ Table of Contents


🎯 Overview

Harmonica is a comprehensive music and social platform that combines:

  • 🎢 Music Streaming & Discovery - Browse, discover, and stream music
  • πŸ‘₯ Social Messaging - Real-time messaging with Socket.IO support
  • πŸ”” Notifications - Keep users updated with real-time notifications
  • πŸ’Ώ User Profiles - Rich user profiles with social features
  • πŸ’Ž Premium Features - Subscription-based premium content access
  • 🎀 Audio Playback - High-quality audio player with controls

✨ Features

Core Features

  • Authentication - Secure login/signup with OAuth integration (Google, Facebook)
  • Music Player - Full-featured audio player with queue management
  • Feed & Discovery - Personalized music recommendations and trending content
  • Real-time Messaging - Socket-based chat with typing indicators and read receipts
  • User Profiles - Customizable profiles with follow/unfollow system
  • Premium Subscription - Stripe-integrated payment system
  • Notifications - Real-time notifications with Firebase Cloud Messaging
  • Search - Advanced search functionality across tracks, artists, and playlists
  • Social Sharing - Share tracks and playlists with friends

Technical Features

  • Responsive Design - Works seamlessly on mobile and tablet
  • Offline Support - Shared preferences for data persistence
  • Real-time Sync - Socket.IO for live messaging and notifications
  • Secure Storage - Cookie management and secure authentication
  • Deep Linking - App Links support for deep navigation

πŸ› οΈ Tech Stack

Core Framework

  • Flutter (Dart 3.11+) - Cross-platform UI framework
  • Dart (91.9% of codebase) - Primary language

State Management

  • Flutter BLoC - Business Logic Component pattern
  • GetIt - Service locator for dependency injection
  • Injectable - Code generation for DI

Networking & Real-time

  • Dio - HTTP client with interceptors
  • Socket.IO Client - WebSocket communication for real-time features
  • Firebase Messaging - Cloud messaging service

UI & UX

  • Flutter ScreenUtil - Responsive design utility
  • Flutter Material Design 3 - Material design components
  • Go Router - Advanced routing and navigation

Authentication & Payment

  • Google Sign-In - Google OAuth integration
  • Flutter Facebook Auth - Facebook OAuth integration
  • Flutter Stripe - Payment processing

Data & Storage

  • Shared Preferences - Local key-value storage
  • Cookie Jar - Cookie management
  • Image Picker - Device image selection
  • File Picker - File selection utility

Media

  • Audio Players - Audio playback engine
  • WebView Flutter - Web content display

Development Tools

  • Mockito - Mocking framework for testing
  • Build Runner - Code generation tool
  • Integration Tests - End-to-end testing

πŸ“ Project Structure

Cross/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ app.dart                 # Main app widget
β”‚   β”‚   └── router.dart              # GoRouter configuration
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ realtime/
β”‚   β”‚   β”‚   └── app_socket_service.dart
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   └── extensions/
β”‚   β”œβ”€β”€ di/                          # Dependency Injection
β”‚   β”‚   β”œβ”€β”€ auth_injection.dart
β”‚   β”‚   β”œβ”€β”€ player_injection.dart
β”‚   β”‚   β”œβ”€β”€ profile_injection.dart
β”‚   β”‚   β”œβ”€β”€ premium_injection.dart
β”‚   β”‚   β”œβ”€β”€ messaging_injection.dart
β”‚   β”‚   β”œβ”€β”€ notifications_injection.dart
β”‚   β”‚   └── engagement_injection.dart
β”‚   β”œβ”€β”€ features/                    # Feature modules
β”‚   β”‚   β”œβ”€β”€ auth/                    # Authentication
β”‚   β”‚   β”œβ”€β”€ home/                    # Home screen
β”‚   β”‚   β”œβ”€β”€ feed/                    # Music feed & discovery
β”‚   β”‚   β”œβ”€β”€ player/                  # Music player
β”‚   β”‚   β”œβ”€β”€ profile/                 # User profiles
β”‚   β”‚   β”œβ”€β”€ messaging/               # Real-time messaging
β”‚   β”‚   β”œβ”€β”€ notifications/           # Push notifications
β”‚   β”‚   β”œβ”€β”€ premium_subscription/    # Premium features
β”‚   β”‚   β”œβ”€β”€ search/                  # Search functionality
β”‚   β”‚   β”œβ”€β”€ social/                  # Social interactions
β”‚   β”‚   β”œβ”€β”€ playlist/                # Playlist management
β”‚   β”‚   β”œβ”€β”€ discovery/               # Music discovery
β”‚   β”‚   └── engagement/              # User engagement & analytics
β”‚   └── main.dart                    # App entry point
β”œβ”€β”€ android/                         # Android native code
β”œβ”€β”€ ios/                             # iOS native code
β”œβ”€β”€ web/                             # Web build files
β”œβ”€β”€ linux/                           # Linux build files
β”œβ”€β”€ macos/                           # macOS build files
β”œβ”€β”€ windows/                         # Windows build files
β”œβ”€β”€ test/                            # Unit & widget tests
β”œβ”€β”€ integration_test/                # Integration tests
β”œβ”€β”€ assets/                          # App assets & images
β”œβ”€β”€ pubspec.yaml                     # Dependencies & config
└── README.md                        # This file

πŸ—οΈ Architecture

Clean Architecture Pattern

This project follows Clean Architecture with three main layers:

1. Presentation Layer

features/<feature>/presentation/
β”œβ”€β”€ pages/          # Full-screen widgets
β”œβ”€β”€ widgets/        # Reusable UI components
β”œβ”€β”€ cubit/          # Business logic (State management)
└── bloc/           # Complex state patterns

Responsibilities:

  • UI rendering with Flutter widgets
  • User interaction handling
  • State management with BLoC/Cubit

2. Domain Layer

features/<feature>/domain/
β”œβ”€β”€ entities/       # Business objects (independent of framework)
β”œβ”€β”€ repositories/   # Abstract repository contracts
└── usecases/       # Business logic rules

Responsibilities:

  • Define business entities
  • Define abstract repository interfaces
  • Implement use case business logic
  • Independent of any framework

3. Data Layer

features/<feature>/data/
β”œβ”€β”€ models/         # Data models (API/DB)
β”œβ”€β”€ data_sources/   # Remote & local data access
β”œβ”€β”€ repositories/   # Concrete repository implementations
└── mappers/        # Model ↔ Entity conversion

Responsibilities:

  • API communication
  • Local database operations
  • Model-to-entity mapping
  • Data caching strategies

Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           PRESENTATION LAYER (UI)                   β”‚
β”‚  Pages β†’ Widgets β†’ Cubits/BLoCs                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ depends on
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            DOMAIN LAYER (Business)                  β”‚
β”‚  Entities β†’ Repositories (Abstract) β†’ UseCases      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ implements
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            DATA LAYER (Storage)                     β”‚
β”‚  RemoteDataSource β†’ Repository (Impl) β†’ LocalCache  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Architectural Decisions

Decision Rationale
Clean Architecture Maintainability, testability, and scalability
BLoC Pattern Separation of UI and business logic
Repository Pattern Abstraction of data sources
Dependency Injection Loose coupling, easier testing
Socket.IO Real-time messaging and notifications
Feature-based Structure Scalable module organization

πŸ“¦ Module Breakdown

πŸ” Auth Module

Handles user authentication and session management.

Key Components:

  • LoginPage / SignupPage - Authentication UI
  • AuthCubit - Authentication state management
  • AuthRepository - Auth data operations
  • OAuth integration (Google, Facebook)

Capabilities:

  • User registration and login
  • Social authentication
  • Session persistence
  • Token management

🏠 Home Module

Main entry point after authentication.

Key Components:

  • HomePage - Home screen UI
  • Logout functionality
  • Navigation hub

🎡 Feed Module

Music discovery and recommendation engine.

Key Components:

  • HomeState / HomeCubit - Feed management
  • DiscoverCubit - Discovery recommendations
  • FeedCubit - Activity feed
  • TrendingGenreEntity - Genre data
  • StationModel - Radio station data

Features:

  • Curated playlists
  • Trending genres
  • Artists to watch
  • Personalized recommendations
  • More of what you like
  • Station radio

🎢 Player Module

Audio playback and player controls.

Key Components:

  • PlayerCubit - Playback state
  • CommentsState - Track comments
  • Audio player engine
  • Queue management

Features:

  • Play/pause/skip controls
  • Queue management
  • Comments on tracks
  • Like/unlike tracks
  • Shuffle and repeat modes

πŸ’¬ Messaging Module

Real-time chat and messaging system.

Key Components:

  • InboxCubit - Chat list management
  • ChatCubit - Individual chat state
  • UnreadMessagesCubit - Unread count tracking
  • MessagingSocketDataSource - Socket.IO communication
  • MessagingRepository - Data operations

Features:

  • Real-time messaging with Socket.IO
  • Read receipts
  • Typing indicators
  • Message history
  • Chat archiving
  • Unread count tracking
  • Track/playlist sharing in chat

Socket Events Supported:

  • chat:update - Chat updates
  • message:new - New messages
  • message:read - Read receipts
  • typing - Typing indicators

πŸ”” Notifications Module

Push notifications and notification center.

Key Components:

  • UnreadNotificationsCubit - Notification state
  • Firebase Cloud Messaging integration
  • Socket-based notification updates

Features:

  • Real-time notifications
  • Unread notification badges
  • Notification persistence
  • Firebase integration

πŸ‘€ Profile Module

User profile management and social features.

Key Components:

  • ProfileCubit - Profile state management
  • User profile display
  • Profile editing
  • Follow/unfollow system

πŸ’Ž Premium Subscription Module

Premium features and payment integration.

Key Components:

  • PremiumCubit - Premium state management
  • Stripe payment processing
  • Subscription management

Features:

  • Premium feature access
  • Subscription management
  • Payment processing via Stripe

πŸ“Š Engagement Module

User engagement tracking, analytics, and interaction metrics.

Key Components:

  • EngagementCubit - Engagement state management
  • EngagementRepository - Data operations
  • EngagementSocketDataSource - Real-time engagement data via Socket.IO
  • UserInteractionEntity - User interaction data model

Features:

  • Track user interactions (likes, comments, shares)
  • Real-time engagement metrics
  • User activity logging
  • Engagement analytics dashboard
  • Reward and achievement system
  • Streak tracking
  • User engagement notifications
  • Leaderboards

Tracked Metrics:

  • Track plays and skips
  • Like/unlike interactions
  • Comment engagement
  • Share activity
  • Follow/unfollow actions
  • Playlist creation and curation

πŸ” Additional Modules

  • Search - Advanced search functionality
  • Social - Social interactions (follow, like, etc.)
  • Playlist - Playlist management and curation
  • Discovery - Music discovery features

πŸš€ Getting Started

Prerequisites

  • Flutter 3.11.0 or higher
  • Dart 3.11.0 or higher
  • Android SDK (for Android development)
  • Xcode (for iOS development)
  • VS Code or Android Studio

Installation

  1. Clone the repository

    git clone https://github.com/Team-6-CUFE/Cross.git
    cd Cross
  2. Install dependencies

    flutter pub get
  3. Generate code (if needed)

    flutter pub run build_runner build --delete-conflicting-outputs
  4. Run the app

    flutter run

Configuration

Before running, ensure you have configured:

  • Firebase - Add google-services.json (Android) and GoogleService-Info.plist (iOS)
  • Stripe API Keys - Configure in the app for payment processing
  • Socket.IO Server - Update server URL in config
  • OAuth Credentials - Google and Facebook app credentials

Running Tests

# Unit tests
flutter test

# Integration tests
flutter test integration_test/

# Coverage
flutter test --coverage

πŸ’» Development

Code Style & Conventions

  • Follow Dart Style Guide
  • Use flutter analyze to check code quality
  • Run flutter format before committing

Adding a New Feature

  1. Create feature directory in lib/features/<feature_name>/
  2. Create subdirectories: presentation/, domain/, data/
  3. Define entities and repository contracts in domain layer
  4. Implement data layer with models and data sources
  5. Create Cubits/BLoCs in presentation layer
  6. Add pages and widgets
  7. Register in dependency injection
  8. Update router if needed

Git Workflow

# Create feature branch
git checkout -b feature/feature-name

# Commit with descriptive messages
git commit -m "feat: add new feature"

# Push and create pull request
git push origin feature/feature-name

Debugging

# Enable debug mode
flutter run -d chrome --web-hostname localhost

# Check logs
flutter logs

# Profile performance
flutter run --profile

πŸ§ͺ Testing

Unit Testing

Tests for business logic, repositories, and use cases.

flutter test test/

Widget Testing

Tests for individual UI components.

Integration Testing

End-to-end tests for complete user flows.

flutter test integration_test/

πŸ“Š Module Distribution

Dart (91.9%) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
HTML (6.0%)  β–ˆβ–ˆ
C++ (1.1%)   
CMake (0.8%)  
Swift (0.1%)  
C (0.1%)     

πŸ“ File Organization

Core Structure

Cross/
β”œβ”€β”€ Features (Modular)
β”‚   └── Each feature is self-contained with domain/data/presentation
β”œβ”€β”€ DI (Dependency Injection)
β”‚   └── Centralized service registration
β”œβ”€β”€ Core (Shared)
β”‚   β”œβ”€β”€ Real-time Socket Service
β”‚   β”œβ”€β”€ Utilities & Extensions
β”‚   └── Constants
└── Platform (Native)
    β”œβ”€β”€ Android
    β”œβ”€β”€ iOS
    β”œβ”€β”€ Web
    β”œβ”€β”€ Windows
    β”œβ”€β”€ macOS
    └── Linux

πŸ”‘ Key Files Reference

File Purpose
lib/main.dart Application entry point
lib/app/app.dart App configuration & providers
lib/app/router.dart Navigation routes
pubspec.yaml Dependencies & version info
lib/di/*_injection.dart Dependency injection setup
lib/features/*/ Feature modules

πŸ“š Learning Resources


🀝 Contributing

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

Contribution Guidelines

  • Write clean, well-documented code
  • Follow the project's architecture patterns
  • Add tests for new features
  • Update documentation as needed
  • Keep commits atomic and descriptive

πŸ“„ License

This project is part of the Cairo University Faculty of Engineering curriculum.


πŸ‘₯ Team

Team-6-CUFE - Music & Social Platform Development Team


πŸ“ž Support & Contact

For questions or issues:

  • Open an issue on GitHub
  • Contact the development team
  • Check existing documentation

πŸŽ‰ Acknowledgments

  • Flutter team for the amazing framework
  • Firebase for backend services
  • All contributors and team members
  • CUFE for the educational opportunity

Happy Coding! πŸš€

Last Updated: May 2026

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages