An AI-powered academic planning tool for University of Arizona students.
Built with Next.js 14, Google Gemini, and SQLite.
- Paste your unofficial transcript + set your profile
- Gemini reads your transcript, maps completed courses to requirements, checks every prerequisite chain, and builds a semester-by-semester plan to graduation
- Shows risk flags, next-term recommendations, a requirements checklist, and lets you export to CSV
| Feature | How it works |
|---|---|
| Upload PDF Catalog | Drop your university's PDF — Gemini extracts every course (code, title, units, description, prereqs, scheduling) and saves them to the database |
| Add Course Manually | Fill in a form with all course details |
| Course Database | Search, filter, edit ✏️, or delete 🗑️ any course |
| Manage Majors | Overview of all degree programs in the system |
| Interest Advisor Chatbot | Gemini-powered conversational chatbot that learns a student's interests then recommends matched courses with % scores |
- Node.js 18+ — download at https://nodejs.org
- A free Google Gemini API key — get one at https://aistudio.google.com/app/apikey
# Unzip the project
unzip ua-degreeplan-copilot.zip
cd ua-degreeplan-copilot
# Install dependencies (takes ~1 minute)
npm install# Copy the example env file
cp .env.example .env.local
# Open .env.local in any text editor and replace the placeholder:
# GEMINI_API_KEY=your_gemini_api_key_here
# ↑ paste your real key herenode scripts/seed.jsThis adds 25 starter courses (Mathematics BA + Computer Science BS).
You can delete them later and replace with your own catalog.
npm run devOpen http://localhost:3000 — you're live! 🎉
ua-degreeplan-copilot/
├── app/
│ ├── page.tsx ← Complete UI (student + advisor mode)
│ ├── layout.tsx ← Root layout
│ └── api/
│ ├── courses/route.ts ← CRUD for course database
│ ├── plan/route.ts ← Degree plan generation (Gemini)
│ ├── catalog/route.ts ← PDF catalog upload + Gemini parsing
│ └── chat/route.ts ← Interest advisor chatbot (Gemini)
├── lib/
│ ├── db.ts ← SQLite database layer (better-sqlite3)
│ └── gemini.ts ← All Gemini API calls
├── scripts/
│ └── seed.js ← Seed script for starter courses
├── data/
│ └── degreeplan.db ← SQLite database (auto-created)
├── .env.example ← Copy to .env.local and add your key
└── package.json
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/courses |
List all courses |
| POST | /api/courses |
Create a course |
| PUT | /api/courses?id=N |
Update a course |
| DELETE | /api/courses?id=N |
Delete a course |
| POST | /api/plan |
Generate degree plan (calls Gemini) |
| POST | /api/catalog |
Upload catalog PDF → Gemini parses courses |
| POST | /api/chat |
Interest advisor chatbot turn (calls Gemini) |
The SQLite database (data/degreeplan.db) is created automatically.
courses table:
| Column | Type | Notes |
|---|---|---|
| id | INTEGER PK | Auto-increment |
| code | TEXT | e.g. "MATH 355" |
| title | TEXT | e.g. "Linear Algebra" |
| units | INTEGER | Credit hours |
| category | TEXT | Core / Elective / Capstone / Lab |
| major | TEXT | e.g. "Mathematics (BA)" |
| description | TEXT | Used by AI chatbot for matching |
| syllabus | TEXT | URL (optional) |
| prereqs | TEXT | JSON array of course codes |
| offered | TEXT | JSON array: ["Fall","Spring"] |
Option A — Upload a PDF (recommended)
- Go to Advisor mode → Upload PDF Catalog
- Drop your university's catalog PDF
- Gemini automatically extracts all courses and saves them
Option B — Add courses manually
- Go to Advisor mode → Add Course Manually
- Fill in the form for each course
Option C — Edit the seed script
- Open
scripts/seed.js - Add your courses to the
SEEDarray - Run
node scripts/seed.js
Edit app/page.tsx — search for UA and University of Arizona.
CSS variables at the top of the STYLES constant control all colors:
--ua-blue: #0C234B /* Navy — header, buttons */
--ua-red: #AB0520 /* Cardinal — accents */
--ua-copper: #B3781B /* Copper — summer semester */
--ua-sage: #3D6B4F /* Sage — spring semester */Edit lib/gemini.ts — each function is self-contained.
Swap the API call inside generateDegreePlan(), parseCatalogText(), and chatAdvisorTurn().
npm install -g vercel
vercel
# Follow the prompts — add GEMINI_API_KEY as an environment variableNote: Vercel's serverless functions are stateless. For production with persistent data, replace SQLite with a hosted database like Neon (Postgres) or PlanetScale (MySQL).
npm run build
npm startThe SQLite database file (data/degreeplan.db) persists on the server.
| Problem | Fix |
|---|---|
GEMINI_API_KEY is not set |
Make sure .env.local exists and has your key |
No courses in database |
Run node scripts/seed.js or add courses in Advisor mode |
Gemini returned invalid JSON |
Retry — Gemini occasionally has formatting issues. The prompt instructs JSON-only output. |
Cannot find module 'better-sqlite3' |
Run npm install again |
| Page is blank | Check the terminal for errors and make sure you ran npm run dev |
MIT — free to use, modify, and deploy.