Installation Guide
This guide covers everything you need to install and run Beat App, from local development to production deployment.Prerequisites
Before installing Beat App, ensure you have the following installed:- Node.js: Version 18 or higher (v22 recommended for Docker builds)
- Package Manager: npm, yarn, or pnpm
- Git: For cloning the repository
- Docker (optional): For containerized deployment
Check your Node.js version with
node --version. If you need to upgrade, visit nodejs.org.Local Development Setup
Install dependencies
Install all required dependencies using your preferred package manager:This will install:
- React 18.2.0 - Core UI framework
- Vite 7.3.1 - Build tool and dev server
- Material-UI 7.3.8 - UI component library
- Nanostores - State management
- Axios - HTTP client
- React Router DOM - Routing
Environment configuration
Copy the example environment file:Update the
.env file with your configuration:Environment variables prefixed with
VITE_ are exposed to the client-side code. Keep your API tokens secure.Production Build
Build Beat App for production deployment:Create production build
Generate optimized production assets:This creates a
dist/ directory with:- Minified JavaScript bundles
- Optimized CSS
- Compressed assets
- Source maps (optional)
Docker Deployment
Beat App includes a complete Docker setup for production deployment with NGINX.Docker Configuration
The includedDockerfile uses a multi-stage build:
Deploy with Docker Compose
Build and run with Docker Compose
The easiest way to deploy Beat App is using Docker Compose:This command:
- Builds the production Docker image
- Starts the NGINX server
- Runs the container in detached mode
- Serves the app on port 3000
Verify deployment
Check that the container is running:View logs:Access the app at
http://localhost:3000.Manual Docker Build
For more control, build and run the Docker image manually:Project Structure
After installation, your project structure will look like this:Dependencies Breakdown
Production Dependencies
Development Dependencies
Vite Configuration
The Vite configuration is minimal and optimized:Vite provides instant HMR (Hot Module Replacement) for a seamless development experience.
Environment Variables
Beat App uses Vite’s environment variable system:| Variable | Description | Required |
|---|---|---|
VITE_API_URL | Backend API base URL | Yes |
VITE_YOUTUBE_API_TOKEN | YouTube Music API authentication token | Yes |
Environment variables are loaded from
.env files. Never commit .env files to version control.Troubleshooting
Port Already in Use
If port 5173 is already in use:vite.config.js:
Module Not Found Errors
Clear node_modules and reinstall:Docker Build Fails
Ensure Docker has enough memory allocated (at least 2GB recommended):API Connection Issues
Verify your.env configuration:
Next Steps
Quickstart Guide
Get started with Beat App and play your first track
API Reference
Explore the YouTube API service and player store methods
Environment Variables
Learn about environment configuration
Deployment
Deploy Beat App to cloud platforms