The official website of the Youth Oceanic Initiative β built with Payload CMS and Next.js.
- Framework: Next.js 16 (App Router, Turbopack)
- CMS: Payload CMS 3
- Database: PostgreSQL (Neon in production)
- Storage: Vercel Blob (media uploads)
- Styling: Tailwind CSS v4, shadcn/ui
- Package manager: Bun
- Bun β₯ 1.0
- Node.js β₯ 20.9
- PostgreSQL (local) or a Neon connection string
# Install dependencies
bun install
# Copy env template and fill in values
cp .env.example .envRequired environment variables:
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
PAYLOAD_SECRET |
Secret key for Payload JWT signing |
NEXT_PUBLIC_SERVER_URL |
Public URL (e.g. http://localhost:3000) |
BLOB_READ_WRITE_TOKEN |
Vercel Blob token (optional locally) |
bun devApp runs at http://localhost:3000.
Payload admin at http://localhost:3000/admin.
# Create and apply migrations
bun payload migrate:create --name <migration_name>
bun payload migrate
# Seed data from JSON files
bun run seed
# Seed globals (Header, Footer) + upload media to Blob
bun run seed:globalsbun run build
bun startsrc/
βββ app/
β βββ (frontend)/ # Public-facing Next.js pages
β βββ (payload)/ # Payload admin panel
βββ collections/ # Payload collections (Pages, Posts, TeamMembers, etc.)
βββ globals/ # Payload globals (Header, Footer, JoinOptions)
βββ components/ # Shared React components
β βββ ui/ # shadcn/ui primitives
β βββ banners/ # Hero banner components
β βββ navigation/ # Navbar + mobile sidebar
βββ blocks/ # Payload block components
βββ heros/ # Hero block variants
βββ scripts/ # Seed scripts
βββ migrations/ # Payload DB migrations
| Collection | Description |
|---|---|
| Pages | CMS-managed pages with block builder |
| Posts | Blog / newsletter posts |
| TeamMembers | YOI team members by department |
| Projects | YOI projects and initiatives |
| Events | Past and upcoming events |
| Opportunities | Ocean conservation opportunities database |
| Chapters | YOI school chapters (with geo coordinates) |
| Media | Uploaded files (stored in Vercel Blob) |
| Users | Admin users with profile pictures |
Deployed on Vercel. Pushes to main trigger automatic production deploys.
When adding new collections or changing the schema:
- Run
bun payload migrate:create --name <name>locally - Commit the generated migration files in
src/migrations/ - Apply to prod:
DATABASE_URL=<prod_url> bun payload migrate
Β© 2024 The Youth Oceanic Initiative. All rights reserved.