How sergiozona/taller1_sr_202310 works
Project Type and Purpose
• This is a full-stack music recommendation application.
• Purpose: Provide personalized song/album recommendations via a Python backend, with a React frontend for user interaction. Offline Jupyter notebooks generate/trains the recommendation models.
File Structure
• Top-level directories:
• backend/ – Python API endpoints (main.py, recommendation_systems/model.py)
• web-sr-app/ – React/Vite frontend (components, handlers, helpers)
• notebooks/ – Jupyter notebooks for exploratory data analysis and model training (knn_model.pkl)
• No explicit database directory: assume the backend uses an external database or a persisted model file (knn_model.pkl).
• Config files: .gitignore, package.json, vite.config.js hint at standard build/deploy flows.
README Insights
• Confirms separation: backend = API layer; web-sr-app = frontend; notebooks = model development.
Main Architectural Components
A. Model Training (Offline Notebook)
• Jupyter Notebook
• knn_model.pkl (artifact)
B. Backend Service
• Python application (main.py)
• recommendation_systems.model.py
• Endpoints: login, signup, getUserInfo, likeSong, likeAlbum, createPlaylist, playSong, addSongToPlaylist
C. Frontend Client
• React/Vite App (web-sr-app)
• UI Components (HomeGrid, SongCard, NowPlayingBar, etc.)
• State Provider & Reducer for global state
• Handlers that call backend REST APIs
D. External Services (if applicable)
• Spotify API (inferred from assets & Spotify logos)
• Auth provider or token service (if used)
Relationships and Data Flows
• GET /recommendations
• POST /likeSong, /likeAlbum, /createPlaylist, /addSongToPlaylist
• POST /login, /signup
• GET /userInfo
Architectural Patterns
• Frontend: Component-based UI with unidirectional data flow (StateProvider + Reducer)
• Backend: RESTful API serving JSON, Model–Controller separation (main.py routes vs. model.py logic)
• Offline vs. Online: Separately trained model vs. runtime inference
• Possible caching layer or queuing (optional enhancement)
Essential Elements
• Clear component labels (e.g., “RecommendationService”)
• Frontend vs. Backend vs. Data vs. External
• A note on technology: Python (Flask/FastAPI), React, Vite, Jupyter