# ๐ŸŽต Jukebox Mobile App - Quick Start Guide ## Project Structure at a Glance ``` jukebox/ โ”œโ”€โ”€ ๐Ÿ“ฑ jukebox/ # React Native Mobile App (Expo) โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ screens/ # 7 screens (Home, Album, LikedTracks, Auth) โ”‚ โ”‚ โ”œโ”€โ”€ components/ # Reusable UI components โ”‚ โ”‚ โ”œโ”€โ”€ contexts/ # State management (Library, Player) โ”‚ โ”‚ โ””โ”€โ”€ data/ # Mock data (currently hardcoded) โ”‚ โ”œโ”€โ”€ admin_panel/ # React web admin dashboard โ”‚ โ””โ”€โ”€ assets/ # Images and icons โ”œโ”€โ”€ ๐Ÿ”Œ www/api/ # Laravel REST API backend โ”œโ”€โ”€ ๐Ÿ“‹ db/ # Database schema โ””โ”€โ”€ ๐Ÿ“ mocks/ # UI mockups and designs ``` --- ## ๐Ÿš€ Running the Mobile App ### Prerequisites ```bash # Install Node.js 18+ and npm # Install Expo CLI globally npm install -g expo-cli ``` ### Development ```bash cd /home/mathias/jukebox/jukebox # Start development server npm start # Or run on specific platform npm run android # Android emulator npm run ios # iOS simulator npm run web # Web browser ``` ### What Works โœ… - Navigation between all screens - Like/unlike tracks - Search and sort in liked tracks - UI layouts and styling - Header and components ### What's Missing โŒ - **API Integration** - Still uses hardcoded mock data - **Audio Playback** - No actual music playing - **Authentication** - Login doesn't connect to backend - **Data Persistence** - State resets on app close --- ## ๐Ÿ“Š Current Data (Mock) **2 Albums in app.data.library:** 1. **Soundtracks For The Blind** by Swans (1996) - 26 tracks - 8485 seconds total 2. **Discovery** by Daft Punk (2001) - 14 tracks - 3650 seconds total **Total**: 40 tracks, some marked as liked --- ## ๐ŸŽฏ Screen Map | Screen | Location | Purpose | Status | |--------|----------|---------|--------| | **Home** | HomeScreen.js | Browse albums, see liked tracks | โœ… Working | | **Album** | AlbumScreen.js | View album details and track list | โœ… Working | | **Liked Tracks** | LikedTracksScreen.js | Search/sort liked tracks | โœ… Working | | **Login** | LoginScreen.js | User authentication | โš ๏ธ UI only | | **Sign Up** | SignUpScreen.js | User registration | โš ๏ธ UI only | | **Password Reset** | PasswordResetScreen.js | Recovery flow | โš ๏ธ UI only | | **Settings** | SettingsScreen.js | User preferences | โš ๏ธ UI only | --- ## ๐Ÿ”‘ Key Files to Understand ### State Management - **`src/contexts/LibraryContext.js`** - Album library and likes state - **`App.js`** - PlayerProvider (music player state) ### Data - **`src/data/library.js`** - All mock data lives here ### Main Components - **`src/components/TrackRow.js`** - Single track display - **`src/components/MediaPlayer.js`** - Bottom player widget - **`src/components/Header.js`** - Screen headers --- ## ๐Ÿ”Œ API Status Backend is built at `www/api/` but mobile app isn't connected yet. **Key Endpoints Available** (not yet used by mobile): ``` POST /api/login # User login GET /api/albums # Get all albums GET /api/albums/{id} # Get album with tracks POST /api/tracks/{id}/like # Like a track GET /api/me/likes # Get user's liked tracks ``` --- ## ๐Ÿ› ๏ธ Next Development Priorities ### Priority 1: Connect to API ```javascript // In LibraryContext.js, replace: const [albums, setAlbums] = useState(initialLibrary); // With: useEffect(() => { fetch('/api/albums') .then(r => r.json()) .then(data => setAlbums(data)); }, []); ``` ### Priority 2: Add Audio Playback ```bash npm install expo-av ``` ### Priority 3: Implement Authentication - Connect LoginScreen to `/api/login` - Store token in AsyncStorage - Fetch user's liked tracks after login ### Priority 4: Admin Panel Pages Implement the stub pages in `admin_panel/src/pages/` --- ## ๐Ÿ“ฑ Screen Navigation Flow ``` Home Screen โ”œโ”€ Click Album โ†’ Album Screen โ”‚ โ””โ”€ Track โ†’ Like/Unlike โ”œโ”€ Liked Tracks โžš โ†’ Liked Tracks Screen โ”‚ โ”œโ”€ Search & Filter โ”‚ โ””โ”€ Sort by Name/Date/Length โ”œโ”€ User Icon โ†’ Login Screen โ”‚ โ”œโ”€ Don't have account? โ†’ Sign Up Screen โ”‚ โ””โ”€ Forgot password? โ†’ Password Reset Screen โ””โ”€ Settings Icon โ†’ Settings Screen โ””โ”€ Notifications & Audio Quality toggles ``` --- ## ๐ŸŽจ Design System ### Colors - **Background**: Pure black (`#000`) - **Surfaces**: Dark gray (`#111827`, `#1f2937`) - **Text**: White (`#fff`) - **Accent**: Pink/Red (`#ff4d6d` for likes) - **Buttons**: Light gray (`#dbdbdb`) ### Spacing - **Container padding**: 16px horizontal - **Vertical spacing**: 12-24px - **Border radius**: 8-10px ### Typography - **Headers**: Bold, 24-32px - **Body**: Regular, 15-16px - **Meta**: Gray, 12-14px --- ## ๐Ÿงช Testing the App ### Test the Like Feature 1. Open HomeScreen 2. Find a track in "Liked tracks" section 3. Click the heart icon 4. Scroll to Liked Tracks Screen to verify ### Test Search & Sort 1. Navigate to "Liked Tracks โžš" 2. Type in search box (searches title/artist) 3. Click "Sort by" dropdown 4. Try sorting by: Date Added, Name, Length 5. Click ASC/DESC to reverse order ### Test Navigation 1. From Home โ†’ click any album 2. Album Screen โ†’ click back button 3. Verify you return to Home --- ## ๐Ÿ› Known Issues 1. **MediaPlayer doesn't actually play music** - It's just a UI component 2. **Login form doesn't save user data** - No backend integration 3. **Settings toggles don't persist** - No AsyncStorage usage 4. **No error handling** - API calls will fail silently 5. **No loading indicators** - Data fetching appears instant but might lag --- ## ๐Ÿ“š Further Reading - **Full Exploration**: `MOBILE_APP_EXPLORATION.md` - **API Docs**: `www/api/API_QUICK_REFERENCE.md` - **React Navigation**: https://reactnavigation.org/docs/native-stack-navigator/ - **Expo Docs**: https://docs.expo.dev/ --- ## ๐Ÿ’ก Tips for Development 1. **Hot reload**: Press `r` in terminal while `npm start` runs 2. **Inspect state**: Use React DevTools browser extension 3. **Test on real device**: Use Expo Go app and scan QR code 4. **Debug API**: Use the Postman collection: `jukebox-api.postman_collection.json` 5. **Check data structure**: Look at `src/data/library.js` first --- **Last Updated**: May 12, 2026 **Explorer**: Claude Code