Skip to content

Conversation

NewtonLC
Copy link

@NewtonLC NewtonLC commented Oct 3, 2025

Co-Authored by @utsab
Co-Authored by: @CarlyAThomas
Co-Authored by: @ZhenyuYu1

Checklist:

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.

    modified:   package.json

We added the session and JWT session tokens resolving authentication for communication between FCC Proxy and FCC Classroom.

    modified:   pages/api/auth/[...nextauth].js

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.

    new file:   util/fcc_proper.js
    new file:   pages/api/[fcc-proxy.js](http://fcc-proxy.js/)

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.

    new file:   scripts/update-challenge-map.mjs
    new file:   util/challengeMapUtils.js
    new file:   data/challengeMap.json

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.

    modified:   util/api_proccesor.js

Finally, we modified the function calls to api_processor that retrieved student data and display it on the dashboards.

    modified:   pages/dashboard/v2/[id].js
    modified:   pages/dashboard/v2/details/[id]/[studentEmail].js

…lity functions

Co-authored-by: Utsab Saha <[email protected]>
Co-authored-by: Carly Thomas <[email protected]>
Co-authored-by: Zhenyu Yu <[email protected]>
@NewtonLC NewtonLC requested a review from a team as a code owner October 3, 2025 20:00
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.

Feature: Integrate with freeCodeCamp Proper's API for getting student dat
1 participant