Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CampusHelper AI

A polished desktop academic assistant for university students, built with Java Swing and powered by the OpenAI API.

Overview

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.

Features

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

Technologies

  • 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 APIgpt-4o-mini model (configurable)
  • Maven — build and dependency management

Folder Structure

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/

Architecture

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 CardLayout inside DashboardFrame.
  • Prompts are fully encapsulated in PromptBuilder — easy to modify without touching UI code.

Setup

Prerequisites

1. Clone / extract the project

cd CampusHelperAI

2. Set your OpenAI API key

macOS / Linux:

export OPENAI_API_KEY=sk-your-key-here

Windows (Command Prompt):

set OPENAI_API_KEY=sk-your-key-here

Windows (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.

3. (Optional) Change the model

export OPENAI_MODEL=gpt-4o   # default is gpt-4o-mini

Build and Run

Run directly with Maven

mvn compile exec:java -Dexec.mainClass="main.Main"

Build a runnable JAR

mvn package
java -jar target/CampusHelperAI.jar

The maven-assembly-plugin bundles all dependencies into a single fat JAR.

Demo Login Credentials

Field Value
Username demo
Password demo123

Screenshots

(Add screenshots of Login, Dashboard, Chat, Summarizer, MCQ, and Email panels here)

Dependencies

Library Version Purpose
org.json 20231013 Lightweight JSON parsing only

All other functionality uses the Java standard library (Java 17).

Future Improvements

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages