Skip to content

manavbansal1/StudySage

Repository files navigation

StudySage

StudySage

AI-Powered Study Companion with Real-Time Multiplayer Games

Kotlin Compose Firebase Ktor

Platform License Build


Transform your study experience with AI-powered content processing, collaborative study groups, and competitive multiplayer games.

View Quick Setup →

Overview

StudySage is a comprehensive educational Android application that combines AI-powered content processing, collaborative study groups, and real-time multiplayer games. Built with modern Android technologies and a custom Kotlin/Ktor backend, StudySage creates an engaging, gamified learning environment.

Backend Access: The multiplayer game server runs on a separate Kotlin/Ktor backend maintained in a private repository. The app's core features (notes, courses, groups, flashcards) work without the backend. For full multiplayer game functionality, email [email protected] for backend access.


AI-Powered

Auto-generate summaries, key points, and tags from your study materials using Gemini 1.5 Flash



Collaborative

Real-time study groups with live chat and image sharing



Gamified

Compete in multiplayer games with XP system and leaderboards


Key Features

AI-Powered Note Processing

Upload documents and let Gemini AI extract the important information:

  • Multi-Format Support: PDF, DOCX, TXT, MD, RTF (up to 10MB)
  • Auto-Generation: Summaries, key points, and smart tags
  • Dual Storage: Firebase Storage + Cloudinary CDN
  • Recent Activity: Track most-accessed PDFs with open counts
  • Course Linking: Organize notes by course or standalone
Smart Course Management

Organize your academic life with color-coded courses:

  • Full CRUD: Create, edit, archive, delete
  • Semester System: Spring/Summer/Fall/Winter + Year
  • 12 Color Themes: Visual organization
  • Rich Metadata: Code, instructor, credits, description
  • Archive System: Soft-delete without data loss
Real-Time Study Groups

Collaborate with classmates instantly:

  • Live Chat: <100ms latency with Firestore snapshots
  • Image Sharing: Cloudinary-powered uploads
  • Email Invites: Send and manage invitations
  • Role System: Admin and member permissions
  • Full History: Complete chat with timestamps
Multiplayer Games

Learn while competing in real-time:

Quiz Race

Competitive quiz with speed bonuses

  • Time-limited questions (15-60s)
  • Speed-based scoring formula
  • Real-time leaderboards
  • AI-generated from your notes

Study Tac Toe

Tic-tac-toe meets trivia

  • Answer questions to claim squares
  • Turn-based strategy
  • 3-in-a-row wins
  • Tests knowledge + tactics

Backend: WebSocket-powered (<50ms sync) • Kotlin/Ktor • 6-char room codes • Firebase persistence

Additional Features

AI Podcast Generation:

  • Convert notes to natural-sounding audio with Google Cloud TTS
  • Multiple voice options and languages
  • Playback controls: play, pause, seek, speed adjustment (0.5x - 2.0x)
  • Offline download support for study on-the-go
  • Background playback while using other apps

Flashcard System:

  • Create custom flashcard decks with questions and answers
  • Link flashcards to specific courses or topics
  • Study mode with flip animation and progress tracking
  • Shuffle mode for varied practice
  • Mark difficult cards for focused review

NFC Note Sharing:

  • Share notes instantly by tapping NFC-enabled phones
  • Host Card Emulation (HCE) technology
  • Secure APDU service for encrypted data transfer
  • Works completely offline - no internet required
  • Bidirectional: both send and receive capabilities

Canvas LMS Integration:

  • Import courses directly from Canvas using access token
  • Automatic course sync with Canvas data
  • Pulls course code, title, instructor, and semester information
  • One-click bulk import for all enrolled courses
  • Keeps StudySage courses in sync with Canvas enrollment

XP & Gamification System:

  • Earn experience points for all activities (studying, games, streaks)
  • Level progression formula: XP = Level² × 100
  • Visual level badges and achievements
  • Daily tasks with bonus XP rewards
  • Leaderboards to compete with friends

