-
Notifications
You must be signed in to change notification settings - Fork 0
Home
DivyanshuChipa edited this page Jan 22, 2026
·
1 revision
Welcome to the IntraChat-Android-FastAPI wiki!
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
Register new user |
| POST | /login |
Login and get JWT token |
| POST | /delete_account |
Delete user account (requires password) |
| Method | Endpoint | Description |
|---|---|---|
| WebSocket | /ws/{username} |
Real-time messaging |
| GET | /messages |
Get recent messages (last 100) |
| GET | /users |
Get all registered users with profile photos |
| Method | Endpoint | Description |
|---|---|---|
| POST | /upload |
Upload a file (chat attachments) |
| GET | /uploads/{filename} |
Download/view uploaded file |
| POST | /profile/upload_profile |
Upload profile photo |
| GET | /uploads/profiles/{filename} |
Get user profile photo |
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Web client (index.html) |
| GET | /chat.html |
Chat interface |
| GET | /style.css |
Stylesheets |
| GET | /app.js |
JavaScript logic |
- FastAPI - Modern, fast web framework
- Uvicorn - ASGI server
- WebSockets - Real-time communication
- SQLite - Lightweight database
- JWT - Secure authentication
- Passlib - Password hashing
- Pillow - Image processing for profile photos
- Aiofiles - Async file operations
- HTML5 - Semantic markup
- CSS3 - Modern styling with CSS variables (dark/light themes)
- Vanilla JavaScript - No frameworks, pure JS
- WebSocket API - Real-time messaging
- Fetch API - RESTful API calls
- LocalStorage - Client-side session management
- Responsive Design - Mobile-first approach
- Kotlin - Modern Android development
- Jetpack Compose - Declarative UI
- Room Database - Local data persistence
- Retrofit - HTTP client
- OkHttp - WebSocket client
- Coroutines - Asynchronous programming
- Material Design 3 - Modern UI components
- Coil - Image loading library
- π Password hashing with PBKDF2-SHA256
- π« JWT token-based authentication (30-day expiry)
- π‘οΈ CORS protection configured for LAN access
- π Input sanitization for file uploads
- π Secure WebSocket connections
- π« SQL injection prevention via parameterized queries
- π File upload size limits and type validation
- ποΈ Secure account deletion with password verification
Problem: Server won't start
# Check if port 8000 is already in use
sudo lsof -i :8000
# Kill the process if needed
sudo kill -9 <PID>Problem: Can't access from other devices
- β
Ensure server is running with
--host 0.0.0.0 - β
Check firewall settings:
sudo ufw allow 8000/tcp
- β Verify all devices are on the same Wi-Fi network
Problem: Profile photos not loading
# Check uploads folder permissions
ls -la uploads/
chmod 755 uploads/
chmod 755 uploads/profiles/Problem: Can't connect to server
- β Check browser console (F12) for errors
- β Verify server IP address is correct in URL
- β
Ensure server is running (
http://IP:8000should show login page)
Problem: WebSocket connection fails
- β Check browser console for WebSocket errors
- β
Some browsers block
ws://on HTTPS pages (use HTTP for both) - β Restart server if WebSocket hangs
Problem: Theme not switching
- β Clear browser cache (Ctrl+Shift+Delete)
- β Check LocalStorage in DevTools (F12 β Application β LocalStorage)
Problem: Build errors in Android Studio
# Clean and rebuild
./gradlew clean
./gradlew buildProblem: App can't connect to server
- β
Check
ApiClient.ktfor correct server IP (or use in-app settings) - β Ensure server is running and reachable
- β
Test connection in browser first:
http://SERVER_IP:8000 - β Check Logcat for detailed error messages
Problem: Profile photos not showing
- β Grant storage permissions in Android settings
- β Clear app cache: Settings β Apps β Intra β Storage β Clear Cache
- β Re-upload photo from Settings screen