Public-facing site for RightsContent built with Next.js App Router. It renders videos and artworks from the content-server API and is intended to be deployed to the main marketing domain.
- Videos listing and detail pages driven from the API
- Artworks listing and detail pages with tag-based suggestions
- Home page with recommended, featured, and recent content sections
- Responsive layout styled with Tailwind CSS 4
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- UI: React 19, Tailwind CSS 4
- Carousel / sliders:
swiper
src/app– Next.js App Router routes (home, videos, artworks, etc.)src/components– reusable UI components (cards, sections, sliders, layout)src/lib/api.ts– typed API client for the publiccontent-serverendpointssrc/types– shared domain types (Video,Artwork, pagination)
Environment variables are read from .env (not committed). Do not commit secrets; use placeholders in example files.
Required variables:
NEXT_PUBLIC_API_URL: Base URL for the content API.- Example in local dev:
http://localhost:4000 - Example in production:
https://api.rightscontent.com
- Example in local dev:
NEXT_PUBLIC_SUPABASE_URL: Supabase project URL (public, but keep consistent across apps).NEXT_PUBLIC_SUPABASE_ANON_KEY: Supabase anonymous client key (treated as a secret for safety).
Optional / legacy:
NEXT_PUBLIC_CONTENT_API_URL: Older alias for the content API base. PreferNEXT_PUBLIC_API_URLand keep this only if other tools still rely on it.
-
Install dependencies:
cd content-frontend npm install -
Create a
.envfile based on the variables above and pointNEXT_PUBLIC_API_URLat your runningcontent-server(defaulthttp://localhost:4000). -
Run the dev server:
npm run dev
-
Open
http://localhost:3000in your browser.
To create an optimized production build:
cd content-frontend
npm run build
npm startBy default, next start listens on port 3000. Set PORT to customize:
PORT=3002 npm startThe frontend talks to content-server using the helper in src/lib/api.ts:
- Base URL:
NEXT_PUBLIC_API_URL - Public endpoints used:
GET /api/videos(with optionalrecommended,featured,sort=recent,page,pageSize)GET /api/videos/:slugGET /api/videos/:slug/suggestionsPOST /api/videos/:slug/view(view count)GET /api/artworks(withfeatured,page,pageSize)GET /api/artworks/:slugGET /api/artworks/:slug/suggestions
The shared fetcher uses cache: "no-store" so that new content added in the admin appears immediately on the site.
Run ESLint:
npm run lint- Always deploy using a production build (
npm run build+npm start), notnpm run dev. - Ensure
NEXT_PUBLIC_API_URLin the environment points to the productioncontent-server. - If you use a platform like Vercel, configure the environment variables there instead of committing
.envfiles.