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.
- Overview
- Features
- Tech Stack
- Project Structure
- Architecture
- Getting Started
- Module Breakdown
- Development
- Contributing
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
- 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
- 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
- Flutter (Dart 3.11+) - Cross-platform UI framework
- Dart (91.9% of codebase) - Primary language
- Flutter BLoC - Business Logic Component pattern
- GetIt - Service locator for dependency injection
- Injectable - Code generation for DI
- Dio - HTTP client with interceptors
- Socket.IO Client - WebSocket communication for real-time features
- Firebase Messaging - Cloud messaging service
- Flutter ScreenUtil - Responsive design utility
- Flutter Material Design 3 - Material design components
- Go Router - Advanced routing and navigation
- Google Sign-In - Google OAuth integration
- Flutter Facebook Auth - Facebook OAuth integration
- Flutter Stripe - Payment processing
- Shared Preferences - Local key-value storage
- Cookie Jar - Cookie management
- Image Picker - Device image selection
- File Picker - File selection utility
- Audio Players - Audio playback engine
- WebView Flutter - Web content display
- Mockito - Mocking framework for testing
- Build Runner - Code generation tool
- Integration Tests - End-to-end testing
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
This project follows Clean Architecture with three main layers:
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
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
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
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PRESENTATION LAYER (UI) β
β Pages β Widgets β Cubits/BLoCs β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β depends on
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β DOMAIN LAYER (Business) β
β Entities β Repositories (Abstract) β UseCases β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β implements
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β DATA LAYER (Storage) β
β RemoteDataSource β Repository (Impl) β LocalCache β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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 |
Handles user authentication and session management.
Key Components:
LoginPage/SignupPage- Authentication UIAuthCubit- Authentication state managementAuthRepository- Auth data operations- OAuth integration (Google, Facebook)
Capabilities:
- User registration and login
- Social authentication
- Session persistence
- Token management
Main entry point after authentication.
Key Components:
HomePage- Home screen UI- Logout functionality
- Navigation hub
Music discovery and recommendation engine.
Key Components:
HomeState/HomeCubit- Feed managementDiscoverCubit- Discovery recommendationsFeedCubit- Activity feedTrendingGenreEntity- Genre dataStationModel- Radio station data
Features:
- Curated playlists
- Trending genres
- Artists to watch
- Personalized recommendations
- More of what you like
- Station radio
Audio playback and player controls.
Key Components:
PlayerCubit- Playback stateCommentsState- Track comments- Audio player engine
- Queue management
Features:
- Play/pause/skip controls
- Queue management
- Comments on tracks
- Like/unlike tracks
- Shuffle and repeat modes
Real-time chat and messaging system.
Key Components:
InboxCubit- Chat list managementChatCubit- Individual chat stateUnreadMessagesCubit- Unread count trackingMessagingSocketDataSource- Socket.IO communicationMessagingRepository- 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 updatesmessage:new- New messagesmessage:read- Read receiptstyping- Typing indicators
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
User profile management and social features.
Key Components:
ProfileCubit- Profile state management- User profile display
- Profile editing
- Follow/unfollow system
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
User engagement tracking, analytics, and interaction metrics.
Key Components:
EngagementCubit- Engagement state managementEngagementRepository- Data operationsEngagementSocketDataSource- Real-time engagement data via Socket.IOUserInteractionEntity- 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
- Search - Advanced search functionality
- Social - Social interactions (follow, like, etc.)
- Playlist - Playlist management and curation
- Discovery - Music discovery features
- 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
-
Clone the repository
git clone https://github.com/Team-6-CUFE/Cross.git cd Cross -
Install dependencies
flutter pub get
-
Generate code (if needed)
flutter pub run build_runner build --delete-conflicting-outputs
-
Run the app
flutter run
Before running, ensure you have configured:
- Firebase - Add
google-services.json(Android) andGoogleService-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
# Unit tests
flutter test
# Integration tests
flutter test integration_test/
# Coverage
flutter test --coverage- Follow Dart Style Guide
- Use
flutter analyzeto check code quality - Run
flutter formatbefore committing
- Create feature directory in
lib/features/<feature_name>/ - Create subdirectories:
presentation/,domain/,data/ - Define entities and repository contracts in domain layer
- Implement data layer with models and data sources
- Create Cubits/BLoCs in presentation layer
- Add pages and widgets
- Register in dependency injection
- Update router if needed
# 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# Enable debug mode
flutter run -d chrome --web-hostname localhost
# Check logs
flutter logs
# Profile performance
flutter run --profileTests for business logic, repositories, and use cases.
flutter test test/Tests for individual UI components.
End-to-end tests for complete user flows.
flutter test integration_test/Dart (91.9%) ββββββββββββββββββββββββββββββββββββββββββββ
HTML (6.0%) ββ
C++ (1.1%)
CMake (0.8%)
Swift (0.1%)
C (0.1%)
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
| 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 |
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- 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
This project is part of the Cairo University Faculty of Engineering curriculum.
Team-6-CUFE - Music & Social Platform Development Team
For questions or issues:
- Open an issue on GitHub
- Contact the development team
- Check existing documentation
- 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