- Overview
- Features
- Screenshots
- Architecture
- Tech Stack
- Getting Started
- API Documentation
- Project Structure
- Usage
- Contributing
- License
- Contact
Beatsphere is a full-stack music streaming application that provides users with a seamless music listening experience. Built with Flutter for the mobile client and FastAPI for the backend, it offers features like music upload, playlist management, favorites, and high-quality audio playback with visual waveforms.
The application follows modern software architecture principles with clean separation of concerns, state management using Riverpod, and a RESTful API design.
- Music Streaming: High-quality audio playback with background support
- Audio Visualization: Real-time waveform display during playback
- Music Controls: Play, pause, skip, shuffle, and repeat functionality
- Background Playback: Continue listening while using other apps
- User Authentication: Secure signup and login system
- Personal Library: Organize and manage your music collection
- Favorites System: Mark and access your favorite songs easily
- Music Upload: Upload your own music files to the platform
- Responsive UI: Beautiful Material Design interface
- Offline Storage: Local caching using Hive database
- Cloud Storage: Media files stored securely on Cloudinary
- JWT Authentication: Secure token-based authentication
- Cross-Platform: Runs on Android and iOS devices
Experience the beautiful and intuitive interface of Beatsphere
Beatsphere follows a client-server architecture with clear separation of concerns:
βββββββββββββββββββ HTTP/REST API βββββββββββββββββββ
β βββββββββββββββββββββΊβ β
β Flutter Client β β FastAPI Server β
β β β β
βββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Local Storage β β Database β
β (Hive + SharedPrefs) β β (SQLAlchemy) β
βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Cloudinary β
β (Media Storage) β
βββββββββββββββββββ
- Presentation Layer: UI components and pages
- Business Logic: ViewModels using Riverpod
- Data Layer: Repositories for API and local storage
- Models: Data models and DTOs
- API Layer: FastAPI routes and endpoints
- Business Logic: Service layer (implicit)
- Data Layer: SQLAlchemy models and database operations
- External Services: Cloudinary integration
| Technology | Purpose | Version |
|---|---|---|
| Flutter | Mobile app framework | 3.8.1 |
| Dart | Programming language | Latest |
| Riverpod | State management | 2.6.1 |
| just_audio | Audio playback | 0.10.4 |
| audio_waveforms | Audio visualization | 1.3.0 |
| Hive | Local database | 2.2.3 |
| http | HTTP client | 1.4.0 |
| Technology | Purpose |
|---|---|
| FastAPI | Web framework |
| SQLAlchemy | ORM |
| Pydantic | Data validation |
| JWT | Authentication |
| bcrypt | Password hashing |
| Cloudinary | Media storage |
| python-dotenv | Environment management |
- SQLAlchemy: Relational database ORM
- Cloudinary: Cloud media storage
- Hive: Local mobile storage
Before you begin, ensure you have the following installed:
- Flutter SDK (3.8.1 or higher)
- Python (3.8 or higher)
- Git
- Android Studio or VS Code with Flutter extensions
- Android SDK (for Android development)
- Xcode (for iOS development, macOS only)
-
Clone the repository
git clone https://github.com/yourusername/beatsphere.git cd beatsphere -
Set up the Flutter client
cd client flutter pub get flutter pub run build_runner build -
Set up the FastAPI server
cd ../server pip install -r requirements.txt
-
Create environment file
cd server cp .env.example .env -
Configure environment variables in
.envDATABASE_URL=sqlite:///./beatsphere.db JWT_SECRET_KEY=your-secret-key-here CLOUD_NAME=your-cloudinary-cloud-name API_KEY=your-cloudinary-api-key API_SECRET=your-cloudinary-api-secret
- Update server URL in
client/lib/core/constants/server_constants.dartclass ServerConstants { static const String serverURL = "http://your-server-url:8000"; }
-
Start the FastAPI server
cd server uvicorn main:app --reload --host 0.0.0.0 --port 8000 -
Run the Flutter app
cd client flutter run
The server will be available at http://localhost:8000 and the API documentation at http://localhost:8000/docs.
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/signup |
Register a new user |
| POST | /auth/login |
User login |
| GET | /auth/ |
Get current user data |
| Method | Endpoint | Description |
|---|---|---|
| POST | /song/upload |
Upload a new song |
| GET | /song/list |
Get all songs |
| POST | /song/favourite |
Toggle song favorite |
| GET | /song/list/favourites |
Get user's favorite songs |
User Registration:
curl -X POST "http://localhost:8000/auth/signup" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"password": "securepassword"
}'Upload Song:
curl -X POST "http://localhost:8000/song/upload" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-F "song=@path/to/song.mp3" \
-F "thumbnail=@path/to/thumbnail.jpg" \
-F "artist=Artist Name" \
-F "song_name=Song Title" \
-F "hex_code=FF5733"For complete API documentation, visit http://localhost:8000/docs when the server is running.
beatsphere/
βββ client/ # Flutter mobile application
β βββ lib/
β β βββ core/ # Core utilities and shared code
β β β βββ constants/ # App constants
β β β βββ failure/ # Error handling
β β β βββ models/ # Core data models
β β β βββ provider/ # Global state providers
β β β βββ theme/ # App theming
β β β βββ widgets/ # Reusable widgets
β β βββ features/ # Feature-based modules
β β β βββ auth/ # Authentication feature
β β β β βββ model/ # Auth models
β β β β βββ repositories/ # Data repositories
β β β β βββ view/ # UI components
β β β β βββ viewmodel/ # Business logic
β β β βββ home/ # Home/Music feature
β β β βββ models/ # Music models
β β β βββ repository/ # Music repositories
β β β βββ view/ # Music UI components
β β β βββ viewmodel/ # Music business logic
β β βββ main.dart # App entry point
β βββ assets/ # Static assets
β β βββ images/ # Image assets
β βββ android/ # Android-specific code
β βββ ios/ # iOS-specific code
β βββ pubspec.yaml # Flutter dependencies
βββ server/ # FastAPI backend server
β βββ models/ # SQLAlchemy database models
β β βββ base.py # Base model class
β β βββ user.py # User model
β β βββ song.py # Song model
β β βββ favourites.py # Favorites model
β βββ routes/ # API route handlers
β β βββ auth.py # Authentication routes
β β βββ song.py # Song management routes
β βββ pydantic_schemas/ # Request/response schemas
β β βββ user_create.py # User creation schema
β β βββ user_login.py # User login schema
β β βββ favourite_song.py # Favorite song schema
β βββ middleware/ # Custom middleware
β β βββ auth_middleware.py # JWT authentication middleware
β βββ database.py # Database configuration
β βββ main.py # FastAPI app entry point
βββ README.md # Project documentation
- Sign Up: Create a new account with your email and password
- Browse Music: Explore the available songs in the library
- Play Music: Tap on any song to start playback
- Manage Favorites: Heart songs to add them to your favorites
- Upload Music: Share your own music by uploading audio files
- Control Playback: Use the music player controls for full playback control
- Client-side: Create new features in the
client/lib/features/directory - Server-side: Add new routes in the
server/routes/directory - Database: Define new models in the
server/models/directory
The app uses Riverpod for state management. Key providers:
currentUserNotifierProvider- Current user statecurrentSongNotifierProvider- Current playing songauthViewModelProvider- Authentication logic
HTTP requests are handled through repository classes:
AuthRemoteRepository- Authentication API calls- Music repository classes for song-related API calls
We welcome contributions to Beatsphere! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Add tests (if applicable)
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Flutter and Dart style guidelines
- Use meaningful commit messages
- Add documentation for new features
- Ensure all tests pass
- Update the README if needed
- Flutter: Follow the official Dart style guide
- Python: Follow PEP 8 style guidelines
- Use meaningful variable and function names
- Add comments for complex logic
This project is licensed under the MIT License - see the LICENSE file for details.
Project Maintainer: Nitin Dave
- Email: nitindave2111@gmail.com
- GitHub: @nitindavegit
- LinkedIn: (https://linkedin.com/in/nitindave/)
Project Link: (https://github.com/nitindavegit/beatsphere)
Made with β€οΈ by the Beatsphere team
β Star this repo if you found it helpful!





