Implement Phases 1-5: skeleton, OAuth, categories, video sync/feed, playback
- FastAPI + PostgreSQL + Alembic + React/Vite skeleton, Docker Compose, healthcheck - Google OAuth (single allowed account), encrypted refresh token storage - Subscriptions sync with pagination, uploads playlist batch fetch - Categories CRUD, many-to-many channel assignment, category filtering - Video sync (playlistItems + videos.list batching), cached feed with cursor pagination, background scheduler (APScheduler) - Video detail page with YouTube embed player - SPA fallback routing, optimistic UI updates, client-side query caching 40 backend tests covering OAuth allow-list, sync idempotency, cascade deletes, cursor pagination, and category filtering. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
commit
0ed20bb838
90 changed files with 8545 additions and 0 deletions
55
frontend/src/App.tsx
Normal file
55
frontend/src/App.tsx
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { useQuery } from '@tanstack/react-query'
|
||||
import { Route, Routes } from 'react-router-dom'
|
||||
import { getAuthStatus } from './api/client'
|
||||
import Connect from './pages/Connect'
|
||||
import Feed from './pages/Feed'
|
||||
import Channels from './pages/Channels'
|
||||
import ChannelVideos from './pages/ChannelVideos'
|
||||
import VideoPage from './pages/VideoPage'
|
||||
import Categories from './pages/Categories'
|
||||
import './App.css'
|
||||
|
||||
function App() {
|
||||
const { data, isLoading, isError } = useQuery({
|
||||
queryKey: ['auth-status'],
|
||||
queryFn: getAuthStatus,
|
||||
})
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="app">
|
||||
<p>Загрузка...</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
<div className="app">
|
||||
<p className="error">Backend недоступен</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (!data?.authenticated) {
|
||||
return (
|
||||
<div className="app">
|
||||
<Connect />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="app">
|
||||
<Routes>
|
||||
<Route path="/" element={<Feed />} />
|
||||
<Route path="/channels" element={<Channels />} />
|
||||
<Route path="/channels/:channelId/videos" element={<ChannelVideos />} />
|
||||
<Route path="/video/:youtubeVideoId" element={<VideoPage />} />
|
||||
<Route path="/categories" element={<Categories />} />
|
||||
</Routes>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
Loading…
Add table
Add a link
Reference in a new issue