Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6df3c68
Merge pull request #70 from oss-slu/dev_devayani
LuisPalmejar21 Oct 11, 2025
e667f69
Documented all .html files located in the /web/ folder to explain the…
LuisPalmejar21 Oct 12, 2025
9fcf656
Added docs
joeljoby02 Oct 12, 2025
016aafe
Update about.md
Devayani1612 Oct 14, 2025
74fb6c7
Update about.md
Devayani1612 Oct 14, 2025
508a35c
Merge pull request #71 from oss-slu/dev_luis
Devayani1612 Oct 14, 2025
0ce97a8
Docusaurus integration
joeljoby02 Oct 18, 2025
23ad4b4
Added node version
joeljoby02 Oct 18, 2025
74f5916
Updated my repository content based on Devayani's feedback for Sprint 3.
LuisPalmejar21 Oct 19, 2025
557dc78
Merge branch 'dev_luis' of https://github.com/oss-slu/rerum-playgroun…
LuisPalmejar21 Oct 19, 2025
a06fbd1
Merge pull request #73 from oss-slu/dev_luis
Devayani1612 Oct 21, 2025
4017a6c
Added docs for json-utils.js and json-utils.test.js
joeljoby02 Oct 24, 2025
9934ede
Merge pull request #72 from oss-slu/dev_joel
Devayani1612 Oct 27, 2025
86e4794
Updated readme.md
joeljoby02 Oct 29, 2025
c7c027b
Renamed sandbox and tools documentation files to sandbox-html.md and …
LuisPalmejar21 Oct 30, 2025
a64df0e
Merge pull request #77 from oss-slu/dev_joel
Devayani1612 Oct 30, 2025
cbab18f
Copied sandbox-html.md and tools-html.md from dev_luis branch
Devayani1612 Oct 30, 2025
583df85
Moved fetch functions to objectService.js
joeljoby02 Nov 5, 2025
021e699
Reverted HTTP error messages
joeljoby02 Nov 5, 2025
c76a5d0
Refactored JavaScript files in rerum-playground/web by moving DOM rel…
LuisPalmejar21 Nov 6, 2025
ecb9abe
Worked on issue #90
joeljoby02 Nov 6, 2025
b9e0d9d
Move new file to utils folder
joeljoby02 Nov 6, 2025
03175d3
Worked on issue #92
joeljoby02 Nov 6, 2025
1ffcc12
Merge pull request #94 from oss-slu/dev_joel
Devayani1612 Nov 12, 2025
6f3c476
Made some refactoring. Based on Devayani's feedback on my recent pull…
LuisPalmejar21 Nov 15, 2025
e014891
Updated CONTRIBUTING.md based on new architecture rules.
LuisPalmejar21 Nov 24, 2025
b46db4f
Updated CONTRIBUTING.md to include a short guide on how to add a new …
LuisPalmejar21 Dec 1, 2025
57a7f18
Resolved merge conflicts for PR #103 (Issues #89, #91, #93)
Devayani1612 Dec 2, 2025
c3fb656
Add technical architecture refactor blog post
Devayani1612 Dec 3, 2025
5eeb929
WIP: local changes before pull
Devayani1612 Dec 3, 2025
5330611
Added refactor blog post
Devayani1612 Dec 3, 2025
ed7b010
Added refactor blog post
Devayani1612 Dec 3, 2025
a703bfd
Updated
Devayani1612 Jan 11, 2026
c95bb3e
Fix menu and footer loading using layout service
Devayani1612 Jan 11, 2026
f159982
ISSUE 114 API DOCUMENTATION
akearney6 Jan 30, 2026
86b81a1
Fix broken script references in index.html and about.html
teamomiamigo Feb 3, 2026
2db2fcd
Define requirements for annotation text search functionality
teamomiamigo Feb 3, 2026
e221c15
Cleanup API documentation by removing redundant sections
Devayani1612 Feb 9, 2026
951af3f
Merge pull request #119 from oss-slu/akearney6_issue114
Devayani1612 Feb 9, 2026
8fa16ad
Revise search requirements and API endpoint details
Devayani1612 Feb 9, 2026
017d792
Merge branch 'dev_devayani' into 113-define-requirements-for-annotati…
Devayani1612 Feb 9, 2026
969e37b
Merge pull request #117 from oss-slu/113-define-requirements-for-anno…
Devayani1612 Feb 9, 2026
5f9f5bc
Implement RERUM annotation search service with paging and normalization
teamomiamigo Feb 18, 2026
9024f45
update on issue 115 and working on search implementation
teamomiamigo Feb 18, 2026
f3721bb
fixes the search mechanics and error handling
teamomiamigo Feb 23, 2026
6a446f2
Merge pull request #122 from oss-slu/115-implement-annotation-search-…
Devayani1612 Feb 23, 2026
619387a
Integrate annotation search into Sandbox UI and fix module loading
teamomiamigo Mar 1, 2026
370d461
fixing issues from comments
teamomiamigo Mar 5, 2026
3b7d8c6
Merge pull request #126 from oss-slu/124-integrate-annotation-search-…
Devayani1612 Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '22'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTS is node 24 now!


