Skip to content

Latest commit

 

History

History
389 lines (356 loc) · 19.2 KB

File metadata and controls

389 lines (356 loc) · 19.2 KB

SciWeb 3.0 Firebase Database Schema

This document outlines the collections, fields, and data types used in the SciWeb 3.0 Firebase database.

Collections

Members

Stores user account information.

Field Type Description
first_name String User's first name
last_name String User's last name
email String User's email address (unique)
username String Optional username
password String User's password (should be hashed)
grade String User's academic grade level
verification_code String Email verification code
profilePicUrl String URL to user's profile picture
createdAt Timestamp Account creation timestamp
updatedAt Timestamp Last account update timestamp
userType String Type of user (e.g., "student", "teacher", "admin")
bio String User's bio or self-description
settings Object User preferences and settings
settings.privacy Object Privacy settings
settings.privacy.profileVisibility String Who can see profile ("private", "friends", "everyone")
settings.privacy.webVisibility String Who can see knowledge web ("private", "friends", "everyone")
settings.privacy.classesVisibility String Who can see classes ("private", "friends", "everyone")
settings.privacy.motivationsVisibility String Who can see motivations ("private", "friends", "everyone")
settings.privacy.friendsVisibility String Who can see friends list ("private", "friends", "everyone")
settings.appearance Object UI appearance preferences
settings.appearance.theme String UI theme preference ("light", "dark", "system")
settings.appearance.colorAccent String UI color accent ("pink", "blue", "purple", "green", "orange")
classes Array Array of user's classes
classes[].id String Unique class identifier
classes[].name String Class name
classes[].teacher String Teacher name
classes[].period String Class period
classes[].createdAt Timestamp When class was added
classes[].updatedAt Timestamp When class was last updated
friends Array Array of friend user IDs (references to Members)
friendRequests Object Friend request management
friendRequests.incoming Array Incoming friend requests
friendRequests.incoming[].userId String User ID of requester
friendRequests.incoming[].requestedAt Timestamp When request was sent
friendRequests.outgoing Array Outgoing friend requests
friendRequests.outgoing[].userId String User ID of recipient
friendRequests.outgoing[].requestedAt Timestamp When request was sent

Trees

Stores user's tree data including nodes and connections.

Field Type Description
userId String Reference to Members collection
nodes Array Array of node objects
nodes[].id String Unique node identifier
nodes[].type String Node type (motivator, task, challenge, etc.)
nodes[].title String Node title/name
nodes[].position Object Node position on canvas
nodes[].position.x Number X coordinate
nodes[].position.y Number Y coordinate
nodes[].dueDate Timestamp Optional due date for task-like nodes
nodes[].content String Optional content (e.g., image URL, file code, etc.)
nodes[].otherData Array Optional other data (e.g., counselor pic, conversation, etc.)
edges Array Array of edge objects connecting nodes
edges[].from String Source node ID
edges[].to String Target node ID
createdAt Timestamp Tree creation timestamp
updatedAt Timestamp Last tree update timestamp
nodeTypes Array Array of node type objects
nodeTypes[].id String Unique node type identifier
nodeTypes[].name String Node type name
nodeTypes[].description String Node type description
nodeTypes[].color String Node type color
nodeTypes[].icon String Node type icon
nodeTypes[].features Array AI prompts for node features
nodeTypes[].features[].name String Feature name
nodeTypes[].features[].description String Feature description
nodeTypes[].features[].icon String Feature icon
nodeTypes[].features[].color String Feature color
nodeTypes[].features[].prompt String AI prompt for feature

FriendConnections

Stores friend relationships between users.

Field Type Description
user1Id String First user ID (reference to Members)
user2Id String Second user ID (reference to Members)
status String Relationship status ("friends", "pending", "blocked")
requestedBy String ID of user who initiated the request
requestedAt Timestamp When the friendship was requested
acceptedAt Timestamp When the friendship was accepted
updatedAt Timestamp Last update timestamp

Classes

Stores information about classes, their members, channels, and units.

