This plan outlines the steps to replace mock data with real-time integrations from Google Calendar, Slack, and Notion for Code University.
Goal: Display real-time class schedules and events for each classroom using Code University Google Workspace.
- Backend: Create a
CalendarServiceintier2-orchestrator. - Auth: Use a Service Account with domain-wide delegation (if possible) or a dedicated user account with read access to room resources.
- Mapping: Map Google Calendar Resource IDs (rooms) to our internal
classroom_id.
- Credentials: Obtain
credentials.jsonfor a Google Cloud Service Account with Calendar API enabled. - Configuration: Create
config/calendar_mapping.jsonto map Room Emails -> Classroom IDs.{ "lab-a@code.berlin": "lab-a", "b-19@code.berlin": "b-19" } - Implementation:
- Install
googleapispackage intier2-orchestrator. - Implement
getEvents(classroomId, timeRange)method. - Normalize events to our
ClassroomEventschema.
- Install
- API: Update
/api/smartcampus/classrooms/:id/eventsendpoint inserver/routes/smartcampus.js.
Goal: Display live "chatter" or activity levels from relevant Slack channels (e.g., #club-chemistry, #help-engineering).
- Backend: Create a
SlackServiceintier2-orchestrator. - Auth: Use a Slack App with a Bot Token (
xoxb-...). - Scopes:
channels:history,groups:history(read-only).
- Setup: Create a Slack App in the Code University workspace.
- Configuration: Map Classroom IDs to Channel IDs.
{ "lab-a": "C12345678", // #lab-a-discussion "cantina": "C87654321" // #random } - Implementation:
- Install
@slack/web-apiintier2-orchestrator. - Implement
getRecentMessages(channelId)andgetActivityLevel(channelId). - Privacy: Do not display raw PII. Analyze sentiment/activity or show anonymized summaries.
- Install
- API: Add
/api/smartcampus/classrooms/:id/activityendpoint.
Goal: Show current assignments, materials, or course context from Notion pages used for course management.
- Backend: Create
NotionServiceintier2-orchestrator. - Auth: Notion Integration Token (
secret_...). - Context: Map "Courses" or "Rooms" to Notion Database IDs or Page IDs.
- Setup: Create an internal integration in Notion workspace.
- Configuration: Map Classroom IDs or Course Codes to Notion Database IDs.
{ "CS101": "database_id_123", "lab-a": "page_id_456" } - Implementation:
- Install
@notionhq/clientintier2-orchestrator. - Implement
getCourseContext(courseId)orgetRoomPage(roomId). - Retrieve "Active Assignments" or "Recent Materials" properties.
- Install
- API: Add
/api/smartcampus/classrooms/:id/contextendpoint.
We will centralize these integrations in tier2-orchestrator.
GET /api/smartcampus/integrations/calendar/:roomIdGET /api/smartcampus/integrations/slack/:roomIdGET /api/smartcampus/integrations/notion/:roomId
- Frontend requests
ClassroomPage. - Frontend calls
fetchEvents,fetchActivity,fetchContext. - Backend proxies these calls to respective services, caches results for performance (e.g., 5-minute cache), and returns normalized JSON.
- Credentials Required:
- Google: Service Account
credentials.json(or Client ID/Secret). - Slack: Bot User OAuth Token (
xoxb-...). - Notion: Internal Integration Token (
secret_...).
- Google: Service Account
- Approval: Approve this plan to begin implementation of the backend services.