# Step 3: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nbproject/
build.xml
*.properties
*.properties
CLAUDE.md
311 changes: 311 additions & 0 deletions Blog/refactor_architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
# Modernizing the RERUM Playground Architecture
### A Technical Refactor for Sustainable Open Source Development

**Author:** Devayani Chakravarthi Konakalla
**Project:** RERUM Playground
**Published On:** December 2024

## Introduction

The RERUM Playground is a web-based environment built to demonstrate the capabilities of the RERUM API and its ecosystem tools. As the project has grown, new interfaces, metadata tools, and annotation utilities have been added. With this growth, the codebase became harder to navigate and maintain for both SLU student developers and external contributors.

During Sprint 5, I led a core architectural refactor to reorganize the Playground into a clean, layered, and contributor-friendly structure. This blog documents the refactor design, the engineering principles behind it, and how the updated architecture now supports long-term sustainability and onboarding.

# Refactor Objectives

| Goal | Implementation |
|------|---------------|
| Improve maintainability | Folder restructuring & component isolation |
| Separate responsibilities clearly | Services ≠ Features ≠ UI |
| Reduce repeated fetch logic | Centralized service layer |
| Enable future testing | Smaller modules and isolated logic |
| Improve contributor onboarding | Cleaner directory structure & documentation |
| Simplify adding new tools | Standardized architecture pattern |


# Problems Before Refactor

### Architecture Issues Found

- `sandbox.js`, `tools.js`, and `playground.js` contained multiple responsibilities:
- DOM handling
- API calls
- Interface orchestration
- Fetch logic duplicated across files
- Hard to understand how tools were rendered or registered
- No consistent pattern for contributors to add new tools
- Difficult to test or mock RERUM API calls

**Core Issue: Lack of Separation of Concerns**
Logic, UI, utilities, and API operations were not isolated.

# Core Refactor Principles

### Single Responsibility
Each module should do only ONE thing.

### Separation of Concerns
Clear boundary between:
- Fetch/API services
- UI rendering components
- Tool orchestration features
- Utility helpers

### Developer-friendly Architecture
Future contributors should know immediately:
“Where do I write my UI? Where do I call RERUM? How do I register a tool?”

### Sustainability
Architecture must support long-term growth without rewriting core files.


# Before vs. After Structure
## Before

/web/js/
│ playground.js
│ tools.js
│ sandbox.js
│ utilities.js
│ json-utils.js
│ toolsCatalog.js
- API calls scattered everywhere
- UI and network logic mixed together
- No reusable service layer
- Difficult to onboard contributors

## After (Layered Design)

```bash
/web/js/
├── services/ # Network & API logic only
│ └── objectService.js # Centralized CRUD + fetch methods
├── utils/ # Shared helper utilities
│ └── generalUtils.js # logger, broadcast, thumbnailGenerator
├── components/ # UI-only, DOM event handlers & rendering
│ ├── sandboxUI.js # Sandbox page UI logic
│ └── toolsUI.js # Tools page UI logic
├── features/ # Feature orchestration (no UI, no API)
│ ├── playground-feature.js # Root playground bootstrapping
│ ├── sandbox-feature.js # Sandbox initialization & wiring
│ └── tools-feature.js # Tools page initialization & wiring
├── catalog/ # Domain data for tools/interfaces
│ └── toolsCatalog.js # Catalog entries for UI rendering
├── manifest/ # Domain logic for IIIF manifest tool
│ └── manifestStorage.js # Persist and retrieve manifest data
└── config.js # Global config: URLs, constants, events
```

✔ Centralized service logic
✔ UI code separate
✔ Feature modules orchestrate functionality
✔ Modular and scalable


# Key Technical Changes

## 1. Centralized API Layer
`services/objectService.js` now contains *all* fetch-based RERUM API calls:

- `create`
- `update`
- `overwrite`
- `deleteObject`
- `query`
- `resolveJSON`
- `resolveString`

**Reason:**
No duplicated fetch logic anywhere in the codebase.

## 2. Shared Utility Library
`utils/generalUtils.js` stores reusable helpers:
- Logging
- Thumbnail generation
- Event broadcasting

**Benefit:** Eliminates redundant helper functions.


## 3. UI Extracted into Components
For example:
- `components/sandboxUI.js`
- `components/toolsUI.js`

UI files now:
- render tool cards
- handle manifest dropdowns
- manage DOM events

## 4. Tool Logic Moved to Feature Modules

`features/tools-feature.js` is the orchestrator responsible for:
- loading tool catalog
- managing recently used tools
- initializing UI rendering
- handling tool click events

