Backend (FastAPI): - User auth with email/password and Spotify OAuth - Spotify playlist import with audio feature extraction - AI recommendation engine using Claude API with taste profiling - Save/bookmark recommendations - Rate limiting for free tier (10 recs/day, 1 playlist) - PostgreSQL models with Alembic migrations - Redis-ready configuration Frontend (React 19 + TypeScript + Vite + Tailwind): - Landing page, auth flows (email + Spotify OAuth) - Dashboard with stats and quick discover - Playlist management and import from Spotify - Discover page with custom query support - Recommendation cards with explanations and save toggle - Taste profile visualization - Responsive layout with mobile navigation - PWA-ready configuration Infrastructure: - Docker Compose with PostgreSQL, Redis, backend, frontend - Environment-based configuration
40 lines
909 B
Python
40 lines
909 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class RecommendationRequest(BaseModel):
|
|
playlist_id: int | None = None
|
|
query: str | None = None # Manual search/request
|
|
|
|
|
|
class RecommendationItem(BaseModel):
|
|
id: int
|
|
title: str
|
|
artist: str
|
|
album: str | None = None
|
|
spotify_id: str | None = None
|
|
preview_url: str | None = None
|
|
image_url: str | None = None
|
|
reason: str
|
|
score: float | None = None
|
|
saved: bool = False
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class RecommendationResponse(BaseModel):
|
|
recommendations: list[RecommendationItem]
|
|
remaining_today: int | None = None # None = unlimited (pro)
|
|
|
|
|
|
class TasteProfile(BaseModel):
|
|
top_genres: list[dict]
|
|
avg_energy: float
|
|
avg_danceability: float
|
|
avg_valence: float
|
|
avg_tempo: float
|
|
era_preferences: list[str]
|
|
mood_summary: str
|