# 👥 Study Together
Study Together කියන්නේ StudyTrack usersලාට එකම virtual study room එකකට එකතු වෙලා, එකට focus session එකක් කරන්න පුළුවන් live collaborative study system එකක්.
මේකේ විශේෂත්වය තමයි room එකේ කරන focus time එක අවසානයේ normal StudyTrack study data වලටත් automatically එකතු වීම.
---
1. 🏠 Study Together Lobby
Page එක open කළාම userට Study Together lobby එක පෙන්වයි.
එතනින්:
- Create Room – අලුත් study room එකක් හදන්න
- Join Room – invite code එකකින් room එකකට join වෙන්න
- Your Rooms – තමන් host/member වෙලා ඉන්න rooms
- Public Rooms – public rooms
- Friends' Rooms – friendsලාගේ open rooms
බලන්න පුළුවන්.
Page එකේ room activity සහ current study activity වගේ live information ද ලබාගන්න system එකක් තියෙනවා.
---
# 2. ➕ Create Room
Userට තමන්ගේම study room එකක් create කරන්න පුළුවන්.
Room create කරනකොට:
🏷️ Room Name
Room එකට කැමති නමක් දාන්න පුළුවන්.
උදාහරණ:
A/L Physics Grind 💪
🔐 Who Can Join?
Room එකට access එක තෝරන්න පුළුවන්.
🔑 Invite Code
- Invite code/link තියෙන අයට join වෙන්න පුළුවන්.
🤝 Friends Only
- Hostගේ friendsලාට විතරක් room එකට join වෙන්න පුළුවන්.
🌍 Public
- Public directory එකේ room එක පෙන්වයි.
- ඕනෑම user කෙනෙකුට join request එකක් යවන්න පුළුවන්.
- Host approve කළාට පස්සේ විතරයි join වෙන්න පුළුවන්.
⏱️ Focus Time
Focus round එකේ duration එක set කරන්න පුළුවන්:
5–120 minutes
Default එක:
25 minutes
☕ Break Time
Focus round එකෙන් පස්සේ break duration එක set කරන්න පුළුවන්:
0–30 minutes
Default:
5 minutes
👥 Maximum Members
Room එකට maximum:
2–30 users
දක්වා set කරන්න පුළුවන්.
📚 Subject
Room එක create කරන වෙලාවේ තමන් study කරන subject එක තෝරන්නත් පුළුවන්.
---
# 3. 🔗 Invite Code & Invite Link
සෑම room එකකටම unique 6-character invite code එකක් automatically generate වෙනවා.
උදාහරණයක්:
ABC123
Room එක ඇතුළේ Copy invite link button එකෙන් complete invite link එක copy කරලා friendsලාට share කරන්න පුළුවන්.
ඒ නිසා manually room ID එක share කරන්න අවශ්ය නැහැ.
---
# 4. 🌍 Public Rooms
Public rooms වෙනුවෙන් වෙනම browse page එකක් තියෙනවා.
Userට:
- 🔎 Room name / host search කරන්න
- 🔥 Most active rooms sort කරන්න
- 🆕 Newest rooms sort කරන්න
- 🟢 Open seats අනුව sort කරන්න
පුළුවන්.
එක් room එකක:
- Room name
- Host
- Online members
- Maximum capacity
- Focus / break duration
- Join status
පෙන්වනවා.
---
# 5. 🙋 Public Room Join Requests
Public room එකකට user කෙනෙක් click කළාම ඔහු/ඇය directly room එකට ඇතුල් වෙන්නේ නැහැ.
ඒ වෙනුවට:
Request to join
කරනවා.
Hostට request එක පෙන්වනවා.
Hostට:
කරන්න පුළුවන්.
Request pending වෙලා තියෙන userට system එක periodically check කරලා request එක approve වුණාද reject වුණාද කියලා update කරනවා.
---
# 6. 👥 Live Room Members
Room එක ඇතුළේ ඉන්න members real-time-ish ලෙස update වෙනවා.
එක් member කෙනෙකුට:
- Profile/avatar
- Name
- Current status
- Subject
- Today's study time
- “What I'm working on” task
වගේ information පෙන්වනවා.
Status එක අනුව:
🔥 Studying
Focus round එක active නම්.
☕ On Break
Break phase එකේ නම්.
🟡 Ready
Timer එක active නැති නමුත් room එකේ online නම්.
⚫ Away
කාලයක් තිස්සේ active නොවුණොත්.
---
# 7. 📝 What Are You Working On?
Userට තමන් මේ වෙලාවේ කරන task එක room එකේ අනිත් membersලාට පෙන්වන්න පුළුවන්.
උදාහරණ:
📝 Organic Chemistry Past Paper – Q4
මෙය maximum 80 characters දක්වා save කරන්න පුළුවන්.
ඒක room එකේ member list එකේ පෙන්වයි.
---
# 8. ⏱️ Shared Pomodoro Timer
Study Together එකේ main feature එක shared timer එක.
Timer එක server-side data එක මත run වෙන නිසා room එකේ හැම user කෙනෙකුටම එකම timer state එක පෙන්වන්න design කරලා තියෙනවා.
Phases:
▶️ Focus
Study කරන period එක.
☕ Break
Focus round එක අවසන් වුණාම break period එක.
⏸️ Idle
Round එක active නැති අවස්ථාව.
Timer එකේ:
- Countdown
- Focus / Break status
- Current round
- Progress ring
පෙන්වනවා.
---
# 9. 👑 Host Timer Controls
Timer එක control කරන්න පුළුවන් hostට විතරයි.
Hostට:
- ▶️ Start Focus
- ☕ Skip to Break
- ■ Stop
කරන්න පුළුවන්.
Guest/member කෙනෙක්ට timer එක manually control කරන්න බැහැ.
Room create කරනකොට හෝ settings වලදී hostට:
- Focus duration
- Break duration
- Auto-continue
- Target rounds
- Maximum members
set කරන්න පුළුවන්.
---
# 10. 🔄 Auto-Continue
Hostට Auto-continue enable කරන්න පුළුවන්.
එවිට:
Focus → Break → Focus → Break → ...
වගේ rounds automatically continue වෙනවා.
Target rounds එකක් දාන්නත් පුළුවන්.
උදාහරණයක්:
Stop after 4 rounds
එවිට target rounds complete වුණාම timer එක automatically stop වෙනවා.
---
# 11. 🎯 Automatic Study Logging
මේක Study Together එකේ වැදගත්ම feature එකක්.
Focus round එක complete වුණාම system එක memberලාගේ actual study time calculate කරලා study_sessions වලට automatically add කරනවා.
ඒකට user:
- Room එකට join වෙන්න
- තමන්ගේ subject එක select කරන්න
- Focus round එකේ active වෙලා ඉන්න
ඕන.
Minimum credited study time එක 5 minutes.
Subject එකක් select කරලා නැත්නම් time එක StudyTrack study session එකට log කරන්නේ නැහැ.
---
# 12. ⭐ Study Points & Streaks
Study Together session එක successfully log වුණාම:
- Study Session එක add වෙනවා
- Study Streak data update වෙනවා
- Study Points award වෙනවා
ඒ නිසා Study Together එකේ කරපු study time එකත් StudyTrackගේ existing progress ecosystem එකට connect වෙනවා.
---
# 13. 💬 Room Chat
සෑම room එකකටම වෙනම live chat එකක් තියෙනවා.
Membersට:
- Messages send කරන්න
- Other membersගේ messages බලන්න
- System messages බලන්න
පුළුවන්.
උදාහරණ system messages:
🔥 Focus round started
☕ Break time
👋 Someone joined
👑 New host
Message එකකට maximum 300 characters.
Spam වැළැක්වීමට එක user කෙනෙකුගේ messages අතර minimum delay එකක්ද තියෙනවා.
---
# 14. 🏆 Room Leaderboard
Room එකේ Leaderboard එකක් තියෙනවා.
එහි membersලාගේ:
- 🥇 Rank
- 👤 Name
- 🔥 Current streak
- ⏱️ Today's study time
පෙන්වනවා.
Ranking එක today's logged study minutes අනුව arrange වෙනවා.
මේක room එක ඇතුළේ friendly motivation එකක් ලබාදෙන feature එකක්.
---
# 15. 🔊 Sound & Notifications
Userට personal preferences දෙකක් තියෙනවා:
🔊 Sound
Timer phase change වුණාම sound alert එකක් ලබාගන්න පුළුවන්.
🔔 Browser Notification
Browser tab එක hidden/background එකේ තිබුණත් focus/break change එක ගැන notification එකක් ලබාගන්න පුළුවන්.
Browser notification permission එක userගෙන් request කරනවා.
මේ settings browser localStorage එකේ save කරනවා.
---
# 16. 🎧 Ambient Sounds
Study session එකේ concentration එකට use කරන්න built-in ambient sound mixer එකක් තියෙනවා.
Available sounds:
- 🌧️ Rain
- ☕ Café
- 🌿 Forest
- 💨 Wind
- 🌊 Ocean
- 🔥 Fireplace
Userට sounds කිහිපයක් එකවර active කරන්නත් පුළුවන්.
Volume එක 0–100 අතර adjust කරන්න පුළුවන්.
මේ sounds external audio files මත depend නොවී browser Web Audio API එකෙන් generate කරනවා.
Userගේ selected sounds සහ volume browser එකේ remember කරනවා.
---
# 17. ⛶ Fullscreen Timer
Timer එක Fullscreen mode එකට ගන්න පුළුවන්.
එවිට timer එක screen එක පුරා විශාලව පෙන්වෙන නිසා distractions අඩු කරගෙන focus session එකක් කරන්න පහසුයි.
---
# 18. 👑 Host Management
Room hostට additional controls තියෙනවා.
Remove Member
Hostට member කෙනෙක් room එකෙන් remove කරන්න පුළුවන්.
Remove කළ memberට එම room එකට නැවත join වෙන්න බැරි ලෙස banned state එකක් දානවා.
Close Room
Hostට room එක සම්පූර්ණයෙන් close කරන්න පුළුවන්.
Close කරන අවස්ථාවේ running focus round එකක් තිබුණොත්, ඒ වෙනකම් earned study time එක credit කරන්න system එක උත්සාහ කරනවා.
---
# 19. 🔄 Automatic Host Transfer
Host room එකෙන් leave වුණොත් හෝ 180 seconds පමණ silent/offline වුණොත්, room එකේ online members අතරින් දිගුම කාලයක් room එකේ සිටි member කෙනෙකුට host role එක automatically transfer වෙනවා.
ඒ නිසා host disconnect වුණා කියලා room එක අනිවාර්යයෙන්ම නැතිවෙන්නේ නැහැ.
---
# 20. 🟢 Online / Offline Detection
System එක memberගේ last_seen information update කරනවා.
- 60 seconds ඇතුළත seen → Online
- 600 seconds පමණ stale → room membership cleanup සඳහා remove කළ හැක
Room activity එකත් continuously update වෙනවා.
ඒ නිසා room එකේ actual active users සහ inactive users වෙන්කරලා manage කරන්න පුළුවන්.
---
# 21. 🧹 Automatic Room Closing
කිසිම activity එකක් නැති room එකක් 3 hours පමණ inactive වුණොත් automatically close කරනවා.
ඒක නිසා public/friends room lists වල old inactive rooms දිගටම පිරී තිබෙන්නේ නැහැ.
Old closed room data cleanup mechanism එකක්ද තියෙනවා.
---
# 22. 🔐 Room Privacy
Room එකක් create කරනකොට access level එක hostට control කරන්න පුළුවන්.
| Mode | Access |
| --------------- | --------------------- |
| 🔑 Invite Code | Code/link තියෙන users |
| 🤝 Friends Only | Hostගේ friends |
| 🌍 Public | Anyone can request |
Public room එකකත් userට instant access ලැබෙන්නේ නැහැ — host approval අවශ්යයි.
---
# 23. 📊 StudyTrack Integration
Study Together එක වෙනම isolated feature එකක් නෙවෙයි.
Completed focus time එක:
Study Together → study_sessions → study streak → study points → StudyTrack statistics
වගේ existing systems වලට connect වෙනවා.
ඒ නිසා Study Together හරහා කරන study time එක normal manual/Pomodoro study time වගේම StudyTrack ecosystem එකේ use කරන්න පුළුවන්.
---
🔥 Simple Example
Student A:
Create Room → “Physics Night Study”
Focus = 50 min
Break = 10 min
Max = 5 people
Privacy = Friends Only
Student B සහ C invite link එකෙන් join වෙනවා.
ඊට පස්සේ:
3 students → same room → same 50-minute timer → live member status → room chat
50 minutes අවසානයේ, subject එක selected කරලා focus session එකට activeව සිටි membersගේ qualifying study time automatically log වෙනවා.
ඊට පස්සේ:
✅ Study session recorded
⭐ Study points awarded
🔥 Streak data updated
වෙන්න පුළුවන්.
🎯 Overall
Study Together = Live Study Room + Shared Pomodoro + Live Presence + Chat + Room Leaderboard + Automatic Study Tracking
මේ feature එකේ main goal එක friends/classmates එක්ක එකට study කරන experience එක StudyTrackගේ existing tracking system එකත් එක්ක directly connect කිරීමයි.