How aaryaman-147/nucleus-society works
Purpose and delivery model
Nucleus Platform is a Next.js web platform for the Nucleus Undergraduate Research Society: public content showcases research domains, events, journal material, team information, and applications; protected administrative surfaces support operations. The App Router is rooted at src/app/layout.js and public landing content begins at src/app/page.js.
Route-level product surfaces
Public routes are implemented as server-oriented App Router pages for about, events, archive, journal, team, application, and legal content. Dynamic content boundaries are represented by event and journal detail routes:
• src/app/events/page.js
• src/app/archive/[eventName]/page.js
• src/app/journal/[slug]/page.js
Route-local loading states, plus src/app/loading.js, indicate streaming/loading UX around content retrieval. Global fallback handling is in src/app/global-error.jsx and src/app/not-found.jsx.
Content management boundary: Sanity
Sanity is the CMS integration and provides structured journal content, image handling, live-content support, and the embedded editorial Studio. Its schema currently centers on journal entries:
• src/sanity/lib/client.js
• src/sanity/schemaTypes/journal.js
• src/app/studio/[[...tool]]/page.js
The Studio route hosts Sanity’s catch-all tool interface within the application, while root Sanity configuration and CLI integration live in sanity.config.js and sanity.cli.js. CMS queries and asset URL generation should remain behind src/sanity/lib/*, rather than leaking into presentation components.
UI composition and shared shell
src/app/layout.js establishes the application-wide shell and global styling (src/app/globals.css). Shared navigation and footer components define cross-route framing:
• src/components/layout/Navbar.jsx
• src/components/layout/Footer.jsx
• src/components/ui/Hero.jsx
Page experiences are composed from a broad UI component layer, including domain storytelling, metrics, event/calendar display, recruitment prompts, and branded motion/loader components. This is a presentation boundary; route pages orchestrate components and content data.
Applications, email, and administration
The application flow is exposed at src/app/apply/page.js; administrative access begins at src/app/admin/page.js and has a dashboard at src/app/admin/dashboard/page.js. An API route sends email using the JSX email template:
• src/app/api/email/route.js
• src/emails/NucleusEmail.jsx
• src/app/admin/dashboard/page.js
This establishes a server-side boundary for outbound application/operational notifications; browser components should not call email providers directly.
Auth/data and request protection
Supabase client initialization is isolated in src/lib/supabase/client.js, likely supporting authentication and/or operational data associated with admin and application workflows. middleware.js is the request interception boundary and is architecturally important for protecting admin paths or managing session-aware routing. The exact access policy should be traced there before changing admin behavior.
Operations, observability, and discoverability
Sentry is integrated across browser, server, and edge execution through:
• src/instrumentation.js
• src/instrumentation-client.js
• sentry.server.config.js
The application also exposes an API monitoring example at src/app/api/sentry-example-api/route.js. SEO/crawler output is generated through src/app/sitemap.js and src/app/robots.js. Runtime is Next.js/React on Node and edge-capable request paths, with Sanity, Supabase, outbound email infrastructure, and Sentry as material external service boundaries.
Main entry points: route.js Email API · app/page.js Public pages · dashboard/page.js Admin and dashboard · client.js Sanity data layer
Components 21
Next.js application
- App shell · Provides global framing and styling.
src/app/layout.js - Public pages · Server-oriented content and informational routes.
src/app/page.js - Events and archive
src/app/events/page.js - Journal detail
src/app/journal/[slug]/page.js - Shared UI · Navigation, footer, hero, and page composition components.
src/components/ui/Hero.jsx - Loading and fallbacks · Streaming loading, not-found, and global error handling.
src/app/loading.js
Content management
- Sanity data layer · Keeps CMS queries and asset URL generation out of presentation.
src/sanity/lib/client.js - Journal schema
src/sanity/schemaTypes/journal.js - Editorial Studio
src/app/studio/[[...tool]]/page.js
Operations
- Application page
src/app/apply/page.js - Admin and dashboard
src/app/admin/dashboard/page.js - Request protection · Session-aware routing and admin access boundary.
middleware.js - Email API · Sends application and operational notifications.
src/app/api/email/route.js - Email template
src/emails/NucleusEmail.jsx - Supabase client
src/lib/supabase/client.js
External services
- Sanity · Structured journal content, images, and live content.
- Supabase
- Email provider
- Sentry
Runtime operations
- Sentry instrumentation
src/instrumentation.js - Crawler metadata
src/app/sitemap.js
Connections 19
- App shell → Public pages: frames
- App shell → Shared UI: uses
- Public pages → Shared UI: composes
- Events and archive → Sanity data layer: retrieves content
- Journal detail → Sanity data layer: retrieves entries
- Sanity data layer → Sanity: queries and resolves assets
- Journal schema → Sanity: defines content model
- Editorial Studio → Sanity: hosts editor
- Loading and fallbacks → Public pages: handles route states
- Request protection → Admin and dashboard: protects access
- Request protection → Supabase client: uses session context
- Admin and dashboard → Supabase client: uses auth/data
- Application page → Email API: submits notification
- Admin and dashboard → Email API: sends operational email
- Email API → Email template: renders
- Email API → Email provider: delivers
- Supabase client → Supabase: connects
- Sentry instrumentation → Sentry: reports telemetry
- Crawler metadata → Public pages: indexes public routes