MRHS STEM Magazine is a full-stack publishing platform for student STEM content. It supports article creation, moderation workflows, role-based admin tooling, newsletter and digest email delivery, and podcast/video integration.
- Public magazine browsing for posts and author pages
- Authenticated user dashboard with profile and settings
- Submission pipeline with moderation and approval/rejection flows
- Admin dashboard for:
- Submissions review
- Post management
- User management (including ban/unban)
- SM Pods management and YouTube sync
- Email-based notifications, contact form delivery, and periodic digest sending
- Next.js 16 (App Router)
- React 19 + TypeScript
- Tailwind CSS 4
- Clerk authentication
- Prisma ORM + MongoDB
- Nodemailer for SMTP-based email delivery
- Install dependencies:
npm install-
Create your environment file (
.env) and add required variables. -
Generate Prisma client and push schema:
npm run prisma:generate
npm run prisma:push- Start development:
npm run devApp runs at http://localhost:3000.
The app currently reads these variables in code:
MONGODB_URINEXT_PUBLIC_APP_URL
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYCLERK_WEBHOOK_SECRETNEXT_PUBLIC_CLERK_SIGN_IN_URLNEXT_PUBLIC_CLERK_SIGN_UP_URLNEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URLNEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMECLOUDINARY_API_KEYCLOUDINARY_API_SECRET
SMTP_HOSTSMTP_PORTSMTP_SECURESMTP_USERSMTP_PASSSMTP_FROM_EMAILMODERATOR_EMAILSTEMMAG_CONTACT_EMAIL
CRON_SECRET(digest endpoint protection)YOUTUBE_API_KEY(SM Pods sync)YOUTUBE_CHANNEL_ID(SM Pods sync)
npm run dev- Run local development servernpm run build- Build production bundlenpm run start- Start production servernpm run lint- Run ESLintnpm run format- Run Prettiernpm run prisma:generate- Generate Prisma clientnpm run prisma:push- Push Prisma schema to databasenpm run seed- Seed databasenpm run ngrok- Expose local server via ngrok
USER: can create and manage their own submissionsMODERATOR: can access admin dashboard and review submissions, except their ownADMIN: full admin access, including reviewing their own submissions and role management operations
- Development and production do not automatically sync data.
- Each environment uses the database URI provided at deploy/runtime through
MONGODB_URI. - If you keep a separate
MONGODB_URI_PROD, map it toMONGODB_URIin your production host environment settings.
src/
app/ App routes and API handlers
actions/ Server actions
components/ UI and admin panels
services/ Business logic and integrations
lib/ Shared utilities (Prisma, logger, helpers)
types/ TypeScript types
prisma/
schema.prisma Database schema
seed.ts Seed script
scripts/
utilities and maintenance scripts
This project is licensed under the MIT License.