feat(api): Added integration of FCC proxy, challenge mapping, and utility functions #549
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.
Co-Authored by @utsab
Co-Authored by: @CarlyAThomas
Co-Authored by: @ZhenyuYu1
Checklist:
Update index.md
)Closes #548
We modified package.json to enable Classroom and FreeCodeCamp to run simultaneously on the same machine due to CORS requirements. We moved the development environment port to 3001 and mock data endpoint to 3002 as the FreeCodeCamp backend runs on 3000. We removed the node and npm version requirements, since FreeCodeCamp requires newer versions.
We added the session and JWT session tokens resolving authentication for communication between FCC Proxy and FCC Classroom.
We added a utility function in fcc_proper.js to securely request a student array of email information for a class from FCC Proper with user authentication. The fcc_proper.js provides a helper function that handles session awareness and authentication when requesting student data. It abstracts away the complexity so the rest of the Classroom codebase can simply pass an array of emails and get back the corresponding user data. The fcc-proxy.js file defines a proxy route that forwards those requests to FCC Proper. It ensures authentication tokens are handled securely on the server, avoids CORS issues, and returns the Proper response back to the Classroom frontend. Together, these files allow Classroom dashboards to retrieve and display student progress data without exposing sensitive credentials or duplicating logic.
We then added a script for the developers of FCC Classroom to manually request a challenge map of the FreeCodeCamp curriculum that is used to resolve the student data of their progress IDs to the curriculum IDs which is stored in the data/challengeMap.json file. The utility file added a function to do this resolution through mapping. This endpoint is listed in the package.json file and is already imported and called from the api_proccesor.js file for the dashboard displays.
We then modified the fetchStudentData function in api_proccesor.js to retrieve data from FCC Proper, instead of using the mock data endpoint. It calls challengeMapUtils.js to resolve student data into a usable format for the Classroom and Student pages.
Finally, we modified the function calls to api_processor that retrieved student data and display it on the dashboards.