Skip to content

Multi-calendar management system built with Java, demonstrating MVC architecture, SOLID principles, and 90%+ mutation test coverage

Notifications You must be signed in to change notification settings

ayushvarma7/calendar-management-system

Repository files navigation

Multi-Calendar Management System

A comprehensive calendar application demonstrating advanced software engineering principles, built with Test-Driven Development and SOLID design patterns.

Java JUnit Coverage Build

📖 Read the Design Document → — Deep dive into architecture, design decisions, and trade-offs

📋 Overview

Developed as part of CS5010: Programming Design Paradigm at Northeastern University (Master's program), this project showcases practical application of object-oriented design principles, Gang of Four patterns, and rigorous testing methodology.

Key Features

  • Multi-Calendar System: Create and manage multiple calendars with unique names and IANA timezones (America/New_York, Europe/Paris, Asia/Kolkata, etc.)
  • Event Management: Single events, all-day events (8am-5pm), and recurring event series
  • Recurring Patterns: Events repeat on specific weekdays (MTWRFSU) for N occurrences or until an end date
  • Three-Tier Editing: Edit single event, event and all future occurrences, or entire series
  • Timezone Support: Full timezone conversion when copying events between calendars
  • Cross-Calendar Copy: Copy single events, all events on a date, or events within a date range
  • Import/Export: CSV and iCal (.ical) format support, Google Calendar compatible
  • Multiple Interfaces: Interactive CLI, Headless mode (script files), and Swing GUI
  • 90%+ Test Coverage: Mutation testing with PIT, JUnit 5, JaCoCo branch coverage

🏗️ Architecture

graph TD
    User([User]) --> ViewLayer[View Layer]
    ViewLayer --> InterfaceCalendarView[InterfaceCalendarView]
    InterfaceCalendarView --> AbstractCalendarView[AbstractCalendarView]
    AbstractCalendarView --> ConsoleView[ConsoleView]
    AbstractCalendarView --> CalendarGuiView[CalendarGuiView]
    
    ViewLayer -- CalendarFeatures interface --> ControllerLayer[Controller Layer]
    
    ControllerLayer --> CalendarController[CalendarController]
    CalendarController --> MultiCalendarController[MultiCalendarController]
    ControllerLayer --> GuiController[GuiController]
    ControllerLayer --> CommandParser[CommandParser]
    CommandParser --> ExtendedCommandParser[ExtendedCommandParser]
    
    ControllerLayer --> ModelLayer[Model Layer]
    
    ModelLayer --> CalendarManager[CalendarManager Facade]
    CalendarManager --> CalendarWithTimezone[CalendarWithTimezone]
    CalendarWithTimezone --> Calendar[Calendar]
    Calendar --> Events[Events: Simple/Recurring]
Loading

📁 Project Structure

src/
├── main/java/
│   ├── controller/
│   │   ├── CalendarController.java          # Base CLI controller
│   │   ├── MultiCalendarController.java     # Extended multi-calendar support
│   │   ├── GuiController.java               # GUI controller (implements CalendarFeatures)
│   │   ├── CommandParser.java               # Base command parser
│   │   ├── ExtendedCommandParser.java       # Multi-calendar commands
│   │   └── commands/
│   │       ├── create/                      # CreateEventCommand, CreateSeriesCommand...
│   │       ├── edit/                        # EditEventCommand, EditSeriesCommand...
│   │       ├── copy/                        # CopyEventCommand, CopyEventsCommand...
│   │       ├── query/                       # PrintEventsCommand, ShowStatusCommand...
│   │       └── utility/                     # HelpCommand, ExitCommand, ExportCommand...
│   │
│   ├── model/
│   │   ├── calendar/
│   │   │   ├── Calendar.java                # Core calendar implementation
│   │   │   └── InterfaceCalendar.java       # Calendar contract
│   │   ├── event/
│   │   │   ├── SimpleEvent.java             # Single event (Builder pattern)
│   │   │   ├── RecurringEvent.java          # Recurring event series
│   │   │   ├── InterfaceEvent.java          # Event contract
│   │   │   ├── EventStatus.java             # Public/Private enum
│   │   │   └── RecurringType.java           # Daily/Weekly/Custom enum
│   │   ├── manager/
│   │   │   ├── CalendarManager.java         # Multi-calendar facade
│   │   │   ├── CalendarWithTimezone.java    # Calendar-timezone wrapper
│   │   │   └── IcalendarManager.java        # Manager contract
│   │   ├── params/
│   │   │   ├── EventParams.java             # Parameter object (Builder)
│   │   │   └── RecurringEventParams.java    # Recurring params (Builder)
│   │   └── export/
│   │       ├── IExporter.java               # Export strategy interface
│   │       ├── CsvExporter.java             # CSV export implementation
│   │       └── IcalExporter.java            # iCal export implementation
│   │
│   └── view/
│       ├── InterfaceCalendarView.java       # View contract
│       ├── AbstractCalendarView.java        # Shared view logic
│       ├── ConsoleView.java                 # Interactive CLI view
│       ├── FileView.java                    # Headless file-based view
│       ├── CalendarGuiView.java             # Swing GUI implementation
│       ├── CalendarFeatures.java            # Controller-View decoupling interface
│       └── dialogs/                         # GUI dialog components
│
├── test/java/
│   ├── controller/                          # Controller unit tests
│   ├── model/                               # Model unit tests
│   └── view/                                # View unit tests
│
└── resources/
    └── test files, sample calendars

🖼️ User Interface

Main Application

Full GUI Preview A sleek, professional Swing interface providing a comprehensive overview of your schedule.

Feature Gallery

![Main View](docs/screenshots/gui/calendar-main-view.png)
<!-- slide -->
![Navigation](docs/screenshots/gui/calendar-navigation.png)
<!-- slide -->
![View Events](docs/screenshots/gui/view-events.png)
<!-- slide -->
![General View](docs/screenshots/gui/general-calendar-view.png)

Dialogs & Configuration

![Create Event](docs/screenshots/gui/create-event-dialog.png)
<!-- slide -->
![Recurring Event](docs/screenshots/gui/create-recurring-event.png)
<!-- slide -->
![Recurring (N times)](docs/screenshots/gui/create-recurring-event-for-N-time.png)
<!-- slide -->
![Add Calendar](docs/screenshots/gui/add-new-calendar.png)
<!-- slide -->
![Event Details](docs/screenshots/gui/event-details.png)

🚀 Getting Started

Prerequisites

  • Java 17 or higher
  • Gradle 7.0+ (or use included Gradle wrapper)

Build

./gradlew build
./gradlew jar

Run

GUI Mode (Default)

java -jar build/libs/calendar.jar

Interactive Mode (CLI)

java -jar build/libs/calendar.jar --mode interactive

Headless Mode (Script File)

java -jar build/libs/calendar.jar --mode headless res/commands.txt

📝 Command Reference

Calendar Management

create calendar --name Work --timezone America/New_York
use calendar --name Work
edit calendar --name Work --property timezone Europe/London
edit calendar --name Work --property name Office

Event Operations

Single Events

create event "Team Meeting" from 2025-01-10T14:00 to 2025-01-10T15:00
create event "Conference" on 2025-01-15                    # All-day (8am-5pm)
create event "Private Call" from 2025-01-10T10:00 to 2025-01-10T11:00 status private

Recurring Events

# Repeat MWF for 10 occurrences
create event "Standup" from 2025-01-10T09:00 to 2025-01-10T09:30 repeats MWF for 10 times

# Repeat every Thursday until end date
create event "Weekly Review" from 2025-01-10T16:00 to 2025-01-10T17:00 repeats R until 2025-03-31

Three-Tier Editing

# 1. Edit single event
edit event location "Team Meeting" from 2025-01-10T14:00 to 2025-01-10T15:00 with "Room 201"

# 2. Edit this and all future events in series
edit events location "Standup" from 2025-01-15T09:00 with "Zoom Room A"

# 3. Edit entire series (regardless of date)
edit series status "Standup" from 2025-01-10T09:00 with private

Cross-Calendar Copy (with Timezone Conversion)

# Copy single event
copy event "Team Meeting" on 2025-01-10T14:00 --target Personal to 2025-01-15T10:00

# Copy all events on a specific date
copy events on 2025-01-10 --target Personal to 2025-01-20

# Copy events within a range
copy events between 2025-01-01 and 2025-01-31 --target Backup to 2025-02-01

Query & Display

print events on 2025-01-10
print events from 2025-01-01T00:00 to 2025-01-31T23:59
show status on 2025-01-10T14:30                            # Returns: busy or available

Import/Export

export cal work-calendar.csv                               # CSV format (Google Calendar compatible)
export cal work-calendar.ical                              # iCal format

Weekday Codes

Code Day
M Monday
T Tuesday
W Wednesday
R Thursday
F Friday
S Saturday
U Sunday

🎨 Design Patterns

Pattern Implementation Purpose
MVC Model/View/Controller packages Separation of concerns
Command commands/ package Encapsulate operations, enable undo/redo
Builder EventParams, SimpleEvent, RecurringEvent Complex object construction
Strategy IExporter, CsvExporter, IcalExporter Interchangeable export formats
Facade CalendarManager Simplified multi-calendar interface
Template Method getCurrentCalendar() in CommandParser Allow subclass customization
Factory Command creation in parsers Decouple command instantiation

🔧 SOLID Principles Applied

  • Single Responsibility: Each class has one reason to change (e.g., CsvExporter only handles CSV)
  • Open/Closed: Extended via inheritance (MultiCalendarController extends CalendarController)
  • Liskov Substitution: SimpleEvent and RecurringEvent are interchangeable via InterfaceEvent
  • Interface Segregation: Separate interfaces (InterfaceCalendar, InterfaceEvent, IExporter)
  • Dependency Inversion: Controllers depend on InterfaceCalendarView, not concrete implementations

🧪 Testing

# Run all tests
./gradlew test

# Generate coverage report
./gradlew jacocoTestReport

# Run PIT mutation testing
./gradlew pitest

Coverage Metrics

  • Branch Coverage: 90%+
  • Mutation Coverage: 90%+
  • Test Strength: High (comprehensive edge case testing)

📊 Analytics Dashboard

General Calendar View

The dashboard provides event statistics for any date range:

  • Total events count
  • Events by subject
  • Events by weekday distribution
  • Events by week/month
  • Busiest and least busy days
  • Online vs offline event percentages

🔄 Version History

Part Focus Area
Part 1 Core calendar, single events, basic commands
Part 2 Multi-calendar support, timezone conversions, recurring events
Part 3 GUI implementation with Swing, decoupled MVC
Part 4 Analytics dashboard, code review integration

📚 Documentation

Document Description
DESIGN.md Architecture, patterns, and design rationale
CHANGES.md Evolution across development phases
Class Diagrams UML diagrams showing architecture evolution

UML Architecture Evolution

Part 1: Core Architecture Phase 1: Foundation classes for calendar and event management.

Part 2: Multi-Calendar & Timezones Phase 2: Introduction of CalendarManager facade and timezone conversion logic.

Part 3: GUI & Decoupled MVC Phase 3: Swing UI integration with decoupled Feature interface.

🎯 Learning Outcomes Demonstrated

  • Object-Oriented Design: Inheritance hierarchies, interface contracts, encapsulation
  • Design Patterns: Command, Builder, Strategy, Facade, Template Method
  • SOLID Principles: Practical application in real codebase
  • Test-Driven Development: Tests written before implementation
  • Mutation Testing: Verifying test quality beyond line coverage
  • Refactoring: Evolving architecture while maintaining behavior

👨‍💻 Author

Ayush Varma
MS Computer Science, Northeastern University (Expected May 2027)
GitHub | LinkedIn | Portfolio

📄 License

This project was developed for academic purposes as part of CS5010 at Northeastern University.

About

Multi-calendar management system built with Java, demonstrating MVC architecture, SOLID principles, and 90%+ mutation test coverage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages