Link Room - Adapter Layer
Provides framework-agnostic data navigation between managed apps (AMAR) and soleprint.
Status: Initial Implementation ✅
Working:
- ✅ FastAPI service with adapter pattern
- ✅ BaseAdapter interface for pluggable frameworks
- ✅ DjangoAdapter with AMAR database queries
- ✅ Docker build and container starts
- ✅
/healthendpoint (adapter loads successfully) - ✅
/api/queriesendpoint (lists available queries)
Pending:
- ⏳ Database connection (needs DB_HOST env var fix)
- ⏳ Complete all entity queries (Pet, Vet, ServiceRequest, etc.)
- ⏳ Ward integration (consume JSON and render graph)
Architecture
Managed App (AMAR) ←─── link_room ───→ Soleprint (Ward)
↓ ↓ ↓
Database Adapter Layer Graph Renderer
(SQL → JSON) (JSON → SVG)
JSON Contract:
{
"nodes": [
{"id": "User_123", "type": "User", "label": "john", "data": {...}}
],
"edges": [
{"from": "User_123", "to": "PetOwner_456", "label": "has profile"}
],
"summary": {
"title": "User #123",
"credentials": "john | Password: Amar2025!",
"fields": {"Email": "john@example.com"}
}
}
Endpoints
GET /health- Health check with adapter statusGET /api/queries- List available predefined queriesGET /api/navigate?query=user_with_pets- Query modeGET /api/navigate?entity=User&id=123- Entity navigation mode
Available Queries
user_with_pets- User with Pet ownershipuser_with_requests- User with ServiceRequests
Usage
# Start (from core_room/ctrl)
./start.sh link_room -d --build
# Test
curl http://localhost:8100/health
curl http://localhost:8100/api/queries
curl "http://localhost:8100/api/navigate?query=user_with_pets"
# Logs
docker logs core_room_link_room
Environment Variables
From core_room/.env:
NEST_NAME- Container namingNETWORK_NAME- Docker networkDB_HOST- Database host (needs fix: should point to db container)DB_PORT- Database portDB_NAME- Database nameDB_USER- Database userDB_PASSWORD- Database passwordADAPTER_TYPE- Adapter to use (default: django)
Next Steps
- Fix DB connection - Set correct DB_HOST in core_room/.env
- Complete queries - Add remaining entity types
- Ward integration - Create ward consumer for JSON
- Add graphviz rendering - Move from data_browse reference
- Test end-to-end - Query → JSON → SVG → Display
Files
link_room/
├── README.md # This file
├── main.py # FastAPI app with endpoints
├── requirements.txt # Python dependencies
├── Dockerfile # Container build
├── docker-compose.yml # Service definition
└── adapters/
├── __init__.py # BaseAdapter interface
└── django.py # DjangoAdapter implementation
Design Goals
✅ Framework-agnostic - Works with Django, Rails, Express, etc. ✅ Decoupled - Managed app owns data, link_room translates ✅ Pluggable - Adapters for different frameworks ✅ Authenticated - Ready for remote deployment ✅ Incremental - Build and test each piece
Reference
Previous approach (databrowse direct DB) saved in:
- Branch:
ref/databrowse-direct-db(ward repo) - Problem: Tight coupling, won't work remote
- Solution: This adapter pattern