A modern, interactive web application for University of Waterloo students to visualize course dependencies and plan their academic journey with confidence.
- Force-directed graph visualization powered by D3.js and Visx
- Visual representation of course dependencies (prerequisites, corequisites, antirequisites)
- Department filtering with fuzzy search (Fuse.js)
- Smooth animations and transitions with Framer Motion
- Responsive zoom and pan controls
- Comprehensive UW course database
- Advanced search with fuzzy matching
- Detailed course information including:
- Prerequisites, corequisites, and antirequisites
- Course descriptions
- Term offerings
- Department and subject classification
- Drag-and-drop interface for planning terms
- Visual prerequisite validation
- Multi-term planning support
- Save and manage multiple plans
- Position persistence for custom graph layouts
- Secure authentication with Auth0
- User profile management
- Personalized course plans
- Multi-device sync
- Beautiful, responsive design with Tailwind CSS
- Accessible components from Radix UI and Shadcn UI
- Dark mode support (via next-themes)
- Smooth animations and micro-interactions
- Mobile-optimized with floating action buttons
- Framework: Next.js 14 (App Router) with React Server Components
- Language: TypeScript 5.3
- Styling: Tailwind CSS with custom design tokens
- UI Components: Radix UI, Shadcn UI
- Animations: Framer Motion
- State Management: Zustand, TanStack Query (React Query)
- API Layer: tRPC for end-to-end type safety
- Authentication: Auth0 (@auth0/nextjs-auth0)
- Database: Supabase (PostgreSQL)
- ORM: Supabase JS Client
- Graph Rendering: Force Graph, D3.js, Visx
- Search: Fuse.js (fuzzy search)
- Graph Library: Graphology
- PWA: @ducanh2912/next-pwa
- Optimization: Dynamic imports, code splitting, lazy loading
- Linting: ESLint with TypeScript support
- Formatting: Prettier
- Package Manager: npm
- Build Tool: Next.js with Turbopack
Before you begin, ensure you have the following installed:
- Node.js 18+ and npm
- Git for version control
You'll also need accounts for:
git clone https://github.com/yourusername/uwplanit.git
cd uwplanitnpm installCreate a .env.local file in the root directory with the following variables:
# Auth0 Configuration
AUTH0_SECRET= # Generate with: openssl rand -hex 32
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL= # Your Auth0 domain (e.g., https://your-tenant.auth0.com)
AUTH0_CLIENT_ID= # From Auth0 Application Settings
AUTH0_CLIENT_SECRET= # From Auth0 Application Settings
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL= # Your Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY= # Supabase anon/public key
SUPABASE_SERVICE_ROLE_KEY= # Supabase service role key (keep secure!)- Go to the Auth0 Dashboard
- Create a new application (type: Regular Web Application)
- In Application Settings, configure:
- Allowed Callback URLs:
http://localhost:3000/api/auth/callback - Allowed Logout URLs:
http://localhost:3000 - Allowed Web Origins:
http://localhost:3000
- Allowed Callback URLs:
- Copy the
Client ID,Client Secret, andDomainto your.env.local - Generate
AUTH0_SECRET:openssl rand -hex 32
- Go to the Supabase Dashboard
- Create a new project (note down the database password)
- Navigate to Project Settings → API
- Copy the following values:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL - anon public key →
NEXT_PUBLIC_SUPABASE_ANON_KEY - service_role key →
SUPABASE_SERVICE_ROLE_KEY
- Project URL →
Run the database migrations in order using the Supabase SQL Editor:
- Navigate to SQL Editor in your Supabase dashboard
- Execute each migration file in order:
supabase/migrations/0001_create_courses_table.sqlsupabase/migrations/0002_create_users_and_plans.sqlsupabase/migrations/0003_add_coordinates_to_plan_courses.sql
Alternatively, if you have the Supabase CLI installed:
# Link your project
supabase link --project-ref your-project-ref
# Push migrations
supabase db pushIf you want to populate the database with UW course data:
npm run seed:coursesThis will fetch and parse course data from the UW API and insert it into your Supabase database.
npm run devOpen http://localhost:3000 in your browser to see the application.
npm run build
npm startThe application uses the following main tables:
Stores the complete UW course catalog with:
- Course code, name, and description
- Department and subject classification
- Prerequisites, corequisites, and antirequisites
- Terms offered and other metadata
User profiles synced with Auth0:
- Auth0 user ID (external reference)
- User metadata (name, email, etc.)
- Preferences and settings
User-created academic plans:
- Plan name and description
- Active/inactive status
- Creation and modification timestamps
- User ownership
Courses within each plan:
- Course assignments to specific terms/years
- Visual graph coordinates (position_x, position_y)
- Custom notes and metadata
The application uses tRPC for type-safe API communication between client and server.
| Procedure | Type | Parameters | Description |
|---|---|---|---|
getAll |
Query | - | Fetch all courses from database |
getById |
Query | { id: string } |
Fetch a single course by ID |
search |
Query | { query: string } |
Search courses by code or name |
| Procedure | Type | Parameters | Description |
|---|---|---|---|
getProfile |
Query | - | Get current user's profile |
upsertProfile |
Mutation | { name, email, ... } |
Create or update user profile |
updateProfile |
Mutation | { name, ... } |
Update existing profile |
| Procedure | Type | Parameters | Description |
|---|---|---|---|
getAll |
Query | - | Get all plans for current user |
getActive |
Query | - | Get the active plan |
getById |
Query | { id: string } |
Get a specific plan |
create |
Mutation | { name, description } |
Create a new plan |
update |
Mutation | { id, name, ... } |
Update an existing plan |
delete |
Mutation | { id: string } |
Delete a plan |
addCourse |
Mutation | { planId, courseId, term, ... } |
Add a course to a plan |
updateCourse |
Mutation | { id, term, position, ... } |
Update course in plan |
removeCourse |
Mutation | { id: string } |
Remove course from plan |
The application uses a modern design system built with Tailwind CSS and CSS variables for theming:
- Color Palette: Customizable via CSS variables in
globals.css - Components: Built with Radix UI primitives and styled with Tailwind
- Animations: Framer Motion for smooth transitions
- Responsive: Mobile-first approach with breakpoints at 640px, 768px, 1024px, 1280px
- Dark Mode: Built-in support (can be enabled/disabled via next-themes)
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
npm run format |
Format code with Prettier |
npm run seed:courses |
Seed database with course data |
This application is optimized for deployment on Vercel. Follow these steps:
-
Push to GitHub
git add . git commit -m "Ready for production" git push origin main
-
Import to Vercel
- Go to Vercel Dashboard
- Click "Add New" → "Project"
- Select your GitHub repository
- Click "Import"
-
Configure Environment Variables
In the Vercel dashboard, add these environment variables:
Required:
AUTH0_SECRET=<generate with: openssl rand -hex 32> AUTH0_BASE_URL=https://your-domain.vercel.app AUTH0_ISSUER_BASE_URL=<your-auth0-domain> AUTH0_CLIENT_ID=<from-auth0> AUTH0_CLIENT_SECRET=<from-auth0> NEXT_PUBLIC_SUPABASE_URL=<from-supabase> NEXT_PUBLIC_SUPABASE_ANON_KEY=<from-supabase> SUPABASE_URL=<from-supabase> SUPABASE_SERVICE_ROLE_KEY=<from-supabase> -
Update Auth0 Settings
After deployment, update your Auth0 application settings:
- Allowed Callback URLs:
https://your-domain.vercel.app/api/auth/callback - Allowed Logout URLs:
https://your-domain.vercel.app - Allowed Web Origins:
https://your-domain.vercel.app
- Allowed Callback URLs:
-
Deploy!
Click "Deploy" and wait for the build to complete (2-5 minutes).
For a complete step-by-step deployment guide with troubleshooting, see DEPLOYMENT.md.
For a production deployment checklist, see PRODUCTION_CHECKLIST.md.
Copy .env.template to create your .env.local:
cp .env.template .env.localThen fill in your actual values. Never commit .env.local to version control.
The application can be deployed to any platform that supports Next.js:
- Railway
- Netlify
- AWS Amplify
- DigitalOcean App Platform
Make sure to:
- Set all required environment variables
- Configure build command:
npm run build - Configure start command:
npm start - Set Node.js version to 18+
- Configure proper security headers (see
vercel.jsonfor reference)
- Never commit
.env.localor expose sensitive keys - Keep
SUPABASE_SERVICE_ROLE_KEYsecure (server-side only) - Use Auth0's recommended security settings
- Enable Row Level Security (RLS) in Supabase
- Regular dependency updates for security patches
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- University of Waterloo for course data
- Next.js for the incredible framework
- Vercel for hosting and deployment platform
- Tailwind CSS for the utility-first CSS framework
- Radix UI for accessible component primitives
- Shadcn UI for beautiful component designs
- Force Graph for graph visualization
- D3.js for data visualization primitives
- Fuse.js for fuzzy search functionality
- Auth0 for authentication infrastructure
- Supabase for database and backend services
Built for UW students | Star this repo if you find it helpful!