A polished desktop academic assistant for university students, built with Java Swing and powered by the OpenAI API.
CampusHelper AI is an OOP course project that demonstrates clean Java architecture, Swing UI design, and real-world AI integration. Students can use it to get academic help, summarize notes, generate MCQs, and draft formal emails — all from a single desktop application.
| Module | Description |
|---|---|
| AI Chat Assistant | Ask any academic question and get a clear, concise answer |
| Notes Summarizer | Paste lecture notes and get a bullet-point exam summary |
| MCQ Generator | Enter a topic and generate formatted multiple-choice questions |
| Email Draft Writer | Describe your need and get a formal student-to-teacher email |
- Java 17 — core language
- Java Swing — desktop UI (no JavaFX)
- Java HttpClient — built-in HTTP for API calls (no external HTTP library)
- org.json — lightweight JSON parsing (single dependency)
- OpenAI API —
gpt-4o-minimodel (configurable) - Maven — build and dependency management
CampusHelperAI/
├── pom.xml
├── .env.example
├── README.md
└── src/
└── main/
├── java/
│ ├── main/
│ │ └── Main.java # Entry point
│ ├── ui/
│ │ ├── LoginFrame.java # Login screen
│ │ ├── DashboardFrame.java # Main dashboard with CardLayout
│ │ ├── SidebarPanel.java # Left navigation sidebar
│ │ ├── HeaderPanel.java # Top header bar
│ │ ├── ChatPanel.java # AI Chat feature panel
│ │ ├── SummaryPanel.java # Notes Summarizer panel
│ │ ├── McqPanel.java # MCQ Generator panel
│ │ └── EmailPanel.java # Email Draft Writer panel
│ ├── service/
│ │ ├── AIService.java # OpenAI API integration
│ │ ├── PromptBuilder.java # Builds all AI prompts
│ │ └── ConfigService.java # Reads API key and model config
│ ├── model/
│ │ └── User.java # Login user model
│ └── util/
│ ├── Theme.java # Shared colors, fonts, dimensions
│ └── UIHelper.java # Reusable styled component factory
└── resources/
UI Layer (ui.*)
│ handles events, delegates to service layer
▼
Service Layer (service.*)
│ AIService calls OpenAI, PromptBuilder builds prompts
▼
Config / Model (service.ConfigService, model.User)
│ reads environment, holds data
▼
Utilities (util.Theme, util.UIHelper)
shared styling, no business logic
- All API calls run on background threads via
SwingWorker— the UI never freezes. - Panel switching uses
CardLayoutinsideDashboardFrame. - Prompts are fully encapsulated in
PromptBuilder— easy to modify without touching UI code.
- Java 17+
- Maven 3.8+
- An OpenAI API key (get one here)
cd CampusHelperAImacOS / Linux:
export OPENAI_API_KEY=sk-your-key-hereWindows (Command Prompt):
set OPENAI_API_KEY=sk-your-key-hereWindows (PowerShell):
$env:OPENAI_API_KEY = "sk-your-key-here"The key is read at runtime from the environment variable. Never hard-code it in source files.
export OPENAI_MODEL=gpt-4o # default is gpt-4o-minimvn compile exec:java -Dexec.mainClass="main.Main"mvn package
java -jar target/CampusHelperAI.jarThe maven-assembly-plugin bundles all dependencies into a single fat JAR.
| Field | Value |
|---|---|
| Username | demo |
| Password | demo123 |
(Add screenshots of Login, Dashboard, Chat, Summarizer, MCQ, and Email panels here)
| Library | Version | Purpose |
|---|---|---|
| org.json | 20231013 | Lightweight JSON parsing only |
All other functionality uses the Java standard library (Java 17).
- Save and export chat history or summaries as
.txt - Dark mode toggle
- Multiple user accounts with persistent preferences
- Copy-to-clipboard button on all output areas
- Keyboard shortcuts for each module