CollabTable
A collaborative list management system with Android app and server for creating and managing shared lists with custom fields and items.
Overview
CollabTable allows multiple users to collaboratively create and manage lists with custom fields. Perfect for:
- Shopping lists with price tracking
- Product catalogs
- Task management with custom attributes
- Any structured data collection
Features
Android App
- ✨ Beautiful Material 3 design with dynamic colors
- 📱 Native Android app built with Jetpack Compose
- 💾 Offline-first with Room database
- 🔄 Synchronization via transactional HTTP sync and notification polling
- 🎨 Custom fields (name, link, price, category, etc.)
- ✏️ Inline editing of items with auto-save
- 📤 Export functionality (CSV format)
- 🗑️ Soft delete support for data recovery
- ⚙️ Configurable server URL and authentication
- 📊 Optimized performance for large tables with thousands of rows
- 🎯 Column alignment options (left, center, right)
Server
- 🚀 Go REST API built with
net/http - 🐳 Fully containerized with Docker
- 💾 PostgreSQL database (bring your own instance)
- 🔄 Advanced sync protocol for conflict resolution
- 🔔 Notification polling for background updates
- 🔐 Single-admin-account dashboard login (session cookie) plus long-lived API tokens for sync clients/devices
- 📊 Complete CRUD operations for all entities
Prerequisites
Server
- Docker and a PostgreSQL instance (bring your own - this app does not run Postgres for you)
- Or Go 1.26+ and Node.js 22+ for local development
Android App
- Android Studio Hedgehog or later
- Android SDK 26+ (Android 8.0 or higher)
- JDK 21
- Android emulator or physical device
Quick Start
Server (Docker)
-
Navigate to server directory:
cd CollabTableServer -
Copy environment file (optional):
cp .env.example .env -
Build and run the server, pointing at your own PostgreSQL instance:
docker build -t collabtable-server . docker run -d --name collabtable-server --restart unless-stopped \ -p 3000:3000 \ -e DATABASE_URL=postgres://user:password@host:5432/collabtable \ collabtable-server
Server runs on http://localhost:3000. Open it in a browser to create the admin account,
then generate an API token from the dashboard's Settings page for your sync clients/devices
— see CollabTableServer/README.md's "Authentication" section for details.
Database: PostgreSQL, bring your own instance via DATABASE_URL.
Android App
-
Open project in Android Studio:
- Open
CollabTableAndroidfolder in Android Studio - Wait for Gradle sync to complete
- Open
-
Run the app:
- Run on emulator or physical device
-
Configure server connection:
- Tap the Settings icon (⚙️) in the top bar
- Enter your server URL:
- For emulator:
http://10.0.2.2:3000/api/ - For physical device:
http://YOUR_COMPUTER_IP:3000/api/
- For emulator:
- Enter the API token generated from the server dashboard's Settings page (the app's "Server Password" field doubles as the API token field — see note below)
- Tap "Save"
Note: Make sure to include the trailing /api/ in the URL.
Project Structure
CollabTable/
├── CollabTableAndroid/ # Android app
│ ├── app/
│ │ ├── src/main/java/com/collabtable/app/
│ │ │ ├── data/ # Database, API, repositories
│ │ │ │ ├── api/ # Retrofit interfaces
│ │ │ │ ├── dao/ # Room DAOs
│ │ │ │ ├── database/ # Room database setup
│ │ │ │ ├── model/ # Data models
│ │ │ │ └── repository/ # Repository pattern
│ │ │ └── ui/ # Compose UI
│ │ │ ├── navigation/ # Navigation setup
│ │ │ ├── screens/ # UI screens & ViewModels
│ │ │ └── theme/ # Material 3 theme
│ │ └── build.gradle
│ └── README.md
│
└── CollabTableServer/ # Go server
├── *.go # HTTP handlers, auth, sync, and database layer
├── go.mod # Go dependencies
├── webui/ # SvelteKit web dashboard (read-only database viewer)
├── Dockerfile
└── README.md
Technology Stack
Android
- Language: Kotlin
- UI Framework: Jetpack Compose with Material 3
- Database: Room (SQLite)
- Networking: Retrofit and OkHttp (HTTP)
- Async: Coroutines & Flow
- Architecture: MVVM with Repository pattern
- Build System: Gradle with Kotlin DSL
Server
- Runtime: Go 1.26+
- Framework: Go
net/http - Language: Go
- Database: PostgreSQL (pgx)
- Containerization: Docker
- Updates: HTTP notification polling
API Endpoints
All endpoints are prefixed with /api/. The sync/collaboration endpoints below (Lists,
Fields, Items, sync) require an API token generated from the web dashboard's Settings page:
Authorization: Bearer your_api_token_here
The dashboard itself has its own separate single-admin-account login (session cookie, not a
bearer token) — see CollabTableServer/README.md's "Authentication" section.
Lists
GET /api/lists- Get all listsGET /api/lists/:id- Get a specific listPOST /api/lists- Create a new listPUT /api/lists/:id- Update a listDELETE /api/lists/:id- Delete a list (soft delete)
Fields
GET /api/fields/list/:listId- Get all fields for a listPOST /api/fields- Create a new fieldPUT /api/fields/:id- Update a field (including alignment)DELETE /api/fields/:id- Delete a field (soft delete)
Items
GET /api/items/list/:listId- Get all items for a listGET /api/items/:itemId/values- Get all values for an itemPOST /api/items- Create a new itemPOST /api/items/values- Create/update item valuesPUT /api/items/:id- Update an itemDELETE /api/items/:id- Delete an item (soft delete)
Sync
POST /api/sync- Synchronize dataGET /api/notifications/poll?since=<timestamp-ms>- Poll for remote changes
Health
GET /health- Server health check
Web UI
/, /about, and /lists/:id serve an embedded SvelteKit dashboard (a single-page app with client-side routing) for browsing lists/fields/items read-only. The dashboard shell is public; its data endpoints require the admin session.
GET /web/data- JSON snapshot of all lists, fields, items, and values, used by the dashboardGET /web/info- JSON tech stack info, shown on the dashboard's About page
See Server README for detailed API documentation.
Development
Server Development
Local development without Docker:
-
Run the Go backend:
cd CollabTableServer go test ./... go run . -
Create
.envfile:cp .env.example .env -
Check and build the dashboard when changing web UI code:
cd webui npm ci npm run check npm run build cd .. cp -R webui/build web go build -o collabtable-server .
Useful backend commands:
go test ./... # Run Go tests
go vet ./... # Run static checks
Android Development
-
Open
CollabTableAndroidin Android Studio -
Build the project:
./gradlew build -
Run linters:
./gradlew ktlintCheck # Check Kotlin code style ./gradlew detekt # Run static analysis -
Format code:
./gradlew ktlintFormat
Data Model
Database Schema
List
Represents a table/list container:
{
id: string; // Unique identifier
name: string; // List name
createdAt: number; // Creation timestamp
updatedAt: number; // Last update timestamp
isDeleted: boolean; // Soft delete flag
}
Field
Defines a column/attribute in a list:
{
id: string; // Unique identifier
listId: string; // Parent list ID
name: string; // Field name (e.g., "Price", "Category")
order: number; // Display order
alignment: string; // Content alignment: "left", "center", "right"
createdAt: number; // Creation timestamp
updatedAt: number; // Last update timestamp
isDeleted: boolean; // Soft delete flag
}
Item
Represents a row in a list:
{
id: string; // Unique identifier
listId: string; // Parent list ID
createdAt: number; // Creation timestamp
updatedAt: number; // Last update timestamp
isDeleted: boolean; // Soft delete flag
}
ItemValue
The actual value for a specific field of an item:
{
id: string; // Unique identifier
itemId: string; // Parent item ID
fieldId: string; // Associated field ID
value: string; // The actual value
updatedAt: number; // Last update timestamp
}
Relationships
- One List has many Fields
- One List has many Items
- One Item has many ItemValues (one per Field)
Troubleshooting
Common Issues
Android App
Cannot connect to server
- Verify server is running: visit
http://localhost:3000/healthin browser - Check server URL in app settings:
- Emulator: Use
http://10.0.2.2:3000/api/ - Physical device: Use your computer's IP address
- Emulator: Use
- Ensure trailing
/api/is included in URL - Verify the API token is correct (generate/regenerate one from the dashboard's Settings page)
Gradle sync failed
- Update Android Studio to latest version
- Ensure JDK 21 is installed and selected
- Try: File → Invalidate Caches → Invalidate and Restart
Build errors with Room/Kotlin
- Clean and rebuild: Build → Clean Project → Rebuild Project
- Check that you're using compatible versions
Large tables are slow
- Performance is optimized for thousands of rows
- For tens of thousands of rows, consider server-side filtering
- Check that debouncing is enabled (default)
Server
Port 3000 already in use
# Find and kill process using port 3000
lsof -ti:3000 | xargs kill -9
# Or change the port mapping in your `docker run` command or .env
Docker container won't start
# View logs
docker logs -f collabtable-server
# Rebuild container
docker stop collabtable-server && docker rm collabtable-server
docker build -t collabtable-server . && docker run -d --name collabtable-server ...
Database connection error (PostgreSQL)
- Verify your PostgreSQL instance is running and reachable from the container
- Check
DATABASE_URLin.env - Ensure the database exists
Getting Help
- Check the Android README for app-specific details
- Check the Server README for server-specific details
- Review Docker logs:
docker logs -f collabtable-server - Open an issue on GitHub with detailed error messages
Synchronization
CollabTable uses a sophisticated sync protocol to keep data consistent across clients:
Sync Strategy
- Transport: HTTP POST (
/api/sync) - Background updates: Notification polling (
/api/notifications/poll) - Conflict Resolution: Latest timestamp wins
How It Works
- Client → Server: Client sends all local changes since last sync timestamp
- Server Processing: Server saves client changes and retrieves server changes
- Server → Client: Server returns changes made since client's last sync
- Client Update: Client applies server updates locally
- Timestamp Update: Client stores new server timestamp for next sync
Sync Flow
Client Server
| |
|-- Sync Request (local changes) ---->|
| (lists, fields, items, values) |
| |
|<-- Sync Response (server changes) --|
| (updates + new serverTimestamp) |
| |
Features
- Automatic Sync: Triggered on app start and after local changes
- Soft Deletes: Deleted items can be recovered on server
- Optimistic Updates: UI updates immediately, syncs in background
- Performance: Debounced updates for large table operations
Docker & Deployment
Data Persistence
PostgreSQL
- Use standard PostgreSQL backup tools (
pg_dump,pg_restore) against your own instance - this app does not manage Postgres storage itself
Docker Commands
Stop the container:
docker stop collabtable-server
View logs:
docker logs -f collabtable-server
Rebuild and restart:
docker build -t collabtable-server . && docker restart collabtable-server
Check running containers:
docker ps
Production Deployment
Environment Variables
Configure these in .env or your docker run command:
PORT=3000 # Server port
APP_VERSION=dev # Dashboard version label
DATABASE_URL=postgres://user:pass@postgres:5432/collabtable
COOKIE_SECURE=true # Requires HTTPS
Security Recommendations
- Generate the admin account and an API token on first run (see "Authentication" above)
- Use HTTPS with a reverse proxy (nginx, Caddy), and set
COOKIE_SECURE=true - Regular database backups
- Keep Docker images updated
- Restrict network access to server ports
Reverse Proxy Example (nginx)
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
}
}
Contributing
Contributions are welcome! Here's how you can help:
Getting Started
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes thoroughly
- Commit with clear messages:
git commit -m "feat: add new feature" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
Development Guidelines
Code Style
- Android: Follow Kotlin conventions, use ktlint for formatting
- Server: Follow Go conventions, run
gofmt, and keep handlers testable - Keep functions small and focused
- Write meaningful variable and function names
- Add comments for complex logic
Testing
- Test your changes on both emulator and physical devices (Android)
- Test against a PostgreSQL backend (Server)
- Verify sync works correctly with multiple clients
- Test with large datasets to ensure performance
Commit Messages Follow conventional commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
Areas for Contribution
Features
- Additional export formats (JSON, Excel)
- Search and filter functionality
- Batch operations
- User authentication and permissions
- Drag-and-drop row reordering
- Rich text field support
Improvements
- Performance optimization for very large tables
- Better offline support
- Enhanced error handling
- Accessibility improvements
- Internationalization (i18n)
Documentation
- API documentation improvements
- Tutorial videos or blog posts
- Translation to other languages
- More code examples
Pull Request Guidelines
- Keep PRs focused on a single feature or fix
- Update documentation if needed
- Ensure all tests pass
- Add screenshots for UI changes
- Reference any related issues
License
MIT