Skip to main content
1

Prerequisites

  • Node.js 18+
  • npm
  • MongoDB Atlas (recommended) or local MongoDB
  • Google Cloud OAuth 2.0 Web client
  • Optional: Redis for multi-instance step locking
2

Clone and install

3

Create environment file

Fill in values from Environment variables. Never commit .env.local.
4

Configure Google OAuth

  1. Open Google Cloud Console.
  2. Create OAuth 2.0 Client IDs → Web application.
  3. Authorized JavaScript origin: http://localhost:3000
  4. Authorized redirect URI: http://localhost:3000/api/auth/callback/google
  5. Copy Client ID and Client Secret into .env.local.
5

Seed an authorized user

Google sign-in rejects any @schools.nyc.gov address that is not already in the users collection.
Update src/scripts/seed-users.js to match the accounts you actually need before running it in production.
6

Start the app

Open http://localhost:3000, then Sign in.
Login screen Caption: Add screenshot showing the Google sign-in card and the @schools.nyc.gov restriction notice.

Verify the stack

Expect currentYear (July–June school year), requiredPlans, and schoolsServed. Super Admins can also open /admin/system after sign-in.
After Mongoose schema changes, restart npm run dev. Next.js can keep a stale model in memory.

Scripts