How syeo66/shufflify works
Main Components
a) Frontend Layer:
• Svelte-based Single Page Application (SPA) as the primary user interface
• Main components hierarchy:
• App.svelte as the root component
• Header, Login, Main, Configuration, Playlists, Stats, and UserInfo components
b) State Management Layer:
• Svelte stores:
• token store (authentication)
• playlists store
• configuration store
• stats store
• availableDevice store
• savedTrackCount store
c) External Integration Layer:
• Spotify Web API integration
• Authentication flow with Spotify
d) Function Layer:
• Utility functions (chunkArray, getToken, signInWithSpotify)
• Query functions (retrievePlaylists, retrieveUserData)
[User Browser]
• ↓
[Nginx Server] → [Static Assets]
• ↓
[Svelte Frontend]
• ↓
[State Management (Stores)]
• ↓
[Function Layer]
• ↓
[Spotify Web API]
Important Relationships to Highlight
• Authentication Flow:
• Login.svelte → signInWithSpotify.ts → Spotify OAuth → token store
• Data Flow:
• Playlists.svelte → retrievePlaylists.ts → Spotify API → playlists store
• UserInfo.svelte → retrieveUserData.ts → Spotify API → relevant stores
Technical Stack Elements
• Svelte as the frontend framework
• TypeScript for type safety
• Vite as the build tool
• Nginx as the web server
• Docker for containerization
Additional Elements
• Version/environment indicators
• Error handling paths
• Asynchronous operations
The modern frontend architecture using Svelte and TypeScript
Remember to use standardized symbols for:
• Components (rectangles)
• External services (clouds)
This will create a comprehensive yet clear representation of the shufflify application's architecture, making it easy for team members to understand the system's structure and data flow.