Skip to content

Convex

The backend for AlbertPlus is powered by Convex, a modern, serverless backend platform that provides a real-time database, serverless functions, and built-in authentication. The Convex-related code is located in the packages/server directory.

  • Real-time Database: Convex’s database is reactive by default. When data changes in the backend, the frontend automatically updates without needing any special code for data fetching or state management.
  • Serverless Functions: You can write serverless functions in TypeScript, which can be either queries (for reading data) or mutations (for writing data). These functions are executed on the Convex backend and can be called directly from your frontend code.
  • Authentication: Convex integrates seamlessly with authentication providers like Clerk, allowing you to build secure applications with protected data.
  • Full-stack Type Safety: Convex provides end-to-end type safety. The types for your database schema and serverless functions are automatically generated and can be used in your frontend code, eliminating a common source of bugs.

When you run bun dev, the Convex development server starts up, providing you with a local backend environment. You can use the Convex dashboard to view your data, inspect logs, and manage your backend.

To open the Convex dashboard, run:

Terminal window
bun run dashboard
TableDescription
appConfigsStores key-value pairs for application configuration.
programsContains information about academic programs (majors, minors, etc.).
requirementsDefines the course requirements for each academic program.
coursesA catalog of all available courses.
prerequisitesStores the prerequisite relationships between courses.
courseOfferingsRepresents specific sections of a course offered in a particular term.
userCoursesStores the courses that a user has completed, typically from a degree audit.
userCourseOfferingsLinks users to the specific course offerings they have added to their schedule.
studentsStores student-specific information, linked to a Clerk user ID.
schoolsA list of the different schools within NYU.

The appConfigs table stores various configuration settings that control scraper behavior and term information:

KeyTypeDescription
current_term"spring" | "summer" | "fall" | "j-term"The current academic term
current_yearstringThe current academic year (e.g., "2025")
next_term"spring" | "summer" | "fall" | "j-term"The next academic term
next_yearstringThe next academic year
is_scrape_current"true" | "false"Flag to enable/disable scraping of current term course offerings
is_scrape_next"true" | "false"Flag to enable/disable scraping of next term course offerings