Field Type Description
id String Unique class identifier
name String Class name
description String Class description
teacherId String Reference to teacher in Members collection
teacherName String Name of the teacher
teacherEmail String Email of the teacher
teacherProfilePic String URL to teacher's profile picture
teacherOfficeHours Array Teacher's office hours
period String Class period
yearGroup String Academic year group
subject String Subject area
studentCount Number Number of students in the class
createdAt Timestamp Class creation timestamp
updatedAt Timestamp Last class update timestamp
syllabus String Class syllabus text
syllabusFileUrl String URL to syllabus file
members Array Array of class members
members[].userId String User ID (reference to Members)
members[].role String Role in class ("teacher", "student", "ta", "observer")
members[].joinedAt Timestamp When user joined the class
members[].status String Status in class ("active", "inactive", "banned")
channels Array Array of communication channels
channels[].id String Unique channel identifier
channels[].name String Channel name
channels[].description String Channel description
channels[].type String Channel type ("announcement", "general", "help", "group")
channels[].createdAt Timestamp Channel creation timestamp
channels[].createdBy String User ID of channel creator
channels[].isPrivate Boolean Whether channel is private
channels[].allowedMembers Array User IDs with access (if private)
units Array Course curriculum units
units[].id String Unique unit identifier
units[].title String Unit title
units[].description String Unit description
units[].position Number Order in curriculum
units[].status String Unit status ("draft", "active", "archived")
units[].startDate Timestamp Unit start date
units[].endDate Timestamp Unit end date
units[].progress Number Progress percentage for the unit
units[].topics Array Topics covered in the unit
units[].current_topic String Current topic being covered
units[].associatedFiles Array References to ClassFiles collection
units[].associatedProblems Array References to Problems collection
settings Object Class settings
settings.joinCode String Code for students to join class
settings.visibility String Class visibility ("public", "school", "private")
settings.gradingSystem Object Class grading system configuration
recentActivities Array Recent class activities
recentActivities[].id String Unique activity identifier
recentActivities[].text String Activity description
recentActivities[].time String Human-readable time (e.g., "2 hours ago")
recentActivities[].timestamp Timestamp Actual timestamp of activity
recentActivities[].icon String Icon class (e.g., "fas fa-flask")
recentActivities[].type String Activity type (e.g., "grade", "resource", "assignment")
recentActivities[].userId String User ID who performed the activity
stats Object Class statistics
stats.assignments Number Total number of assignments
stats.resources Number Total number of resources
stats.discussions Number Total number of discussion messages
stats.average_grade String Average class grade

ClassFiles

Stores files associated with classes like practice tests, worksheets, and study guides.

Field Type Description
id String Unique file identifier
classId String Reference to Classes collection
unitId String Reference to specific unit (optional)
title String File title
description String File description
type String File type ("worksheet", "study_guide", "practice_test", "lecture_note", "mindweb")
fileUrl String URL to stored file
fileType String File extension/MIME type
fileSize Number File size in bytes
uploadedBy String User ID who uploaded (reference to Members)
uploadedAt Timestamp Upload timestamp
updatedAt Timestamp Last update timestamp
numProblems Number Number of problems (for worksheets/tests)
tags Array Categorization tags
visibility String Who can see the file ("class", "unit", "group", "individual")
allowedUsers Array Users with access (if restricted)
views Number View count
downloads Number Download count
thumbnail String URL to thumbnail image
duration String Duration for video resources
date_added String Human-readable date added

Assignments

Stores information about class assignments.

Field Type Description
id String Unique assignment identifier
classId String Reference to Classes collection
unitId String Reference to specific unit (optional)
title String Assignment title
description String Assignment description
type String Assignment type ("problem_set", "essay", "project", "exam", "quiz", "homework", "analysis", "paper")
fileUrl String URL to assignment file (if applicable)
createdBy String User ID who created (reference to Members)
createdAt Timestamp Creation timestamp
dueDate Timestamp Assignment due date
due_date String Human-readable due date
time_left String Human-readable time left (e.g., "5 days left")
points Number Total possible points
weight Number Assignment weight in grading
status String Assignment status ("not_started", "in_progress", "completed", "late", "graded")
visibleToStudents Boolean Whether assignment is visible to students
associatedFiles Array References to ClassFiles collection
resources Array Resources related to the assignment
allowed_formats String Allowed file formats for submission
time_limit String Time limit for timed assignments
submissions Object Student submission tracking
submissions.count Number Number of submissions received
submissions.graded Number Number of graded submissions
submissions.average Number Average score

Events

Stores information about class events such as review sessions, study groups, etc.

Field Type Description
id String Unique event identifier
classId String Reference to Classes collection
title String Event title
description String Event description
type String Event type ("lab", "quiz", "exam", "review", "study_group", "lecture")
location String Event location
date String Human-readable date (e.g., "Tomorrow", "Friday")
time String Event time (e.g., "2:30 PM - 4:00 PM")
startDate Timestamp Event start date and time
endDate Timestamp Event end date and time
createdBy String User ID who created (reference to Members)
createdAt Timestamp Creation timestamp
updatedAt Timestamp Last update timestamp
hostId String User ID of event host (reference to Members)
recurring Boolean Whether event is recurring
recurrencePattern String Pattern of recurrence (if applicable)
attendees Array Array of event attendees
attendees[].userId String User ID (reference to Members)
attendees[].status String Attendance status ("going", "maybe", "declined")
attendees[].responseTime Timestamp When response was recorded
reminderSent Boolean Whether reminders were sent
attachments Array References to ClassFiles collection
icon String Event icon (emoji or icon code)
color String Event color (hex or color name)

