refactor: organize api_proccesor.js into domain-specific folders#568
Open
CarlyAThomas wants to merge 3 commits intofreeCodeCamp:mainfrom
Open
refactor: organize api_proccesor.js into domain-specific folders#568CarlyAThomas wants to merge 3 commits intofreeCodeCamp:mainfrom
CarlyAThomas wants to merge 3 commits intofreeCodeCamp:mainfrom
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes made:
Checklist:
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
util/api_proccesor.jsremains unchanged for safetyFiles 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
🧪 Testing
📊 Visual Reference
See mermaid.md for an interactive diagram showing all organized folders, files, dependencies, and page imports.