Skip to content

Conversation

@CarlyAThomas
Copy link
Contributor

@CarlyAThomas CarlyAThomas commented Dec 7, 2025

Changes made:

  • Split monolithic 419-line api_proccesor.js into 14 organized files
  • Created domain folders: curriculum/, dashboard/, student/, legacy/
  • One function per file for better discoverability and maintainability
  • Updated imports in 6 files (components and pages)
  • No logic changes - pure organizational refactor
  • Original api_proccesor.js preserved for safety
  • Added visual documentation (mermaid.md) and refactor summary

Checklist:

There is not an associated issue for this PR.

Overview

Reorganized the monolithic util/api_proccesor.js (419 lines) into a clean, domain-specific folder structure with one function per file.

This is a pure refactor - no logic changes, only organizational improvements for better maintainability.

📁 New Structure

util/
├── curriculum/ # Curriculum metadata & fetching (4 files)
├── dashboard/ # Dashboard data transformation (2 files)
├── student/ # Student progress & data (5 files)
└── legacy/ # Deprecated v9-incompatible functions (3 files)

Total: 14 new organized files from 16 functions in the original monolithic file

See the mermaid diagram for a visual overview of the complete structure, dependencies, and imports.

✅ Changes Made

  • Preserved: Original util/api_proccesor.js remains unchanged for safety
  • Created: Domain-specific folders with one function per file
  • Updated: Import statements in 6 files (components and pages)
  • Added: Documentation (REFACTOR_SUMMARY.md, mermaid.md)

Files Modified (Import Changes Only)

  1. components/DetailsDashboard.js
  2. components/DetailsDashboardList.js
  3. components/dashtable_v2.js
  4. pages/dashboard/[id].js
  5. pages/dashboard/v2/[id].js
  6. pages/dashboard/v2/details/[id]/[studentEmail].js

🎯 Benefits

  • Easy to Find: Go directly to the file you need instead of searching 419 lines
  • Clear Organization: Related functions grouped by domain
  • Better Maintainability: One function per file = easier to understand and modify
  • No Breaking Changes: Only import paths changed, all logic preserved

🧪 Testing

  • ✅ ESLint: No errors
  • ✅ Prettier: All files formatted
  • ✅ Import Resolution: All imports validated
  • ✅ No logic changes - pure organizational refactor

📊 Visual Reference

See mermaid.md for an interactive diagram showing all organized folders, files, dependencies, and page imports.

- Split monolithic 419-line api_proccesor.js into 14 organized files
- Created domain folders: curriculum/, dashboard/, student/, legacy/
- One function per file for better discoverability and maintainability
- Updated imports in 6 files (components and pages)
- No logic changes - pure organizational refactor
- Original api_proccesor.js preserved for safety
- Added visual documentation (mermaid.md) and refactor summary
@CarlyAThomas CarlyAThomas requested a review from a team as a code owner December 7, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant