refactor: organize api_proccesor.js into domain-specific folders
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:
- [x] I have read freeCodeCamp's contribution guidelines.
- [x] My pull request has a descriptive title (not a vague title like
Update index.md)
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.jsremains 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)
components/DetailsDashboard.jscomponents/DetailsDashboardList.jscomponents/dashtable_v2.jspages/dashboard/[id].jspages/dashboard/v2/[id].jspages/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.