This follows:
**Load Feature → Render UI → Call Services**


# Architecture Diagram
```bash

+------------------------+
| HTML Pages |
| index.html, tools.html |
+-----------+------------+
|
v
+------------------------+
| Feature Layer |
| sandbox-feature.js |
| tools-feature.js |
+-----------+------------+
|
v
+------------------------+
| UI Components |
| sandboxUI.js |
| toolsUI.js |
+-----------+------------+
|
v
+------------------------+
| Services Layer |
| objectService.js |
| manifestStorage.js |
+-----------+------------+
|
v
+------------------------+
| Utilities & Helpers |
| generalUtils.js |
+------------------------+
```

# Outcomes of the Refactor

### Clean system boundaries
UI, feature logic, and services no longer overlap.

### Clarity for contributors
Anyone can locate:
- tool UI
- feature scripts
- API fetch logic

### Testability
Services can be mocked independently.

### Faster onboarding
New developer can learn architecture in one glance.

### Extensibility
Adding tools no longer requires rewriting core files.


# TUTORIAL

## How to Add a New Tool in the Refactored Playground

Below is the official standard onboarding workflow for future contributors.
```bash
#### Step 1: Add tool in tool catalog
{
label: "IIIF Manifest Generator",
icon: "./img/manifest.png",
view: "./iiif-manifest.html",
description: "Generate simple IIIF Manifest Objects"
}

#### Step 2: Create Your UI File
/components/myToolUI.js
export function initMyToolUI() {
document.getElementById("run")
.addEventListener("click", () => {
alert("Tool Triggered");
});
}

#### Step 3: Add Feature File
/features/myTool-feature.js
import { initMyToolUI } from "../components/myToolUI.js";

window.onload = () => {
initMyToolUI();
};

#### Step 4: Reference Feature in HTML
<script type="module" src="./js/features/myTool-feature.js"></script>

#### Step 5: Use RERUM API via Services
import { create } from "../services/objectService.js";

async function storeManifest(obj) {
const result = await create(obj);
console.log("Manifest stored:", result);
}
```
### Evidence of Architectural Work
- Tools for:
- manifest generation
- manifest storage
- recently used tools
- Refactor PRs merged into dev_devayani
- All fetch logic removed from UI
- UI components rewritten into modular files
- New IIIF manifest generator added as an independent tool page

### Contributor Impact
##### Maintainers benefit because:
- code is uniformly structured
- UI bugs isolated to components
- API bugs isolated to service layer
##### Incoming developers benefit because:
- path for new tools is standardized
- architecture is self-explanatory
##### External contributors benefit because:
- catalog entries are transparent
- no need to edit core scripts

### Leadership Reflection
As Tech Lead, I authored the refactor plan, structured implementation via issues, and reviewed PRs using architecture acceptance criteria:
- UI components must not call fetch()
- Services must be reusable
- Tools must register in the catalog
- Feature modules must initialize UI
- Utilities cannot contain business logic

This refactor was also guided by governance principles from Birdaro Training, focusing on:
- clarity
- documentation
- contributor health
- long-term sustainability

The final result is a cleaner codebase that future SLU teams and external developers can confidently build upon.

### Conclusion
This refactor marks a milestone for the RERUM Playground:
- maintainable architecture
- predictable structure
- modular extensibility
- future-proof onboarding

As the Playground grows with IIIF, annotation tools, and data transformation utilities, this architecture ensures that innovation does not require rewriting foundations.

Instead, it empowers:
- reuse
- modularity
- contributor self-sufficiency

This is the foundation upon which the next generation of RERUM ecosystem tools will be built.

32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@ Thank you for considering contributing to **Rerum Playground**! We appreciate yo

---

## Architecture

In the web/js folder path containing JavaScript files, new folder names are categorized by functionality. JavaScript code should be focused on the folder name.

Currently, the folders inside the web/js folder are:

- components
- features
- services
- utils

**Examples**

- In components, JavaScript code should focus on DOM functionality.
- In features, JavaScript code should focus on functionality of features in RERUM Playground.
- In services, JavaScript code should have fetch-related functions.
- In utils, JavaScript code should have utility-related functions.

**Additional Guidelines**

Ensure functions or modules follow the single-responsibility principle. Each function or module should have one main purpose.

There shouldn't be any inline JavaScript code since they are reserved for .html files.

**Adding a new feature page**

1. Create a new html file in the /web/ folder representing a feature.
2. Create a new JavaScript file in the web/js/features/ folder and link it with its respective .html file.
3. Create a .css file in the web/css/ folder and link it with its respective .html file.

---

## Code of Conduct

All contributors are expected to follow the [Code of Conduct](https://github.com/oss-slu/rerum-playground/blob/main/Code_Of_Conduct.md) in all interactions related to this project. Please be respectful and considerate.
Expand Down
Loading
Loading