A Spotify clone built with Flutter, leveraging PocketBase as the backend. This app allows users to explore, manage, and play songs with seamless state management, persistent session storage, and theme mode switching.
- 🎧 Music Streaming powered by
just_audio. - 🔄 State Management using
flutter_blocfor reactive UI updates. - 🌗 Light/Dark Mode persistence with
hydrated_bloc. - 🔐 Local Storage using
Hiveto save user session and data. - 🖥️ Backend powered by PocketBase (local server).
Before starting, make sure you have the following installed:
- Flutter SDK (version 3.26.0 or above)
- PocketBase (local backend server)
- Git
-
Clone the repository:
git clone https://github.com/yourusername/spotify-clone.git cd spotify-clone -
Install Flutter dependencies:
flutter pub get
-
Set up PocketBase:
-
Download and install PocketBase.
-
Start the PocketBase server on your local machine:
./pocketbase serve
-
Import the PocketBase schema:
In the PocketBase admin dashboard (accessible via
http://localhost:8090/_/), import the schema from thespotiffy_clone_schema.jsonfile included in this repository:- Go to Settings > Import Collections.
- Upload the
spotiffy_clone_schema.jsonfile.
-
-
Add sample songs to PocketBase:
- After importing the schema, go to the Songs collection in the admin dashboard.
- Add a few random songs with the necessary fields (title, artist, album, etc.).
-
Create a
.envfile:In the root of the project, create a
.envfile if it doesn't already exist. -
Add the following variables to the
.envfile:LOCAL_HOST=your_local_host_without_quotes SONG_COLLECTION_ID=your_song_collection_id_without_quotes
- Replace
your_local_host_without_quoteswith your PocketBase server's base URL (e.g.,http://localhost:8090). - Replace
your_song_collection_id_without_quoteswith the collection ID of the "Songs" collection in your PocketBase admin dashboard.
- Replace
-
Ensure
.envis excluded from version control:The
.envfile should already be ignored by.gitignore, but double-check to ensure sensitive information is not committed. -
Load the
.envfile in the app:The app is pre-configured to use the
flutter_dotenvpackage. The variables from the.envfile will be automatically loaded when the app starts.
-
Run the Flutter app on your device:
flutter run
Ensure your PocketBase server is running and accessible at the URL specified in the
.envfile.
Contributions, issues, and feature requests are welcome! Feel free to check out the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
