A modern university course planning application built with Next.js, React, and Neo4j. UniPlans helps students visualize course prerequisites, dependencies, and plan their academic journey with an interactive graph-based interface.
- Node.js 18+
- npm or yarn
- Neo4j database (for backend queries)
- Supabase account (for authentication and data storage)
-
Clone the repository
-
Install dependencies:
npm install
-
Set up environment variables (create
.env.local):NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key NEO4J_URI=your_neo4j_uri NEO4J_USERNAME=your_neo4j_username NEO4J_PASSWORD=your_neo4j_password
npm run devOpen http://localhost:3000 in your browser to view the application.
Next.js App Router pages and layouts:
page.tsx— Home pagelayout.tsx— Root layout wrapperapi/— Backend API routesformattedGraph/— Graph formatting endpointsmodules/— Module information endpointsnormalisedGraph/— Normalized graph endpointssnapshot/— Snapshot management endpointstimetable/— Timetable generation endpoints
explore/— Module exploration interfacefinal-graph/— Final course graph visualizationformatted-graph/— Formatted graph viewernormalised-graph/— Normalized graph viewerplanner/— Main course planner interface
Reusable React components:
layout/— Layout components (Navbar, etc.)placeholders/— Loading placeholder componentsui/— Base UI components (ExpandableText, Tag, ThemeToggle, etc.)
Client-side API service layer that communicates with backend endpoints:
planner/— Planner-related API calls (fetch graphs, modules, timetables)supabase.ts— Supabase client configuration
Database connection and query layer:
neo4j.ts— Neo4j driver initializationgetGraph.ts,getModuleByCode.ts,getModuleRequires.ts— Query functionsQueries.md— Documentation of available Cypher queries
One-time or scheduled utility scripts:
neo4j/— Cypher queries for database operationsscrapers/— Data scrapers (fetches module data from external sources like NUSMods)
Shared utility functions:
graph/— Graph transformation and manipulation utilitiesplanner/— Planner-specific helper functions
Redux state management:
apiSlice.ts— RTK Query API definitionsplannerSlice.ts— Planner statetimetableSlice.ts— Timetable statesidebarSlice.ts— Sidebar UI statethemeSlice.ts— Theme state
Global styling and theme configuration:
globals.css— Global CSSthemes.ts— MUI theme configurationmui.d.ts— MUI type definitions
TypeScript type definitions:
graphTypes.ts— Graph-related typesplannerTypes.ts— Planner data typesneo4jTypes.ts— Neo4j query result typeserrorTypes.ts— Error handling types
Static data files:
moduleData.json— Module informationminiModuleData.json— Compact module datamodulePrereqInfo.json— Prerequisite informationsampleTimetable.json— Sample timetable data
Application constants and configuration values
React context providers:
ThemeProvider.tsx— Theme context setup
npm run dev # Start development server with Turbopack
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint
npm run resetDB # Reset Neo4j databaseThe application uses Neo4j for storing course information and prerequisite relationships. Run the reset script to populate the database:
npm run resetDBThis will execute scripts in src/scripts/neo4j/reset/ to initialize the graph database.
Warning: This command scrapes NUSMods to collect course information. Do not abuse this script as it may violate NUSMods' terms of service.
Supabase is used for authentication and user data persistence. Ensure your environment variables are properly configured.
- Interactive Graph Visualization — Visualize course dependencies and prerequisites
- Course Planning — Plan your academic schedule with drag-and-drop interface
- Timetable Generation — Automatically generate valid course schedules
- Dark Mode Support — Built-in light/dark theme switching
- Responsive Design — Works on desktop and mobile devices
- Framework — Next.js 15 with App Router
- Language — TypeScript
- UI Library — Material-UI (MUI) v7
- State Management — Redux Toolkit with RTK Query
- Database — Neo4j (graph) + Supabase (relational)
- Animations — Framer Motion
- Graph Visualization — Cytoscape.js
- Styling — Emotion (via MUI)
- Testing — Jest