GridTasks is a energy focused task manager simulator. It runs a mock process scheduler that:
- fetches live CO2 intensity data from the UK grid
- calls Gemini for pause/throttle/resume decisions
- applies decisions in a closed loop every 60s
- user can view AI reasoning + trigger metrics in the UI
- React + TypeScript + Vite
- Zustand for centralized "kernel" state
- Tailwind CSS for terminal-style dark UI
- Google Generative AI SDK (
@google/generative-ai)
- Install dependencies:
npm install
- Copy env file and add Gemini key:
cp .env.example .env
- Start dev server:
npm run dev
- Environment Variables
VITE_GEMINI_API_KEY(optional): if missing or invalid, app auto-falls back to heuristic scheduler logic.
npm run dev- run local dev servernpm run build- type-check + production buildnpm run lint- run ESLintnpm run preview- preview production build
The program fetches live CO2 intensity data from the UK grid (https://api.carbonintensity.org.uk/) and calls Gemini with the relavent info (data from UK grid, task priority, and energy requirement). The AI then decides to keep the task running, throttle, or eco-pause appropiatley. The progress bars on the task update every second and shows the percent completion of the task. The user can click on info buttons across the app to view what the statistics mean and the AI's reasoning behind its decisions.