🏆 Winner of MLH Challenge “Best Use of DigitalOcean Gradient AI” at codeRED Astra Hackathon
This branches introduces an AI-powered degree planning system that balances course difficulty across semesters using real grade distribution data.
- Deployed using DigitalOcean's Gradient AI infrastructure with the llama3-8b-instruct model
- RESTful API integration with Bearer token authentication
- Automated agent discovery and configuration scripts
The system leverages cougargrades.io's public grade distribution data to:
- Calculate average GPA per course
- Classify course difficulty levels based on historical performance
- Make data-driven decisions about course combinations
Smart Semester-by-Semester Difficulty Balancing The implementation uses a sophisticated balancing algorithm that:
- Targets 15 credits per semester using bin-packing logic
- Automatically resolves prerequisite dependency chains before course placement
- Evaluates each semester's overall difficulty and redistributes courses to prevent overwhelming workloads
- Generates complete 8-semester degree paths from start to graduation
- Node.js/Express backend with rate limiting and security middleware
- 130+ line structured AI prompt engineering that guides the model to consider workload balance, prerequisites, and course categories
- Vanilla JavaScript frontend with real-time plan visualization
- RESTful API design with health checks, major listings, and plan generation
The Innovation Unlike traditional course planners that only check prerequisites, this AI agent considers:
- Historical course difficulty from real grade distributions
- Cognitive load balancing across semesters
- Prerequisites and course sequencing
- Credit hour optimization
The result: Students get personalized degree plans that are not just feasible, but manageable, preventing burnout semesters while maintaining steady graduation progress.
- Node.js 18+ and npm
- Optional: DigitalOcean AI Agent (or any compatible endpoint) and access key
frontend/Static HTML/CSS/JS app served with a tiny Express serverbackend/Node.js/Express API that calls the AI agent and parses responses
Create a .env file inside backend/ (gitignored):
AI_ENDPOINT_URL=<your-ai-endpoint-url>
AI_ACCESS_KEY=<your-access-key>
# Server config
PORT=3001
NODE_ENV=development
# CORS origin for local frontend
FRONTEND_URL=http://localhost:3000
Notes:
- No secrets are committed to the repo; values are read from environment variables.
- You can also set variables in your shell instead of using
.env.
From the project root, install frontend and backend:
cd frontend && npm install
cd ../backend && npm installIn two terminals:
- Frontend (serves
index.htmlat http://localhost:3000)
cd frontend
node server.js- Backend API (runs at http://localhost:3001)
cd backend
npm startThere are two helper scripts in backend/:
configure-ai.jsprompts for your endpoint and writesbackend/.env.find-agent-endpoint.jstries common paths to discover a working "generate/chat" endpoint.
Run one of these from backend/ after setting AI_ACCESS_KEY in your environment:
node configure-ai.js
# or
node find-agent-endpoint.jsWith the backend running:
cd backend
node test-api.js- Keep
AI_ACCESS_KEYonly in environment variables orbackend/.env. - Avoid logging keys. If present, remove any logs that print key prefixes.
- CORS errors: Ensure
FRONTEND_URLmatches the frontend origin and restart backend. - 401 from AI agent: Verify
AI_ACCESS_KEYandAI_ENDPOINT_URL. - Connection errors: The helper scripts can validate and suggest endpoints.