Daily Streaks & Tracking:

  • Track consecutive days of study activity
  • Visual streak counter with fire icon
  • Streak milestones and rewards
  • Push notifications to maintain streaks
  • Study time tracker with daily goals (30 min default)

Smart Notifications:

  • Daily study reminders via WorkManager (scheduled at 9 AM)
  • Real-time group message notifications via FCM
  • Study group invitation alerts
  • Streak reminder notifications
  • Customizable notification preferences per category

Tech Stack

Frontend

Language:      Kotlin 2.2.21
UI:            Jetpack Compose (BOM 2024.12)
Design:        Material Design 3
Architecture:  MVVM + Clean Architecture
State:         StateFlow + Coroutines
Navigation:    Navigation Compose 2.8.5
Image:         Coil 2.5.0
Network:       Retrofit + OkHttp + WebSocket
Async:         Kotlin Coroutines + Flow

Min SDK: 24 (Android 7.0) • Target SDK: 36

Backend & Cloud

Authentication:  Firebase Auth
Database:        Cloud Firestore (NoSQL)
Storage:         Firebase + Cloudinary CDN
AI:              Gemini 1.5 Flash (Vertex AI)
Game Server:     Kotlin/Ktor 3.3.1 (separate repo*)
Hosting:         Railway / Cloud Run
TTS:             Google Cloud Text-to-Speech
Real-time:       WebSocket + Firestore Snapshots

* Game server is in a private repository. Email [email protected] for access.


Architecture

MVVM + Clean Architecture

┌─────────────────────────────────────────┐
│   UI Layer (Jetpack Compose)            │
│   30+ Screens • Material Design 3       │
└──────────────┬──────────────────────────┘
               │ StateFlow<UiState>
               ▼
┌─────────────────────────────────────────┐
│   ViewModel Layer                       │
│   17 ViewModels • Business Logic        │
│   Threading: ~91 concurrent threads     │
└──────────────┬──────────────────────────┘
               │ suspend functions
               ▼
┌─────────────────────────────────────────┐
│   Repository Layer                      │
│   11 Repos • Single Source of Truth     │
│   Auth • Course • Notes • Game • Group  │
└──────────────┬──────────────────────────┘
               │ Dispatchers.IO
               ▼
┌─────────────────────────────────────────┐
│   External Services                     │
│   Firebase • Cloudinary • Ktor Backend  │
└─────────────────────────────────────────┘

Threading Model

  • Main Thread: UI rendering only
  • IO Dispatcher: Firebase, network calls, file operations
  • Default Dispatcher: Heavy computations, JSON parsing
  • WebSocket Pool: Dedicated threads for real-time games

Total: ~91 concurrent threads for optimal performance

Project Structure

StudySage/
├── app/src/main/java/com/group_7/studysage/
│   ├── data/
│   │   ├── repository/          # 11 Repositories
│   │   ├── api/                 # REST & WebSocket APIs
│   │   ├── model/               # 40+ Data classes
│   │   └── websocket/           # WebSocket manager
│   ├── viewmodels/              # 17 ViewModels
│   ├── ui/
│   │   ├── screens/             # 30+ Composable screens
│   │   ├── components/          # Reusable UI components
│   │   └── theme/               # Purple-gold theme
│   └── utils/                   # Helpers & utilities

Note: The Kotlin/Ktor game server backend is maintained in a separate private repository. To request access for development or deployment, please email [email protected].


Multiplayer Games

Game Architecture

Android App (WebSocket Client)
         │
         │ <50ms latency
         ▼
Ktor Backend (Game Server)*
  • Session management
  • Turn-based logic
  • AI question generation
         │
         │ Persistence
         ▼
Firebase Firestore

* The game server backend is maintained in a separate private repository. Email [email protected] for access.

Quiz Race

Fast-paced competitive quiz where speed matters

Flow:

  1. Host uploads study material → AI generates questions
  2. Players join with 6-char code → WebSocket connections
  3. Questions broadcast simultaneously → Players submit answers
  4. Real-time validation & leaderboard updates

