How abhijeetparashar/video-on-demand-streaming-aws-nextjs works
Project type and purpose
• This is a Next.js 14 full-stack web application built with the app-directory convention.
• It provides user authentication (NextAuth), course content delivery (video player + syllabus), and file upload functionality.
• Likely use case: an e-learning platform where authenticated users can view course materials and upload content.
File structure
• Top-level files: configuration (.eslintrc.json, tailwind.config.ts, next.config.mjs, tsconfig.json), CSS (globals.css), package manifests.
• app/ directory:
• app/layout.tsx & app/globals.css – root layout and global styles (Tailwind).
• app/page.tsx – home page.
• app/course/page.tsx + _components – dynamic course page and subcomponents (Contents, Player).
• app/upload/page.tsx – upload form page.
• app/api/… – serverless API routes (auth, course, upload).
• components/ directory: reusable UI primitives (Appbar, Provider, SignInButton, UploadForm).
README for additional insights
• Standard create-next-app boilerplate with NextAuth, next/font, Tailwind CSS.
Main components
a. Client (Browser)
– Next.js pages and React components served as static and dynamic JS/CSS.
b. Next.js Serverless Layer
– API routes under app/api:
• auth (NextAuth) – sign-in, session management, OAuth providers.
• course – fetch course metadata & content URLs.
• upload – handle file uploads, store to persistent storage.
– Page rendering: SSR/SSG or streaming (app directory).
c. Data Services
– Database (e.g., PostgreSQL, MongoDB) for users, sessions, course metadata.
– Object storage (e.g., S3, Vercel Storage) for uploaded media.
d. External Services
– OAuth provider(s) via NextAuth (e.g., Google, GitHub).
– Vercel platform for hosting, CDN, and edge functions (optional).
Relationships and data flows
• User opens Browser → requests Next.js page → served by Next.js (SSG/SSR).
• Browser ↔ API/auth for login → NextAuth session management ↔ DB.
• Browser ↔ API/course to fetch course list or details → DB.
• Browser ↔ API/upload to POST files → serverless function → object storage → returns URL.
• Next.js mediates data between client and data services; UI components consume fetched data.
Architectural patterns & design principles
• Monolithic full-stack application using Next.js’s built-in serverless routes.
• Separation of concerns:
• UI layer (app/page.tsx, components/)
• API layer (app/api/*)
• Data layer (DB + storage)
• Incremental Static Regeneration (ISR) or Server-Side Rendering (SSR) for performance.
• Tailwind CSS for utility-first styling.
• NextAuth for pluggable authentication.
Technologies, frameworks, libraries
• Next.js (app directory, React, serverless functions)
• NextAuth (authentication)
• Tailwind CSS (styling)
• TypeScript
• PostCSS (postcss.config.mjs)
• Vercel (hosting/CDN/serverless)