A full-featured music streaming application built with Flutter and Firebase, implementing modern clean architecture principles and state management patterns.
-
π Authentication System
- Email/Password authentication via Firebase Auth
- Secure user session management
- Sign up, Sign in, and Sign out functionality
-
πΌ Music Player
- Background audio playback with
just_audio&just_audio_background - Play, pause, skip, and seek controls
- Persistent playback state
- Lock screen & notification controls
- Background audio playback with
-
π Music Library Management
- Browse songs by multiple criteria:
- Release Date
- Artist
- Genres
- Activity Type
- Search functionality (by title and artist)
- Personal music collection
- Browse songs by multiple criteria:
-
β€οΈ Favorites System
- Add/remove songs to favorites
- Dedicated liked songs playlist
- Real-time favorite status sync
-
ποΈ Smart Organization
- Dynamic playlists based on filters
- Artist-specific collections
- Genre-based browsing
- Activity-based recommendations
This project follows Clean Architecture principles with clear separation of concerns:
lib/
βββ core/ # Core utilities and configs
βββ data/
β βββ models/ # Data models
β βββ sources/ # Firebase services
β βββ repositories/ # Repository implementations
βββ domain/
β βββ entities/ # Business entities
β βββ repositories/ # Repository interfaces
β βββ usecases/ # Business logic
βββ presentation/
β βββ bloc/ # BLoC state management
β βββ pages/ # UI screens
β βββ widgets/ # Reusable widgets
βββ service_locator.dart # Dependency injection
- BLoC Pattern for state management
- Repository Pattern for data abstraction
- Dependency Injection with GetIt
- Clean routing with GoRouter
| Technology | Purpose |
|---|---|
| Flutter | Cross-platform UI framework |
| Firebase Auth | User authentication |
| Cloud Firestore | NoSQL database for songs & user data |
| Firebase Storage | Media file storage |
| BLoC | State management |
| GetIt | Dependency injection |
| GoRouter | Declarative routing & navigation |
| just_audio | Audio playback engine |
| just_audio_background | Background playback support |
| Dartz | Functional programming (Either type) |
| HydratedBloc | State persistence |
spotify_clone/
βββ android/
βββ ios/
βββ lib/
β βββ core/
β β βββ configs/
β β βββ utils/
β βββ data/
β β βββ models/
β β β βββ song/
β β βββ sources/
β β β βββ auth/
β β β βββ song/
β β βββ repositories/
β βββ domain/
β β βββ entities/
β β βββ repositories/
β β βββ usecases/
β β βββ auth/
β β βββ song/
β βββ presentation/
β β βββ bloc/
β β βββ pages/
β β β βββ auth/
β β β βββ home/
β β β βββ search/
β β β βββ library/
β β β βββ profile/
β β β βββ song_playlist/
β β βββ widgets/
β βββ routes/
β β βββ routes.dart
β β βββ routes_name.dart
β βββ service_locator.dart
β βββ main.dart
βββ assets/
β βββ overview/
βββ .env
βββ pubspec.yaml
- Flutter SDK (3.0 or higher)
- Dart SDK
- Firebase account
- Android Studio / VS Code
- iOS development tools (for iOS deployment)
-
Clone the repository
git clone https://github.com/rosyiddd666999/spotify-clone-fullstack.git cd spotify-clone-fullstack -
Install dependencies
flutter pub get
-
Firebase Setup
- Create a new Firebase project at Firebase Console
- Enable Authentication (Email/Password)
- Create a Firestore Database
- Set up Firebase Storage
- Download and add configuration files:
google-services.jsonfor Android (android/app/)GoogleService-Info.plistfor iOS (ios/Runner/)
-
Configure FlutterFire
flutterfire configure
-
Environment Variables
Create a
.envfile in the root directory:# Add your environment variables here if needed -
Run the app
flutter run
Firestore Database
βββ Users/
β βββ {userId}/
β βββ FavoritesSongs/
β βββ {favoriteId}
β βββ songId: string
β βββ addedDate: timestamp
β
βββ Songs/
βββ {songId}
βββ title: string
βββ artist: string
βββ duration: string
βββ releaseDate: timestamp
βββ genres: array
βββ activityType: array
βββ songUrl: string
βββ coverUrl: string
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /Users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
match /FavoritesSongs/{favoriteId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
match /Songs/{songId} {
allow read: if request.auth != null;
allow write: if false; // Only admins should write
}
}
}UI Layer (Presentation)
β
BLoC (State Management)
β
Use Cases (Business Logic)
β
Repository Interface (Domain)
β
Repository Implementation (Data)
β
Data Sources (Firebase)
The app uses BLoC pattern for predictable state management:
- Separation of UI and business logic
- Reactive programming with streams
- Easy testing and maintenance
Clean, type-safe navigation with:
- Nested navigation for bottom navigation bar
- Deep linking support
- Redirect logic for authentication
- Named routes for maintainability
| Home | Search | Library | Profile |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- 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
This project is open source and available under the MIT License.
Abdul Rosyid
- Email: rosidabdul66@gmail.com
- GitHub: @rosyiddd666999
- Flutter team for the amazing framework
- Firebase for backend infrastructure
- just_audio package contributors
- The open-source community
If you encounter any issues or have questions, please:
- Open an issue on GitHub
- Contact via email: rosidabdul66@gmail.com
If you find this project helpful, please give it a β on GitHub!
Β© 2024 Abdul Rosyid. All rights reserved.




