The project uses a client-heavy Next.js App Router frontend with shared providers defined at the root layout level.
App Router pages
-> feature-level page components
-> reusable UI components
-> hooks + Redux selectors/query hooks
-> RTK Query base API
-> backend HTTP API
src/app/layout.tsx wires the top-level providers and cross-cutting concerns:
GoogleOAuthProvider- Redux
Providers - Custom MUI
ThemeProvider InitColorSchemeScriptCssBaselineNotificationProvider- Google Tag Manager injection
- Hotjar initialization script
Files in src/app/ define route entry points and metadata.
Examples:
src/app/page.tsxsrc/app/login/page.tsxsrc/app/videos/page.tsxsrc/app/videos/[videoId]/page.tsxsrc/app/videos/results/page.tsxsrc/app/upload-video/page.tsx
These route files are thin and generally delegate rendering to feature modules.
Feature modules in src/features/ contain page-level behavior and orchestration.
Observed features:
HomePageLoginPageVideosListingPageSearchResultsPageVideoDetailUploadVideo
Typical responsibilities:
- coordinating hooks and API calls
- handling page state and rendering modes
- composing reusable components into route experiences
src/components/ holds reusable UI primitives and layout pieces, such as:
- navigation (
Navbar,Sidebar) - media display (
VideoCard,VideoPlayer) - content helpers (
ReadMore,EmptyState) - theming (
theme,ThemeToggle) - feedback (
Notification) - shell/layout (
containers/MainLayoutContainer)
Redux Toolkit is used for application state and RTK Query for remote data fetching.
Core files:
src/redux/store/configureStore.tsxsrc/redux/store/provider.tsxsrc/redux/baseApi.tsxsrc/redux/customBaseQuery.tssrc/redux/login/*src/redux/events/*
Custom hooks encapsulate navigation, auth, feature flags, query management, and reusable behavior.
Examples:
useAuthuseNavigationuseVideoQueryManageruseFeatureFlagsuseDebounceuseSidebar
Authentication is implemented across several pieces:
- Google sign-in starts in
src/features/LoginPage/loginPage.tsx - the frontend posts
auth_tokentoPOST /users/login - session tokens and user info are stored in Redux login state
- persisted session data is filtered and stored via
redux-persist useAuth()redirects users based on auth state and route context- unauthorized API responses (
401) triggerlogin/logout
src/redux/customBaseQuery.ts centralizes request behavior:
- base URL resolution using
NEXT_PUBLIC_BASE_URL - Bearer token injection from Redux state
- logout on
401 - notification display for API errors
- error normalization through
parseError
MainLayoutContainer is the primary authenticated shell:
- calls
useAuth()to enforce auth redirects - renders top navigation
- optionally renders persistent left sidebar
- optionally renders a drawer sidebar for smaller screens
- optionally renders right sidebar content, used by the video detail page
The theme layer uses MUI with CSS variables and Emotion support.
Observed characteristics:
- custom typography variants (
bodySmall,bodyMedium,bodyLarge) - dark mode configured as default color scheme
InitColorSchemeScriptis included to avoid theme flash during hydrationThemeTogglevisibility is controlled via feature flags on the login page
-
No middleware file is active in the current structure for route protection; auth guarding currently appears hook-based.
-
The upload architecture is incomplete from the inspected files because only the top-level upload UI entry points were reviewed.