freeCodeCamp / classroom

BSD 3-Clause "New" or "Revised" License
145 stars 118 forks source link

Visual diagrams needed for database interactions and API responses #466

Closed ngillux closed 8 months ago

ngillux commented 11 months ago

Describe the issue The codebase uses PostgreSQL as well as an ORM (Prisma). There are various files that make use of Next.js SSR and data fetching, many of these files utilize Prisma.

Considering the various occurrences of the Prisma calls, it would be useful to have a visual diagram on how the codebase uses PostgresSQL and Prisma in the logic.

This could be broken up into multiple diagrams (the following is just a suggestion, feel free to make it less/more modular as needed), i.e.:

Additional context A specific example is 'Classroom' table. There is a column called 'fccCertifications'. The data that's stored in this column is captured when a teacher selects certificates from the dropdown menu when creating a class.

The data in fccCertifications then gets used to identify which curriculum data to extract. Take a look at the api_processor.js file to see some of the URLs that data is requested from.

Here is an example diagram: Screenshot 2023-08-24 at 3 03 12 PM

ngillux commented 11 months ago

Screenshot 2023-08-25 at 10 08 43 PM

Here's another diagram example, might have to zoom in a bit - also I didn't finish the descriptions but I can clarify the diagram/add an updated image in the next few days.

ngillux commented 11 months ago

Screenshot 2023-08-28 at 2 40 58 PM

I'm currently working on the re-design for the data processing related to the dashboard and made this diagram - sharing in case it may be helpful for this issue.