Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

18 Commits

Folders and files

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

Repository files navigation

🎡 Spotify Clone - Fullstack Music Streaming App

A full-featured music streaming application built with Flutter and Firebase, implementing modern clean architecture principles and state management patterns.


✨ Features

  • πŸ” 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
  • πŸ“š Music Library Management

    • Browse songs by multiple criteria:
      • Release Date
      • Artist
      • Genres
      • Activity Type
    • Search functionality (by title and artist)
    • Personal music collection
  • ❀️ 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

🎨 Result

Overview Result

App Overview


πŸ—οΈ Architecture

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

Key Architectural Patterns:

  • BLoC Pattern for state management
  • Repository Pattern for data abstraction
  • Dependency Injection with GetIt
  • Clean routing with GoRouter

πŸ› οΈ Tech Stack

Flutter Firebase Dart

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

πŸ“¦ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • Flutter SDK (3.0 or higher)
  • Dart SDK
  • Firebase account
  • Android Studio / VS Code
  • iOS development tools (for iOS deployment)

Installation

  1. Clone the repository

    git clone https://github.com/rosyiddd666999/spotify-clone-fullstack.git
    cd spotify-clone-fullstack
  2. Install dependencies

    flutter pub get
  3. 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.json for Android (android/app/)
      • GoogleService-Info.plist for iOS (ios/Runner/)
  4. Configure FlutterFire

    flutterfire configure
  5. Environment Variables

    Create a .env file in the root directory:

    # Add your environment variables here if needed
  6. Run the app

    flutter run

πŸ”₯ Firebase Configuration

Firestore Structure

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

Security Rules Example

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
    }
  }
}

🎯 Key Features Implementation

Clean Architecture Flow

UI Layer (Presentation)
    ↓
BLoC (State Management)
    ↓
Use Cases (Business Logic)
    ↓
Repository Interface (Domain)
    ↓
Repository Implementation (Data)
    ↓
Data Sources (Firebase)

State Management with BLoC

The app uses BLoC pattern for predictable state management:

  • Separation of UI and business logic
  • Reactive programming with streams
  • Easy testing and maintenance

Routing with GoRouter

Clean, type-safe navigation with:

  • Nested navigation for bottom navigation bar
  • Deep linking support
  • Redirect logic for authentication
  • Named routes for maintainability

πŸ“± Preview

Main Features

Home Search Library Profile
Home Search Play Song Library

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  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

πŸ“ License

This project is open source and available under the MIT License.


πŸ‘¨β€πŸ’» Developer

Abdul Rosyid


πŸ™ Acknowledgments

  • Flutter team for the amazing framework
  • Firebase for backend infrastructure
  • just_audio package contributors
  • The open-source community

πŸ“ž Support

If you encounter any issues or have questions, please:


🌟 Show Your Support

If you find this project helpful, please give it a ⭐ on GitHub!


Β© 2024 Abdul Rosyid. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages