Initial MVP: full-stack music discovery app
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
This commit is contained in:
0
backend/app/schemas/__init__.py
Normal file
0
backend/app/schemas/__init__.py
Normal file
27
backend/app/schemas/auth.py
Normal file
27
backend/app/schemas/auth.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from pydantic import BaseModel, EmailStr
|
||||
|
||||
|
||||
class RegisterRequest(BaseModel):
|
||||
email: EmailStr
|
||||
name: str
|
||||
password: str
|
||||
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
email: EmailStr
|
||||
password: str
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
access_token: str
|
||||
token_type: str = "bearer"
|
||||
|
||||
|
||||
class UserResponse(BaseModel):
|
||||
id: int
|
||||
email: str
|
||||
name: str
|
||||
is_pro: bool
|
||||
spotify_connected: bool
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
46
backend/app/schemas/playlist.py
Normal file
46
backend/app/schemas/playlist.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class TrackResponse(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
|
||||
tempo: float | None = None
|
||||
energy: float | None = None
|
||||
danceability: float | None = None
|
||||
valence: float | None = None
|
||||
genres: list | None = None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class PlaylistResponse(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
platform_source: str
|
||||
track_count: int
|
||||
taste_profile: dict | None = None
|
||||
imported_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class PlaylistDetailResponse(PlaylistResponse):
|
||||
tracks: list[TrackResponse] = []
|
||||
|
||||
|
||||
class SpotifyPlaylistItem(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
track_count: int
|
||||
image_url: str | None = None
|
||||
|
||||
|
||||
class ImportSpotifyRequest(BaseModel):
|
||||
playlist_id: str
|
||||
39
backend/app/schemas/recommendation.py
Normal file
39
backend/app/schemas/recommendation.py
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
Reference in New Issue
Block a user