How arpan-dey-web/cinetube-frontend works
1. What this repository is
- This is a Next.js App Router frontend for a movie/series portal, organized as a feature-based monorepo-style app rather than a flat pages-only project.
- The codebase is structured to support the README’s product vision: public browsing, auth, watchlist, reviews, payments, and an admin dashboard.
- Based on the file tree, the repo is currently frontend-heavy; the backend is represented through feature API modules and a shared API client, but there is no separate Express/Prisma server in this tree.
2. Top-level application boundary
- src/app is the routing shell and layout boundary.
- It uses route groups to separate concerns:
- (public) for marketing/catalog pages,
- (auth) for login/register,
- dashboard for authenticated user/admin areas.
- src/app/layout.tsx and src/app/globals.css define the global app shell and styling baseline.
- src/app/(public)/layout.tsx and src/app/dashboard/layout.tsx likely provide distinct navigation/footer/sidebar layouts for those zones.
3. How pages are composed
- Most route files are thin wrappers that delegate to feature-level views.
- Example pattern:
- src/app/(public)/browse/page.tsx → src/features/movie/views/browse-page.tsx
- src/app/dashboard/admin/analytics/page.tsx → src/features/dashboard/views/admin-analytics-page.tsx
- This keeps routing separate from page implementation and makes the UI reusable across routes.
4. Primary domain modules
- The app is split into feature domains under src/features:
- home: landing page sections and public content pages
- movie: browse and movie detail experiences
- auth: login/register flows
- dashboard: user/admin dashboard screens and analytics widgets
- watchlist: saved titles
- review: review-related data and display
- purchase and payment: commerce/checkout flow
- archive: archive page content
- Each feature has its own api, components, and views folders, which is the main maintainability boundary in the repo.
5. Data flow and content sourcing
- There are two visible data patterns:
- Static content modules in src/constants for site content, catalog data, movie catalog, and blog posts.
- Feature API modules in src/features/*/api that likely encapsulate remote calls or server interactions.
- src/shared/api/client.ts is the central client abstraction, suggesting all feature-level fetches should go through one shared transport layer.
- src/actions/revalidate.ts indicates the app uses Next.js server actions / cache revalidation as part of content updates or post-mutation refreshes.
6. Public/marketing experience
- The public site is broad and content-rich:
- home, about, blog, archive, browse, contact, FAQ, help, pricing, privacy, terms, watchlist.
- Home page composition is driven by src/features/home/components, which includes:
- hero/carousel
- trending/newly added/editor’s picks
- categories
- stats
- testimonials
- pricing
- FAQ
- newsletter
- blog preview
- This aligns with the README’s requirement for a dense landing page with multiple meaningful sections.
7. Catalog and detail experience
- src/features/movie is the core product area.
- Browse flow includes:
- search bar
- filters panel
- paginated grid
- skeleton loading state
- filter utilities and a dedicated hook for grid state
- Detail flow includes:
- hero/media presentation
- sidebar metadata
- related titles
- review section
- purchase modal
- payment return notice
- video player
- This module is the clearest embodiment of the “movie/series listing + details + action” architecture.
8. Authentication boundary
- Auth is isolated in src/features/auth, with separate API calls and page-specific components for login/register.
- src/providers/auth-provider.tsx suggests session/auth state is made available app-wide through React context.
- src/features/auth/utils/auth-session.ts is the likely place where session/token state is normalized for the UI.
- Social login UI is represented by AuthSocialButtons.tsx, indicating the repo anticipates multiple auth methods even if the backend is not present here.
9. User and admin dashboard architecture
- src/app/dashboard and src/features/dashboard form the multi-role workspace.
- The dashboard feature contains:
- overview cards
- activity charts
- genre donut chart
- recent activity table
- sidebar/topbar chrome
- profile and watchlist views
- admin views for analytics, messages, movies, reviews, and users
- This is the main role-based boundary in the app: the dashboard is where operational/admin tasks are centralized.
10. Commerce and monetization flow
- src/features/payment and src/features/purchase represent the checkout boundary.
- src/providers/StripeProvider.tsx indicates Stripe is the concrete payment integration planned for the frontend.
- The movie detail page includes a purchase modal and return notice, so purchase/payment is integrated into the title-detail journey rather than being a separate storefront.
- src/app/dashboard/purchase/page.tsx exposes purchase history or access management inside the authenticated area.
11. Reviews and social engagement
- src/features/review provides review API/query support and a featured reviews section.
- src/features/watchlist provides the saved-items workflow via API and a public watchlist page.
- The README describes likes/comments/spoilers/approval; in this tree, the architecture is ready for those behaviors but the implementation surface is centered on review rendering and API abstraction.
12. Shared UI and design system
- src/ui is a component library of reusable primitives and composite controls: buttons, cards, dialogs, tables, sheets, sliders, charts, nav menus, sidebars, etc.
- src/shared/components contains app-wide structural components such as navbar, footer, and page transitions.
- src/design-system defines tokens for colors, spacing, typography, radius, shadows, and animations, which gives the app a centralized visual system rather than scattered ad hoc styling.
13. Cross-cutting providers and runtime concerns
- src/providers contains app-wide context providers:
- theme switching
- auth/session
- Stripe
- src/config/env.ts and src/config/routes.ts centralize runtime configuration and route constants.
- This indicates the app is designed to keep environment-sensitive values and navigation references out of feature code.
14. Practical architecture takeaway
- The repo is organized around a clean flow:
- App Router route → feature view → feature components/API → shared client/constants/UI
- Public pages, authentication, catalog browsing, commerce, and dashboards are separated into distinct route and feature boundaries.
- For an architecture diagram, the dominant containers are:
- Next.js app shell
- feature modules
- shared UI/system layer
- provider layer
- static content/constants layer
- external services implied by auth/payment/revalidation
Main entry points: client.ts API client · movie-detail-page.tsx Detail view · dashboard-home-page.tsx Dashboard home · LoginPage.tsx Login form
Components 26
App shell
Next.js App Router boundaries and route-level layouts.
- Root layout · Global app shell and top-level providers mount point.
src/app/layout.tsx - Public layout · Shell for public browsing and marketing pages.
src/app/(public)/layout.tsx - Dashboard layout · Shell for authenticated dashboard areas.
src/app/dashboard/layout.tsx - Home route · Public landing page entry point.
src/app/(public)/page.tsx - Browse route · Public catalog browsing entry point.
src/app/(public)/browse/page.tsx - Detail route · Movie or series detail page entry point.
src/app/(public)/browse/[id]/page.tsx - Login route · Authentication sign-in entry point.
src/app/(auth)/login/page.tsx - Register route · Authentication sign-up entry point.
src/app/(auth)/register/page.tsx - Dashboard home · Authenticated workspace landing page.
src/app/dashboard/page.tsx - Admin analytics · Admin reporting and analytics entry point.
src/app/dashboard/admin/analytics/page.tsx
Feature modules
Domain features that implement the product flows.
- Home pages · Landing, about, help, pricing, blog, and policy views.
src/features/home/views/home-page.tsx - Browse view · Catalog search, filtering, pagination, and grid orchestration.
src/features/movie/views/browse-page.tsx - Detail view · Title hero, metadata, related titles, reviews, and purchase flow.
src/features/movie/views/movie-detail-page.tsx - Login form · Sign-in screen composition and form handling.
src/features/auth/components/LoginPage/LoginPage.tsx - Register form · Sign-up screen composition and form handling.
src/features/auth/components/RegisterPage/RegisterPage.tsx - Dashboard home · Overview cards and activity summary for the authenticated area.
src/features/dashboard/views/dashboard-home-page.tsx - Admin analytics · Administrative analytics workspace.
src/features/dashboard/views/admin-analytics-page.tsx - Purchase flow · Purchase and checkout boundary exposed from the dashboard.
src/features/purchase/views/purchase-page.tsx
Shared foundation
Reusable UI, helpers, and transport used across features.
- API client · Central client used by feature API modules.
src/shared/api/client.ts - Nav shell · Global navbar and footer composition.
src/shared/components/Navbar.tsx - UI kit · Reusable design-system-backed primitives and composites.
src/ui/button.tsx - Static content · Catalog, blog, and site content used by public pages.
src/constants/site-content.ts
Providers & config
App-wide providers and runtime configuration.
- App providers · Theme, auth, and payment providers used across the app.
src/providers/auth-provider.tsx - Config · Environment values and route constants.
src/config/routes.ts
External services
Backend and third-party systems implied by the frontend.
- Backend API · Remote application services consumed through the shared client.
- Stripe · Payment processor integrated through the payment provider.
Connections 27
- Root layout → App providers: mounts · Global providers are composed at the root.
- Root layout → Nav shell: wraps · Root layout hosts common navigation chrome.
- Public layout → Home pages: renders · Public shell hosts marketing and content pages.
- Public layout → Nav shell: uses · Public area uses shared navbar/footer.
- Dashboard layout → Dashboard home: wraps · Dashboard shell provides authenticated workspace chrome.
- Home route → Home pages: delegates to · Route page delegates implementation to the home feature.
- Browse route → Browse view: delegates to · Catalog route delegates to the movie browse view.
- Detail route → Detail view: delegates to · Detail route delegates to the movie detail view.
- Login route → Login form: delegates to · Login route delegates to the auth feature.
- Register route → Register form: delegates to · Register route delegates to the auth feature.
- Dashboard home → Dashboard home: delegates to · Dashboard route delegates to the dashboard feature.
- Admin analytics → Admin analytics: delegates to · Admin analytics route delegates to the dashboard feature.
- Home pages → Static content: reads · Landing and content pages are powered by static content modules.
- Browse view → API client: queries via · Browse data is loaded through the shared API client.
- Detail view → API client: queries via · Detail data and mutations go through the shared API client.
- Login form → API client: authenticates via · Login uses feature API calls over the shared client.
- Register form → API client: authenticates via · Registration uses feature API calls over the shared client.
- Dashboard home → UI kit: composes · Dashboard screens are built from shared UI primitives.
- Admin analytics → UI kit: composes · Admin screens are built from shared UI primitives.
- Detail view → Stripe: checks out with · Purchase modal and payment flow integrate with Stripe.
- Detail view → Backend API: loads data from · Title, review, and related-content data come from backend services.
- Dashboard home → Backend API: loads data from · Dashboard metrics and activity are sourced from backend services.
- Login form → Backend API: loads data from · Session creation depends on backend auth services.
- Register form → Backend API: loads data from · Account creation depends on backend auth services.
- App providers → Stripe: provides · Stripe provider exposes payment context app-wide.
- App providers → Backend API: configures access to · Auth/session and theme providers support API-driven app behavior.
- Config → API client: configures · Environment and route constants shape the shared client and navigation.