Backend Repository
Threadly’s backend is hosted in a separate repository:Threadly Server
Node.js + Express + MySQL backend with Socket.IO support
Backend Stack
- Runtime: Node.js
- Framework: Express.js
- Database: MySQL
- Real-time: Socket.IO
- Push Notifications: Firebase Cloud Messaging (FCM)
Configuration Options
You have two options for backend configuration:- Option 1: Use Hosted Backend
- Option 2: Local Development
Use the Hosted Instance
The easiest way to get started is using the pre-configured hosted backend:- API URL:
https://threadlyserver.onrender.com/api - Socket URL:
https://threadlyserver.onrender.com/
The debug build variant is pre-configured with these URLs. No changes needed!
Update Endpoint Configuration
To point Threadly to your own backend instance, update the build configuration:Locate buildTypes section
Find the
buildTypes block with debug and release configurations:app/build.gradle
Update the URLs
Replace the URLs with your backend endpoints:
- Use
10.0.2.2for Android emulator to accesslocalhoston your machine - For physical devices, use your machine’s local IP address (e.g.,
192.168.1.x) - Always include
/apisuffix forBASE_URL - Always include trailing
/forSOCKET_URL
Sync Gradle
Click Sync Now in the notification bar, or:
- Windows/Linux:
Ctrl + Shift + O - macOS:
Cmd + Shift + O
Accessing BuildConfig Values
The configured URLs are available throughout your app viaBuildConfig:
Java
Verify Backend Connection
After configuration, verify the connection:Connected successfully? You’re ready to use all of Threadly’s features.
Troubleshooting
Connection timeout / Network error
Connection timeout / Network error
- Verify backend server is running
- Check firewall settings
- Ensure URLs are correctly formatted (no typos)
- For local development, confirm your device can reach the server
404 Not Found errors
404 Not Found errors
- Verify
BASE_URLends with/api - Check backend routes are properly configured
- Confirm backend database is set up correctly
Socket.IO not connecting
Socket.IO not connecting
- Ensure
SOCKET_URLhas trailing/ - Check CORS settings on backend
- Verify Socket.IO server is running on the correct port
- Check Logcat for Socket.IO connection events
Different URLs for debug/release
Different URLs for debug/release
Update both
debug and release build types separately:Environment-Specific Configuration
Next Steps
Firebase Setup
Configure push notifications for real-time message delivery