Collaboration Tools
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
Collaboration Tools within ClassMate facilitate team-based interaction, allowing users to organize into teams, share recorded sessions, and interact through comments and annotations. This system extends the core recording functionality by enabling shared access to AI-generated transcripts, summaries, and action items.
The collaboration framework is built on a structured hierarchy of Users, Teams, and Shared Sessions. It enables real-time interaction through the web application while maintaining strict access control via database relationships and API-key management.
Sources: ai_backend/services/collaboration_service.py, PROJECT_STRUCTURE.md, COMPETITIVE_ANALYSIS.md
Team Management and Membership
The system manages collaboration through a formal Team structure. Users can create teams, where the creator is designated as the "owner." Membership is controlled through invitations and specific roles (e.g., owner, admin, member).
Membership Logic
- Team Creation: Users create a team entity linked to their
user_id. - Invitations: Owners or Admins can invite others via email.
- Roles: Access is governed by roles stored in the
TeamMembermodel, ensuring only authorized users can perform administrative actions like inviting new members.
Sources: ai_backend/services/collaboration_service.py:18-87, ai_backend/database/models.py
Team Data Structure
| Component | Description |
|---|---|
| Team | Represents the collective unit (ID, Name, Owner). |
| TeamMember | Junction table mapping Users to Teams with specific roles. |
| Invitation | Temporary object for onboarding users into a team via email. |
Sources: ai_backend/services/collaboration_service.py:18-106
Session Sharing and Access Control
Collaboration is primarily realized through the sharing of lecture or meeting sessions. A session owned by an individual can be shared with an entire team, granting them access based on specific permission sets.
Sharing Flow
The CollaborationService handles the creation of SharedSession records. These records link a Session to a Team and include a JSON-encoded list of permissions.
The diagram above illustrates how a session owner grants access to a team through the CollaborationService.
Sources: ai_backend/services/collaboration_service.py:118-154, ai_backend/database/models.py
Interaction: Comments and Annotations
Shared sessions allow for contextual interaction via two primary mechanisms: Comments and Annotations. These allow team members to discuss specific parts of a transcript or highlight key information.
- Comments: General discussion points linked to a session, optionally tied to a specific timestamp in the audio.
- Annotations: Highlighted sections of text with defined
start_timeandend_timeintervals, classified by type (e.g., "note").
Access Verification Logic
Before adding a comment or annotation, the service performs an access check. It verifies if the user_id is the session owner or if the user is a member of a team that has a SharedSession entry for that specific session.
Sources: ai_backend/services/collaboration_service.py:156-234
Web and Integration Ecosystem
The web application provides the interface for real-time collaboration, utilizing WebSockets for live transcription updates and collaborative viewing. Additionally, the Public API allows third-party tools to interact with these collaborative features using API keys.
WebSocket Interaction Flow
This sequence shows the lifecycle of a collaborative session in the web app, from initial connection to adding interactive content.
Sources: web_app/src/main.js:124-175, ai_backend/api/public_api.py:34-100
API and Security
Collaboration tools are secured through two primary methods:
- Firebase Auth: Used for user identity and individual access.
- API Key Manager: Manages keys for third-party integrations, supporting hashed keys, expiration dates, and permission scopes.
| Parameter | Type | Description |
|---|---|---|
api_key_hash | String | Salted hash of the generated API key. |
permissions | JSON String | List of authorized actions (e.g., "read_sessions"). |
expires_at | DateTime | Validity period of the integration key. |
Sources: ai_backend/api/public_api.py:21-65, ai_backend/database/models.py
Conclusion
Collaboration Tools in ClassMate provide a robust framework for shared learning and meeting management. By integrating team-based permissions with granular interaction features like annotations and comments, the system transforms individual recordings into collective assets. The combination of Python-based backend services and a real-time JavaScript frontend ensures that collaborative data is both secure and immediately accessible to all team members.
Sources: ai_backend/services/collaboration_service.py, web_app/src/main.js