Let’s recreate this page from the original Carleton Central.
In the client, create a new page in client/src/pages
that will display detailed information for a scheduled event. The page should allow users to view data about the scheduled event, including information from both the scheduled events and courses tables.
In the service API, create a new route in service/src/api/routes/scheduledEvents.ts
for retrieving an individual scheduled event via /scheduledEvents/:id
.
Within the ScheduledEvents
service (service/src/services/ScheduledEvent.ts
), add a new method that retrieves a scheduled event and aggregates the necessary data from both the scheduledEvents
and courses
tables.
For performance, use Redis to cache the retrieved data. When a user accesses the page, first check if the data is cached in Redis. If not, retrieve the data from the database and store it in Redis for future requests.
You may need to install Redis.
client/src/pages
that displays detailed information about a scheduled event./scheduledEvents/:id
) is added in service/src/api/routes/scheduledEvents.ts
to fetch an individual scheduled event.ScheduledEvents
service contains a method to retrieve data from both the scheduledEvents
and courses
tables.