Skip to content

Conversation

@NewtonLC
Copy link
Contributor

@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 <utsab@users.noreply.github.com>
Co-authored-by: Carly Thomas <CarlyAThomas@users.noreply.github.com>
Co-authored-by: Zhenyu Yu <ZhenyuYu1@users.noreply.github.com>
@NewtonLC NewtonLC requested a review from a team as a code owner October 3, 2025 20:00
@NewtonLC NewtonLC marked this pull request as draft October 14, 2025 02:24
@NewtonLC
Copy link
Contributor Author

NewtonLC commented Oct 14, 2025

Per Mrugesh's comment:

The integration to FreeCodeCamp from FreeCodeCamp Classroom has been changed. We recently had a meeting with FreeCodeCamp maintainers. The implementation of this integration needs to be changed.

Action items:

  • Due to these changes, we no longer need to store the challenge map to resolve student data. We will be using a designated curriculum server repository, which will be provided at a later date.
  • We need to retrieve another endpoint that sends a single email and retrieves a user id, and store this user id in Classroom's DB.
  • We need to call our endpoints with the users' information(emails, IDs) in the body, as opposed to querying it, since querying doesn't encrypt the information.
  • Change the get-user-data endpoint so that it sends user ID's in a batch, then checks user consent(more info will be provided later) before retrieving the data that we need.
  • Changes to package.json, especially the removal of the engine requirements, should be in a separate PR.

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

3 participants