Problems

Stores information about academic problems for practice and assessment.

Field Type Description
id String Unique problem identifier
classId String Reference to Classes collection
unitId String Reference to specific unit (optional)
fileId String Reference to ClassFiles collection (if part of a file)
title String Problem title
content String Problem content/question
type String Problem type ("conceptual", "computational", "application")
difficulty String Problem difficulty ("basic", "intermediate", "advanced")
skill String Skill being assessed
source String Source of the problem
solution String Problem solution (hidden from students)
hints Array Progressive hints for solving
createdBy String User ID who created (reference to Members)
createdAt Timestamp Creation timestamp
points Number Points value
tags Array Categorization tags
imageUrls Array URLs to problem images (if any)
isPublic Boolean Whether problem is publicly available

Messages

Stores chat messages for class channels.

Field Type Description
id String Unique message identifier
classId String Reference to Classes collection
channelId String Reference to channel in Classes.channels
senderId String User ID of sender (reference to Members)
senderName String Name of the sender
senderProfilePic String URL to sender's profile picture
content String Message text content
sentAt Timestamp Message sent timestamp
time String Human-readable time (e.g., "2:30 PM")
date String Human-readable date (e.g., "Today", "Yesterday")
edited Boolean Whether message was edited
editedAt Timestamp Last edit timestamp
attachments Array Message attachments
attachments[].type String Attachment type ("file", "image", "link")
attachments[].url String URL to attachment
attachments[].name String Display name of attachment
attachments[].fileType String File type (if applicable)
attachments[].fileSize Number File size in bytes (if applicable)
reactions Array Message reactions
reactions[].emoji String Reaction emoji
reactions[].count Number Count of this reaction
reactions[].users Array User IDs who reacted (reference to Members)
replyTo String ID of message being replied to (if applicable)
threadId String Thread identifier (for threaded conversations)
isThreadParent Boolean Whether message is a thread parent
readBy Array User IDs who have read the message
mentions Array User IDs mentioned in message

Resources

Stores educational resources for classes.

Field Type Description
id String Unique resource identifier
classId String Reference to Classes collection
unitId String Reference to specific unit (optional)
title String Resource title
description String Resource description
type String Resource type ("slides", "videos", "handouts", "readings", "practice")
fileUrl String URL to resource file (if applicable)
file_type String File type (e.g., "PDF")
file_size String Human-readable file size (e.g., "2.4 MB")
date_added String Human-readable date added
duration String Duration for video resources
thumbnail String URL to thumbnail image
createdBy String User ID who created (reference to Members)
createdAt Timestamp Creation timestamp
updatedAt Timestamp Last update timestamp
tags Array Categorization tags
visibility String Who can see the resource
views Number View count
downloads Number Download count

Grades

Stores student grades for assignments.

Field Type Description
id String Unique grade identifier
classId String Reference to Classes collection
assignmentId String Reference to Assignments collection
studentId String Reference to Members collection (student)
score Number Numerical score
possible Number Total possible points
percentage Number Score as percentage
letterGrade String Letter grade (if applicable)
submittedAt Timestamp When assignment was submitted
gradedAt Timestamp When assignment was graded
gradedBy String User ID of grader (reference to Members)
feedback String Feedback comments
status String Status ("submitted", "late", "graded", "missing")
isLate Boolean Whether submission was late
daysLate Number Number of days late (if applicable)
penaltyApplied Number Point deduction for late submission

ClassMindWebs

Stores mind web data for classes.

Field Type Description
id String Unique mind web identifier
classId String Reference to Classes collection
unitId String Reference to specific unit (optional)
title String Mind web title
description String Mind web description
nodes Array Array of node objects
nodes[].id String Unique node identifier
nodes[].label String Node label/name
nodes[].type String Node type
nodes[].description String Node description
nodes[].position Object Position coordinates
nodes[].position.x Number X coordinate
nodes[].position.y Number Y coordinate
edges Array Array of edge objects
edges[].id String Unique edge identifier
edges[].source String Source node ID
edges[].target String Target node ID
edges[].label String Edge label (if any)
createdBy String User ID who created (reference to Members)
createdAt Timestamp Creation timestamp
updatedAt Timestamp Last update timestamp
lastModifiedBy String User ID who last modified
isPublic Boolean Whether mind web is public
collaborators Array User IDs of collaborators