-
Notifications
You must be signed in to change notification settings - Fork 0
Frontend roadmap
Anar Enhsaihan edited this page Oct 23, 2025
·
1 revision
Based on your project requirements, here's a comprehensive summary for your frontend developer:
- Implement WebRTC for real-time video/audio sessions between tutors and students
- Handle peer-to-peer connection establishment
- Manage media streams (camera, microphone)
- Handle connection states and error handling
- Approval Flow: Allow students to approve token spending for the LangDAO contract
- Deposit Flow: Enable students to deposit tokens into the LangDAO contract
- Use
useScaffoldWriteContractwithcontractName: "LangDAO"for these transactions
- Create tutor registration form/flow
- Collect tutor information and preferences
- Submit registration data to backend API
- Handle registration success/error states
- Become Available: Button/action to set tutor status to "available"
- Backend Socket Activation: When tutor becomes available, trigger backend socket connection
- Stay Available: Tutor remains available until manually setting to "unavailable"
- Request Tutor: Student can request a tutor based on preferences
- Socket Communication: Send request via socket to backend
- Queue Display: Show queued tutors to student
- Accept/Reject: Student can accept or reject available tutors
- Incoming Call View: Tutor sees incoming student requests
- Accept Call: Tutor can accept incoming calls
- Socket Events: Handle accept/reject events via socket
-
Start Session: Student calls
startSessiontransaction on LangDAO contract - WebRTC Call: Both parties enter WebRTC session
- Session State: Track active session state
- Time Tracking: Monitor session duration
- Top-up Warning: Show warning when student's balance is low
- Real-time Updates: Update UI based on remaining time/balance
- End Call: Either party can end the session
-
End Session TX: Call
endSessiontransaction on LangDAO contract - Event Listening: Listen for session end events from contract
-
Receipt Display: Show session receipt after
endSessionevent - Restart Cycle: Allow both parties to restart the matching process
- Tutor Availability: Tutor remains available for new sessions
// For contract interactions
useScaffoldWriteContract({ contractName: "LangDAO" })
useScaffoldReadContract({ contractName: "LangDAO" })
useScaffoldEventHistory({ contractName: "LangDAO" })
// For contract info
useDeployedContractInfo({ contractName: "LangDAO" })- Tutor becomes available
- Student requests tutor
- Tutor accepts/rejects call
- Session start/end notifications
- Real-time status updates
-
approve()- Token approval -
deposit()- Token deposit -
startSession()- Begin tutoring session -
endSession()- End tutoring session
This covers the complete flow from registration to session completion with proper WebRTC integration and smart contract interactions.