Scoring:

basePoints = 100
speedBonus = (timeLimit - timeElapsed) / 100
totalPoints = basePoints + speedBonus // if correct

WebSocket Messages:

  • NEXT_QUESTION → All players (question data)
  • SUBMIT_ANSWER → Server (answer + timestamp)
  • ANSWER_RESULT → Individual player (points earned)
  • SCORES_UPDATE → All players (leaderboard)

Study Tac Toe

Strategic tic-tac-toe with knowledge checks

Turn Flow:

Player selects square
       ↓
Server sends question
       ↓
Player answers
       ↓
┌─────────┬──────────┐
│ Correct │ Wrong    │
├─────────┼──────────┤
│ Claim   │ Forfeit  │
│ square  │ turn     │
└─────────┴──────────┘
       ↓
Check for win (3-in-a-row)
       ↓
Switch turns

Board State Sync:

// Real-time via WebSocket
BOARD_UPDATE {
  boardState: List  // ["", "X", "O", ...]
  currentTurn: String       // User ID
  lastMove: Int             // Square index
}

TURN_UPDATE {
  currentPlayerId: String
  playerSymbol: String      // "X" or "O"
}

Backend Endpoints:

POST   /api/games/groups/{groupId}/sessions          # Create
GET    /api/games/groups/{groupId}/sessions          # List
POST   /api/games/.../sessions/{id}/join             # Join
POST   /api/games/.../sessions/{id}/start            # Start
WS     /ws/game/{sessionId}                          # Play

Firebase Schema

firestore/
├── users/{userId}
   ├── name, email, bio, profilePicUrl
   ├── xpPoints, level, dailyStreak
   └── recentlyOpenedPdfs: [{noteId, title, lastOpenedAt}]

├── courses/{courseId}
   ├── title, code, semester, year
   └── instructor, credits, color, isArchived

├── notes/{noteId}
   ├── title, content, fileUrl
   ├── summary, tags, keyPoints  # AI-generated
   └── userId, courseId

├── groups/{groupId}
   ├── name, description, profilePic
   ├── members: [{userId, role, joinedAt}]
   └── messages/{messageId}
       └── senderId, message, images, timestamp

└── gameSessions/{sessionId}
    ├── gameType, hostId, status, players
    ├── questions, settings, currentQuestionIndex
    └── boardState, currentTurn  # Study Tac Toe

Design System

Color Palette

// Primary Colors
Purple Primary:   #652497  // Deep rich purple
Purple Secondary: #9333EA  // Vibrant purple
Gold Tertiary:    #FBBF24  // Contrasting gold

// Light Theme
Background:       #FCFCFF  // Clean white
Surface:          #FFFFFF  // Pure white cards
Text:             #1B1921  // Dark purple-black

// Dark Theme  
Background:       #1A1721  // Very dark purple
Surface:          #2C2A3A  // Dark purple-grey
Text:             #F5F3FF  // Off-white

UI Highlights

  • Material Design 3 custom purple-gold theme
  • Glassmorphism effects on navigation
  • Smooth animations for transitions
  • Dark/Light themes based on system
  • Responsive layouts for all screen sizes

Team

Developer Role GitHub
Manav Bansal Backend & WebSocket Integration @manavbansal1
Kabir Singh Sidhu AI Integration & Game UI @kabirsinghsidhu
Ansh Tiwari UI/UX Design & NFC @anshtiwari
Akaaljot Singh Mathoda Notifications & Quick Actions @akaaljotmathoda
Yadhu Choudhary Podcasts, Flashcards & Content @yadhuchoudhary

License

MIT License - Copyright (c) 2025 Group 7 - StudySage Development Team

See LICENSE file for details.

Acknowledgments

Technologies: FirebaseCloudinaryGoogle GeminiKtorJetpack Compose

Inspiration: Notion (AI processing) • Discord (real-time chat) • Duolingo (gamification)


[email protected]

⭐ Star this repo if you found it helpful!

Status Version Love

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages