Skip to content

Admin dashboard!!#387

Merged
songmichael11 merged 37 commits intomainfrom
admin-dashboard
Mar 15, 2026
Merged

Admin dashboard!!#387
songmichael11 merged 37 commits intomainfrom
admin-dashboard

Conversation

@gpalmer27
Copy link
Collaborator

@gpalmer27 gpalmer27 commented Mar 10, 2026

Description

Long description:

  • The google auth stuff for cooper (non localhost) is stored on the Sandbox gmail. I logged into that and added a new auth. This is because we want the regular login to restrict to only husky.neu.edu accounts, but we also want an option for admin/coordinators to log in with a different gmail account.

  • This new oauth provider allows users to log in with any gmail account. I also added AUTH_GOOGLE_ADMIN_ID and AUTH_GOOGLE_ADMIN_SECRET to the .env file (ask michael for these values!) and to vercel for both the cooper-auth and cooper deployments

  • If someone tries to log in with a gmail account that isn't already registered as an admin / coordinator, they're redirected back to the landing page and an error message shows up

  • Logging in with husky.neu.edu works as expected, if not registered, they're redirected to the onboarding page

  • The user table in the database now has a role column, and role is of type student, admin, or coordinator. The exact permissions for these roles haven't been fully fleshed out yet, but as of right now, student is what a normal cooper user can do right now and is the default, coordinator (eg. co-op advisor) has view-only access to see reviews but can't see admin dashboard, and admin can see everything. A coordinator and admin both cannot leave reviews on cooper

  • On the admin dashboard page, admin can enter in someone's email and select whether they should be admin or coordinator. The database is propagated with that corresponding info, and that new user can now log into cooper with that gmail account

Changes:

  • all the auth + db stuff i said above
  • hid 'add review' button if the user's role is coordinator or admin
  • hid the 'my reviews' tab on profile page if user's role is coordinator or admin
  • made admin dashboard page only visible to people with admin role
  • added button to landing page for additional login
  • added toast if unauthorized user tries to log in

MICHAEL DB NOTE:

  • Added a ModerationAction table. A ModerationAction is either a Flag or Hide. It has an associated admin user id, an entity id (role, review, or company), a reason (presumably from a set of reasons), a note (text), and a createdAt date (for history logging)
  • Also added some more fields to make admin dashboard development possible (kinda vague but they're not that important)
  • Also added a Developer role for all the cooper devs. Basically the Student + Admin permissions combined into one role

COOPER DEVS: must run pnpm db:migrate and pnpm db:push since there was a schema change here

Tldr:
made different roles and made an ugly version of the admin dashboard

Motivation and Context

Neu coop people want it

How has this been tested?

I've logged in and out a bunch of times and tried with different roles to make sure it works as expected

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Database migration
    • Ran pnpm db:generate and verified generated SQL migration files in packages/db/drizzle

Checklist:

  • My code follows the code style of this project.
  • I have moved the ticket to "In Review"
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@vercel
Copy link

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cooper Ready Ready Preview, Comment Mar 15, 2026 5:52pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
cooper-auth Skipped Skipped Mar 15, 2026 5:52pm
cooper-docs Skipped Skipped Mar 15, 2026 5:52pm

Request Review

@vercel vercel bot temporarily deployed to Preview – cooper-auth March 15, 2026 17:46 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-docs March 15, 2026 17:46 Inactive
Copy link
Collaborator

@tracyyh tracyyh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! just two questions, but great work!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not being used in the code rn right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment on lines -6 to -7
export const runtime = "edge";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what dis

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk lol

Copy link
Collaborator

@songmichael11 songmichael11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :)

@songmichael11 songmichael11 merged commit ed1c0a7 into main Mar 15, 2026
10 checks passed
@songmichael11 songmichael11 deleted the admin-dashboard branch March 15, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants