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>
2026-09-16 18:44:30 +00:00
|
|
|
|
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'
|
2026-09-16 20:23:33 +00:00
|
|
|
|
import Saved from './pages/Saved'
|
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>
2026-09-16 18:44:30 +00:00
|
|
|
|
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 />} />
|
2026-09-16 20:23:33 +00:00
|
|
|
|
<Route path="/saved" element={<Saved />} />
|
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>
2026-09-16 18:44:30 +00:00
|
|
|
|
<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
|