Django/DRF + PostgreSQL/Redis/Celery backend with accounts, library, moments, and notifications apps; React/TypeScript/Vite frontend with Instagram-style sidebar nav, feed, profiles, nested comment replies, notifications, and photo/video upload with ffmpeg-generated posters. Co-Authored-By: Claude Sonnet 5 <[email protected]>
82 lines
2.4 KiB
TypeScript
82 lines
2.4 KiB
TypeScript
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
|
|
import { ProtectedRoute } from './components/ProtectedRoute'
|
|
import { Sidebar } from './components/Sidebar'
|
|
import { AuthProvider } from './context/AuthContext'
|
|
import { CreatePage } from './pages/CreatePage'
|
|
import { FeedPage } from './pages/FeedPage'
|
|
import { LibraryPage } from './pages/LibraryPage'
|
|
import { LoginPage } from './pages/LoginPage'
|
|
import { NotificationsPage } from './pages/NotificationsPage'
|
|
import { ProfilePage } from './pages/ProfilePage'
|
|
import { RegisterPage } from './pages/RegisterPage'
|
|
import { SettingsPage } from './pages/SettingsPage'
|
|
|
|
function App() {
|
|
return (
|
|
<BrowserRouter>
|
|
<AuthProvider>
|
|
<div className="app-shell">
|
|
<Sidebar />
|
|
<main className="app-main">
|
|
<Routes>
|
|
<Route path="/login" element={<LoginPage />} />
|
|
<Route path="/register" element={<RegisterPage />} />
|
|
<Route
|
|
path="/"
|
|
element={
|
|
<ProtectedRoute>
|
|
<FeedPage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/create"
|
|
element={
|
|
<ProtectedRoute>
|
|
<CreatePage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/library"
|
|
element={
|
|
<ProtectedRoute>
|
|
<LibraryPage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/notifications"
|
|
element={
|
|
<ProtectedRoute>
|
|
<NotificationsPage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/profile/:username"
|
|
element={
|
|
<ProtectedRoute>
|
|
<ProfilePage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/settings"
|
|
element={
|
|
<ProtectedRoute>
|
|
<SettingsPage />
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
</Routes>
|
|
</main>
|
|
</div>
|
|
</AuthProvider>
|
|
</BrowserRouter>
|
|
)
|
|
}
|
|
|
|
export default App
|