|
1 | | -# Janus HTTP API - START HERE |
| 1 | +# Janus Backend - Start Here |
2 | 2 |
|
3 | | -## Quick Start (30 seconds) |
| 3 | +Use this file if you want the fastest path to a working local backend. |
4 | 4 |
|
5 | | -```bash |
6 | | -# 1. Setup (one time) |
7 | | - ./scripts/test_setup.sh |
8 | | -# 2. Start MQTT |
9 | | -docker-compose up -d mosquitto |
| 5 | +## Quick Start |
10 | 6 |
|
11 | | -# 3. Start Server |
12 | | -cargo run --bin http_server |
| 7 | +### 1. Start the MQTT broker |
13 | 8 |
|
14 | | -# 4. Open Dashboard |
15 | | -open examples/demo_dashboard.html |
| 9 | +```bash |
| 10 | +docker-compose up -d mosquitto |
16 | 11 | ``` |
17 | 12 |
|
18 | | -Then click: **Start Replay** → **Start Query** |
19 | | - |
20 | | -## What This Does |
| 13 | +### 2. Start the HTTP server |
21 | 14 |
|
22 | | -1. **Start Replay**: Loads RDF data from `data/sensors.nq`, publishes to MQTT, stores locally |
23 | | -2. **Start Query**: Executes a JanusQL query, streams results via WebSocket to dashboard |
| 15 | +```bash |
| 16 | +cargo run --bin http_server |
| 17 | +``` |
24 | 18 |
|
25 | | -## Documentation |
| 19 | +### 3. Check health |
26 | 20 |
|
27 | | -- **QUICK_REFERENCE.md** - One-page cheat sheet |
28 | | -- **RUNTIME_FIX_SUMMARY.md** - How the runtime issue was fixed |
29 | | -- **COMPLETE_SOLUTION.md** - Full implementation details |
30 | | -- **SETUP_GUIDE.md** - Detailed setup instructions |
31 | | -- **README_HTTP_API.md** - Complete API documentation |
32 | | -- **FINAL_TEST.md** - Verification steps |
| 21 | +```bash |
| 22 | +curl http://localhost:8080/health |
| 23 | +``` |
33 | 24 |
|
34 | | -## Key Points |
| 25 | +Expected response: |
35 | 26 |
|
36 | | -✅ **No more runtime panics** - Fixed by spawning StreamBus in separate thread |
37 | | -✅ **Correct JanusQL syntax** - All examples updated to match parser |
38 | | -✅ **MQTT integration** - Full broker setup with Docker Compose |
39 | | -✅ **Two-button demo** - Interactive dashboard for easy testing |
40 | | -✅ **Production-ready** - Stable, tested, documented |
| 27 | +```json |
| 28 | +{"message":"Janus HTTP API is running"} |
| 29 | +``` |
41 | 30 |
|
42 | | -⚠️ **Known limitation**: Replay metrics show status but not event counts (acceptable trade-off) |
| 31 | +## Optional: Open the local demo dashboard |
43 | 32 |
|
44 | | -## Troubleshooting |
| 33 | +This repository contains a small demo dashboard: |
45 | 34 |
|
46 | 35 | ```bash |
47 | | -# Server won't start (port in use) |
48 | | -lsof -ti:8080 | xargs kill -9 |
49 | | - |
50 | | -# MQTT not running |
51 | | -docker-compose up -d mosquitto |
52 | | - |
53 | | -# Check if working |
54 | | -curl http://localhost:8080/health |
| 36 | +open examples/demo_dashboard.html |
55 | 37 | ``` |
56 | 38 |
|
57 | | -## Success Indicators |
| 39 | +For the maintained frontend, use the separate repository: |
58 | 40 |
|
59 | | -When everything works correctly: |
60 | | -1. Server starts with clean output (no panics) |
61 | | -2. Dashboard shows "Connected to Janus HTTP API server" |
62 | | -3. Replay button → Status changes to "Running" |
63 | | -4. Query button → WebSocket connects, results appear |
64 | | -5. Results tagged as "historical" or "live" |
| 41 | +- `https://github.com/SolidLabResearch/janus-dashboard` |
65 | 42 |
|
66 | | -## Need Help? |
| 43 | +## Most Useful Docs |
67 | 44 |
|
68 | | -1. Read **QUICK_REFERENCE.md** for common commands |
69 | | -2. Check **FINAL_TEST.md** for verification steps |
70 | | -3. See **RUNTIME_FIX_SUMMARY.md** if you see panics |
71 | | -4. Review **SETUP_GUIDE.md** for detailed instructions |
| 45 | +- [GETTING_STARTED.md](./GETTING_STARTED.md) |
| 46 | +- [docs/README_HTTP_API.md](./docs/README_HTTP_API.md) |
| 47 | +- [docs/QUICKSTART_HTTP_API.md](./docs/QUICKSTART_HTTP_API.md) |
| 48 | +- [docs/README.md](./docs/README.md) |
72 | 49 |
|
73 | | ---- |
| 50 | +## Notes |
74 | 51 |
|
75 | | -**Everything is ready. Just run the Quick Start commands above!** 🚀 |
| 52 | +- The backend is the primary concern of this repository. |
| 53 | +- `http_server` is the main user-facing executable. |
| 54 | +- `stream_bus_cli` is the replay/ingestion CLI. |
0 commit comments