Manager assigns a task -> AI Orchestrator decomposes it -> Specialist Agents execute -> Report returned.
syncspace/
├── frontend/ React + Vite + Tailwind
├── backend/ Node.js + Express + MongoDB + Socket.IO
└── ai/ Python + FastAPI + HuggingFace Inference API
This project can run without Docker. Docker is not required for local development.
- Node.js 18+
- Python 3.11+
- MongoDB Atlas URI or local MongoDB
- HuggingFace API key
- Redis URL, only needed when real queue/status persistence is added. The current task flow does not depend on Redis.
- LangGraph, recommended later if the AI agent workflow needs durable graph state, branching, retries, human review steps, or resumable execution.
The app uses separate env files:
backend\.env
ai\.env
frontend\.envImportant values:
MONGO_URI=mongodb+srv://user:password@cluster.mongodb.net/syncspace?retryWrites=true&w=majority
AI_SERVICE_URL=http://localhost:8000
BACKEND_URL=http://localhost:3000
FRONTEND_URL=http://localhost:5173
INTERNAL_WEBHOOK_SECRET=use_the_same_value_in_backend_and_ai
HUGGINGFACE_API_KEY=hf_your_key_hereThe backend and AI service both support MONGO_URI. Keep INTERNAL_WEBHOOK_SECRET identical in backend/.env and ai/.env.
cd backend
npm install
npm run devRuns on http://localhost:3000.
Open a new terminal:
cd ai
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python main.pyRuns on http://localhost:8000.
Open a new terminal:
cd frontend
npm install
npm run devRuns on http://localhost:5173.
Invoke-RestMethod http://localhost:3000/health
Invoke-RestMethod http://localhost:8000/healthThen open http://localhost:5173.
- Manager creates a task on the dashboard.
- Backend saves it to MongoDB and calls the Python AI service.
- AI orchestrator uses HuggingFace to split the task into subtasks.
- Specialist agents execute each subtask.
- AI sends protected internal webhook updates back to the backend.
- Socket.IO broadcasts live progress to the browser.
- Final report is saved and linked to the original user task.
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/auth/register |
Register |
| POST | /api/v1/auth/login |
Login |
| GET | /api/v1/auth/profile |
Get profile |
| POST | /api/v1/tasks |
Create and queue task |
| GET | /api/v1/tasks |
List user tasks |
| GET | /api/v1/tasks/stats |
Dashboard stats |
| GET | /api/v1/tasks/:id |
Task and subtasks |
| DELETE | /api/v1/tasks/:id |
Delete task |
| POST | /api/v1/tasks/:taskId/subtask-update |
Internal AI webhook |
| GET | /api/v1/reports |
List user reports |
| GET | /api/v1/reports/task/:taskId |
Report by task |
| GET | /api/v1/reports/:id |
Report detail |
| POST | /api/v1/reports/task/:taskId/save |
Internal AI webhook |
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /api/tasks/process |
Start AI processing |
| GET | /api/tasks/:taskId/status |
Processing status |
| Event | Direction | Description |
|---|---|---|
join:task |
Client -> Server | Subscribe to task updates |
task:queued |
Server -> Client | Task accepted |
task:processing |
Server -> Client | Orchestrator started |
task:progress |
Server -> Client | Progress update |
task:completed |
Server -> Client | All agents done |
task:failed |
Server -> Client | Error occurred |
subtask:completed |
Server -> Client | Single agent done |
report:ready |
Server -> Client | Report available |
- Docker compose is currently optional and not the main path.
- Rotate any database/API credentials that were shared publicly or committed accidentally.
- Redis and LangGraph are good next upgrades, but the current MVP can run without them.