SlugHub Portal is a Next.js app for UCSC community leaders to manage and publish their organization’s profile, events, and contact info in the SlugHub directory.
- Install dependencies:
npm install-
For local dev, create or update
.env.local(see Environment Variables below). -
Run the dev server:
npm run devOpen http://localhost:3000.
- Node.js (LTS recommended)
- npm (bundled with Node.js)
- An Airtable base with the required tables and fields (see
docs/airtable-config.md) - A Google OAuth client for NextAuth (see Auth Setup)
npm run devStart the dev servernpm run buildBuild for productionnpm run startStart the production servernpm run lintRun ESLint
Create or update .env.local with the following. The app will not work without Airtable and google auth set up.
Required env:
AIRTABLE_API_KEYAirtable API keyAIRTABLE_BASE_IDAirtable base IDGOOGLE_CLIENT_IDGoogle OAuth client idGOOGLE_CLIENT_SECRETGoogle OAuth client secretNEXTAUTH_URLBase URL for NextAuth (ex:http://localhost:3000)NEXTAUTH_SECRETSecret for NextAuth (required in production, recommended in dev)
Email notification env (optional):
RESEND_API_KEYUse Resend APIEMAIL_FROMFrom address for emails
app/Next.js App Router pages and API routeslib/shared utilities (Airtable, auth, permissions, mail)public/static assetsscripts/helper scripts for debugging
Airtable helpers are in lib/airtable.ts with basic caching. API routes found under app/api/.
Auth is handled by NextAuth with Google OAuth. Users are stored in Airtable and assigned a role (leader by default, admin for admin features). Roles are checked in admin routes and pages.
- Create a Google OAuth app in Google Cloud Console.
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google,https://portal.slughub.cc/api/auth/callback/google. - Copy the client ID and client secret into
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. - If your OAuth app is in Testing, add your user emails as test users.
app/page.tsxHome / landingapp/directoryCommunity directoryapp/leader/dashboardLeader dashboardapp/admin/reviewCommunity approvalsapp/admin/accessAccess requests
- This repo uses Next.js App Router.
- If you change Airtable field names, check related API routes in
app/api/.