尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
Web app for exploring NASA public data, plus a moderation backoffice.
Single Next.js codebase: the public site lives in (frontend) and Payload CMS
in (payload) (/admin, REST, GraphQL).檢視完整 README ↗🚀 Live Demo: https://nasa-payload-tau.vercel.app/
Web app for exploring NASA public data, plus a moderation backoffice.
Single Next.js codebase: the public site lives in (frontend) and Payload CMS
in (payload) (/admin, REST, GraphQL).
| Platform | Scope | URL |
|---|---|---|
| Vercel | Next.js Frontend & Payload CMS | https://nasa-payload-tau.vercel.app/ |
| Chromatic | Storybook Design System & Component Catalog | View Storybook Catalog |
DATABASE_URL./api/auth/callback/google & /github) pointing to the production domain.pnpm chromatic.| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, React 19, Cache Components) |
| CMS / API | Payload 3.88 + MongoDB (@payloadcms/db-mongodb) |
| Front auth | Auth.js / NextAuth v5 (Google + GitHub, JWT session) |
| UI | Tailwind CSS v4 + shadcn/ui (new-york style, neutral base) |
| Primitives | Radix UI, CVA, tailwind-merge, Lucide |
| 3D / visuals | Three.js, globe.gl, Embla Carousel |
| Validation | Zod |
| Admin editor | Lexical (@payloadcms/richtext-lexical) |
| Package manager | pnpm |
| Local DB | MongoDB 7 via Docker Compose |
Runtime
next, react, react-dom — app and RSCpayload, @payloadcms/next, @payloadcms/ui, @payloadcms/db-mongodb, @payloadcms/richtext-lexical — CMS and adminnext-auth — reader OAuth loginnext-themes — light / darkzod — front env and schemasvaul — drawerssonner — toastsembla-carousel-react — carouselsglobe.gl + three — 3D Earth / EPIC and sceneslite-youtube-embed — live stream playerusehooks-ts — utility hooksclass-variance-authority, clsx, tailwind-merge, cn — variants and classnameslucide-react — iconsgraphql — Payload GraphQLDev
@tailwindcss/postcssFront (reader)
nasa.gov WP REST), article detail, and nested commentsBackoffice (moderator)
/adminpending → approved / rejected / spam)| Route | Description |
|---|---|
/ | Home |
/news, /news/[id] | News archive and article detail |
/asteroids, /asteroids/[id] | NEO catalog and detail |
/events, /events/[id] | EONET events and detail |
/latest-frontiers | Image Library search |
/apod | Astronomy Picture of the Day |
/live | NASA live stream (YouTube) |
/comments | Signed-in user's comments |
/favorites | User favorites |
/notifications | Notifications (e.g. replies) |
/design | Design system sandbox |
/admin | Payload CMS |
/api/auth/* | Auth.js (NextAuth) |
/api/* | Payload REST |
/api/graphql | Payload GraphQL |
Base URLs are centralized in src/shared/constants/nasa-endpoints.ts.
| Source | Base / URL | Used for |
|---|---|---|
| EPIC | https://epic.gsfc.nasa.gov/api | Earth imagery (/enhanced) — home 3D explorer |
| APOD (WP) | https://science.nasa.gov/wp-json/wp/v2 | Picture of the Day (/apod-basic) |
| News (WP) | https://www.nasa.gov/wp-json/wp/v2 | Feed and detail (/posts, /posts/:id) |
| EONET | https://eonet.gsfc.nasa.gov/api/v3 | Natural events (/events, /events/:id) |
| NeoWs | https://api.nasa.gov/neo/rest/v1 | Asteroids (/neo/browse, /neo/:id, /feed) |
| Image Library | https://images-api.nasa.gov | Latest Frontiers and project media (/search) |
| TechPort | https://api.nasa.gov/techport/api | Featured home missions (/projects, /projects/:id) |
| The Space Devs | https://ll.thespacedevs.com/2.2.0 | Next launch (/launch/upcoming) |
| YouTube | https://www.youtube.com/@NASA/live | Live status / embed |
NeoWs and TechPort need
NASA_API_KEY/NEXT_PUBLIC_NASA_API_KEY(api.nasa.gov). Without a key the server falls back toDEMO_KEY(low rate limit).
Standard Payload pattern on /api/<collection>.
| Collection | Example | Notes |
|---|---|---|
comments | GET /api/comments?where[articleId][equals]=<id>&limit=200&depth=0&sort=createdAt | Anonymous users only see approved |
comments | POST /api/comments | Public create; status always starts as pending |
site-users | /api/site-users | OAuth readers (authenticated access) |
favorites | /api/favorites | Reader saves |
notifications | /api/notifications | Alerts (e.g. reply) |
users | /api/users | Admin staff |
The front also uses Payload's Local API (server actions / RSC) and bypasses HTTP access control when running in the same process.
GraphQL: /api/graphql (playground at /api/graphql-playground).
src/
app/
(frontend)/ # Public app (Tailwind + design tokens)
(home)/page.tsx
news/ asteroids/ events/ apod/ live/ …
api/auth/[...nextauth]/
(payload)/ # Admin + REST + GraphQL
admin/[[...segments]]/
api/[...slug]/
features/ # Front domains (services, components, types)
home/ news/ asteroids/ events/ apod/ comments/ …
shared/ # UI kit, tokens, http client, NASA constants
collections/ # Comments, SiteUsers, Favorites, Notifications, Users
access/ # Payload access-control helpers
auth.ts # Auth.js config
payload.config.ts
Each route group has its own root layout: Tailwind is only imported in
(frontend). The admin uses Payload CSS and is not overridden by Tailwind
preflight.
The group is named (payload) because Payload looks for the import map at
app/(payload)/admin/importMap.js. If you rename it, set
admin.importMap.importMapFile in payload.config.ts.
comments| Field | Type | Notes |
|---|---|---|
articleId | text | Article id. Required and indexed. |
articleUrl / articleTitle | text | Optional, for the admin UI. |
authorName / authorEmail | text / email | Email only readable when authenticated. |
author | relationship → site-users | OAuth reader (empty if created manually). |
content | textarea | Max 5000 characters. |
parent / replies | relationship / join | Reply tree. |
status | select | pending (default), approved, rejected, spam. |
Rules: no parent cycles, replies inherit articleId, cascading delete of
replies and related notifications.
site-usersBlog readers (OAuth). Separate from users (admin staff).
Stable key: authKey = <provider>:<id>.
favoritesDenormalized saves (kind: news | apod) so listing does not re-hit
external APIs.
notificationsToday: comment replies (type: reply), with a denormalized payload.
usersBackoffice staff. Native Payload auth, no roles.
| Operation | Anonymous | Authenticated (admin / Local API) |
|---|---|---|
| create | yes → always pending | yes |
| read | approved only, no email | everything |
| update / delete | no | yes |
status cannot be set from the blog: if sent in the POST, it is ignored.
src/auth.ts)AUTH_SECRET)http://localhost:3000/api/auth/callback/google (and /github)site-users document is created the first time identity is needed
(comment, favorite, etc.)cp .env.example .env
docker compose up -d # Mongo on localhost:27017
pnpm install
pnpm dev
| Variable | Purpose |
|---|---|
DATABASE_URL | Mongo connection |
PAYLOAD_SECRET | CMS session token signing (openssl rand -hex 32) |
CORS_ORIGINS | External origins allowed to call the REST API |
CSRF_ORIGINS | Origins that may use the session cookie (must include admin) |
AUTH_SECRET | Auth.js JWT signing |
AUTH_TRUST_HOST | true outside Vercel |
AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRET | Google OAuth |
AUTH_GITHUB_ID / AUTH_GITHUB_SECRET | GitHub OAuth |
NASA_API_KEY | api.nasa.gov key (server) |
NEXT_PUBLIC_NASA_API_KEY | Same key for front calls validated with Zod |
NEXT_PUBLIC_ENVIRONMENT | Front environment (development, etc.) |
| Command | What it does |
|---|---|
pnpm dev | Dev server |
pnpm devsafe | Wipe .next and start again |
pnpm build / pnpm start | Production build and serve |
pnpm generate:types | Regenerate src/payload-types.ts |
pnpm generate:importmap | Regenerate the admin import map |
pnpm lint / pnpm lint:fix | ESLint |
pnpm format / pnpm format:check | Prettier |
pnpm payload | Payload CLI |
pnpm chromatic | Build and publish Storybook to Chromatic |
Tokens and components live in src/shared/design and src/shared/components
(button, card, badge, drawer, carousel, etc.). shadcn is already initialized
(components.json); to add primitives:
npx shadcn@latest add dialog table dropdown-menu
Component primitives, design tokens, and UI building blocks are documented and isolated using Storybook.
pnpm storybook to start the local Storybook server at http://localhost:6006.pnpm storybook
pnpm build-storybook
📚 Storybook Documentation: View Storybook Catalog