-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Milestone
Description
Goal: Write reusable service functions to use in React anywhere we need to fetch from Flask or connect via SocketIO
File 1: HTTP API Service (src/services/api.js)
- Create file with base URL configuration (http://localhost:5500)
- Write async functions for all Flask endpoints
- Use fetch() to make HTTP requests
- Return JSON responses
File 2: WebSocket Service (src/services/socket.js)
- Install socket.io-client: npm install socket.io-client
- Create SocketService class with connect/disconnect methods
- Set up connection to http://localhost:5500
- Add on() method to listen for real-time events from Flask
- Add emit() method to send events to Flask
- Export singleton instance
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo