A modern web-based music player application built with FastAPI backend and vanilla HTML/CSS/JavaScript frontend, containerized with Docker.
- Music Library Management: Upload, organize, and manage your music collection
- Audio Player: Full-featured music player with play/pause, skip, progress control, and volume adjustment
- User System: User registration, authentication, and personalized favorites
- Search & Browse: Search through songs, artists, and albums
- Recently Played: Track and display recently listened songs
- Favorites System: Save and manage favorite songs
- Responsive Design: Modern, mobile-friendly interface
- File Upload: Support for various audio formats with metadata extraction
- Framework: FastAPI with Python 3.x
- Database: SQLite with SQLAlchemy ORM
- File Handling: Audio file upload and metadata extraction using Mutagen
- API Documentation: Auto-generated OpenAPI/Swagger docs
- CORS: Configured for cross-origin requests
- HTML5: Semantic markup with modern structure
- CSS3: Responsive design with custom styling
- JavaScript: Vanilla JS for dynamic functionality
- Nginx: Static file serving and reverse proxy
- Docker: Containerized services for easy deployment
- Docker Compose: Multi-container orchestration
- Networking: Isolated network for service communication
ise-music-app/
βββ backend/ # FastAPI backend
β βββ main.py # FastAPI application entry point
β βββ models.py # SQLAlchemy database models
β βββ schemas.py # Pydantic schemas for API
β βββ database.py # Database configuration
β βββ requirements.txt # Python dependencies
β βββ routers/ # API route handlers
β βββ services/ # Business logic services
β βββ uploads/ # Uploaded audio files
β βββ songs.db # SQLite database
βββ frontend/ # Web frontend
β βββ index.html # Main application page
β βββ login.html # User authentication page
β βββ upload.html # File upload page
β βββ js/ # JavaScript modules
β βββ style/ # CSS stylesheets
β βββ assets/ # Static assets (images, icons)
βββ docker/ # Docker configuration files
βββ docker-compose.yml # Multi-container setup
βββ README.md # This file
- Docker and Docker Compose installed
- Git (for cloning the repository)
-
Clone the repository
git clone <repository-url> cd ise-music-app
-
Start the application
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
If you prefer to run the services separately for development:
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd frontend
# Serve with any static file server, e.g.:
python -m http.server 3000
# or
npx serve -s . -l 3000The application uses the following environment variables:
PYTHONPATH: Set to/appfor proper module imports- Database: SQLite file (
songs.db) - automatically created - Upload directory:
uploads/- created automatically
- Backend Port: 8000
- Frontend Port: 3000 (mapped to Nginx port 80)
- Volumes: Persistent storage for uploads and database
- Network: Isolated
music-app-network
The FastAPI backend provides comprehensive API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
GET /- API informationGET /health- Health checkPOST /api/v1/songs/upload- Upload audio filesGET /api/v1/songs/- List all songsGET /api/v1/songs/{id}- Get song detailsPOST /api/v1/users/- Create user accountPOST /api/v1/favorites/- Add song to favoritesGET /api/v1/favorites/{user_id}- Get user's favorites
The application supports various audio formats through the Mutagen library:
- MP3
- FLAC
- OGG
- WAV
- M4A
- And more...
- FastAPI 0.104.1 - Modern Python web framework
- SQLAlchemy 2.0.23 - Python SQL toolkit and ORM
- Uvicorn 0.24.0 - ASGI server
- Mutagen 1.47.0 - Audio metadata extraction
- Python-multipart 0.0.6 - File upload handling
- HTML5 - Semantic markup
- CSS3 - Styling and responsive design
- Vanilla JavaScript - Client-side functionality
- Nginx - Web server and reverse proxy
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- SQLite - Lightweight database
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is part of an iSE (Information Systems Engineering) final test project.
- Port conflicts: Ensure ports 3000 and 8000 are available
- Permission issues: Check Docker permissions and file ownership
- Database errors: Delete
songs.dbto reset the database - Upload failures: Ensure the
uploads/directory has write permissions
View application logs:
docker-compose logs backend
docker-compose logs frontendFor issues and questions, please create an issue in the repository or contact the development team.
Rock 'em All - Enjoy your music! πΈπ΅