This document outlines how to test the new calendar integration that displays study sessions alongside Google Calendar events.
-
Added Study Sessions API Endpoint (
/api/v1/planit/study-sessions)- Fetches study sessions from the database
- Formats them for FullCalendar display
- Includes venue information and proper styling
-
Updated Database Schema
- Added
created_attimestamp tostudy_sessionstable - Updated both individual schema file and main schema file
- Added
-
Updated Study Sessions Model
- Added
created_atfield to the Sequelize model
- Added
-
Updated Home.jsx Calendar Component
- Added study sessions query using React Query
- Combined Google Calendar events with study sessions
- Enhanced event modal to show different information for study sessions vs Google Calendar events
- Added color coding: Blue for study sessions, Green for Google Calendar events
-
Added API Function
- Created
getStudySessions()function infrontend/src/api/groups.js
- Created
-- Run the updated schema to add created_at column
\i backend/schema/16_study_sessions.sql
-- OR update the main schema
\i backend/schema/schema.sql-- Insert sample study sessions for testing
INSERT INTO study_sessions (user_id, title, start_time, end_time, reminder_sent, venue_name, venue_id, created_at) VALUES
('your-user-id-here', 'Calculus Study Group', '2024-01-15 14:00:00', '2024-01-15 16:00:00', false, 'Library Room 101', 1, NOW()),
('your-user-id-here', 'Physics Problem Solving', '2024-01-16 10:00:00', '2024-01-16 12:00:00', false, 'Physics Lab 2', 2, NOW()),
('your-user-id-here', 'Linear Algebra Review', '2024-01-17 15:30:00', '2024-01-17 17:30:00', false, 'Math Building Room 205', 3, NOW());# Test the study sessions endpoint
curl -X GET "http://localhost:3000/api/v1/planit/study-sessions" \
-H "user_id: your-user-id-here"Expected response:
{
"success": true,
"sessions": [
{
"id": 1,
"title": "Calculus Study Group",
"start": "2024-01-15T14:00:00.000Z",
"end": "2024-01-15T16:00:00.000Z",
"location": "Library Room 101",
"color": "#3b82f6",
"extendedProps": {
"type": "study_session",
"venue": "Library Room 101"
}
}
]
}- Start the frontend application
- Navigate to the home page
- Look at the calendar component in the sidebar
- Verify that:
- Study sessions appear as blue dots/events
- Google Calendar events appear as green dots/events
- Clicking on study sessions shows venue information
- Clicking on Google Calendar events shows location information
- Event modal displays correct type and details
- Study Sessions: Should appear as blue events with venue information
- Google Calendar Events: Should appear as green events with location information
- Event Modal: Should show different styling and information based on event type
- Calendar Display: Both study sessions and Google Calendar events appear on the same calendar
- Color Coding:
- Blue (#3b82f6) for study sessions
- Green (#10b981) for Google Calendar events
- Event Details: Clicking events shows appropriate information based on type
- Real-time Updates: Study sessions update when data changes (React Query caching)
- No Study Sessions Appearing: Check if the API endpoint is working and returning data
- Color Issues: Verify the color properties are being set correctly in the API response
- Modal Issues: Check that the event click handler is properly extracting extendedProps
- Database Issues: Ensure the created_at column was added successfully
- Add ability to create study sessions directly from the calendar
- Add different colors for different types of study sessions
- Add filtering options to show/hide different event types
- Add drag-and-drop functionality for rescheduling study sessions