mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-23 19:27:51 -04:00
docs: update documentation for forms system and role-based access
- Add forms system to README key features - Update router/table counts to reflect new forms router - Add forms section to quick-reference with types, templates, routes - Clarify study-level user roles (owner/researcher/wizard/observer)
This commit is contained in:
@@ -76,18 +76,21 @@ docker compose up -d
|
|||||||
- **WebSocket Real-time**: Trial updates with auto-reconnect
|
- **WebSocket Real-time**: Trial updates with auto-reconnect
|
||||||
- **Plugin System**: Robot-agnostic via identifier lookup
|
- **Plugin System**: Robot-agnostic via identifier lookup
|
||||||
- **Docker NAO6**: Three-service ROS2 integration
|
- **Docker NAO6**: Three-service ROS2 integration
|
||||||
|
- **Forms System**: Consent forms, surveys, questionnaires with templates
|
||||||
|
- **Role-based Access**: Owner, Researcher, Wizard, Observer permissions
|
||||||
|
|
||||||
## System Components
|
## System Components
|
||||||
|
|
||||||
### Backend (src/server/)
|
### Backend (src/server/)
|
||||||
- `api/routers/` - 12 tRPC routers
|
- `api/routers/` - 13 tRPC routers (studies, experiments, trials, participants, forms, etc.)
|
||||||
- `db/schema.ts` - Drizzle schema (31 tables)
|
- `db/schema.ts` - Drizzle schema (33 tables)
|
||||||
- `services/trial-execution.ts` - Trial execution engine
|
- `services/trial-execution.ts` - Trial execution engine
|
||||||
- `services/websocket-manager.ts` - Real-time connections
|
- `services/websocket-manager.ts` - Real-time connections
|
||||||
|
|
||||||
### Frontend (src/)
|
### Frontend (src/)
|
||||||
- `app/` - Next.js App Router pages
|
- `app/` - Next.js App Router pages
|
||||||
- `components/trials/wizard/` - Wizard interface
|
- `components/trials/wizard/` - Wizard interface
|
||||||
|
- `components/trials/forms/` - Form builder and viewer
|
||||||
- `hooks/useWebSocket.ts` - Real-time trial updates
|
- `hooks/useWebSocket.ts` - Real-time trial updates
|
||||||
- `lib/ros/wizard-ros-service.ts` - Robot control
|
- `lib/ros/wizard-ros-service.ts` - Robot control
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ bun dev
|
|||||||
Study → Experiment → Trial → Step → Action
|
Study → Experiment → Trial → Step → Action
|
||||||
```
|
```
|
||||||
|
|
||||||
### User Roles
|
### User Roles (Study-level)
|
||||||
- **Administrator**: Full system access
|
- **Owner**: Full study control, manage members
|
||||||
- **Researcher**: Create studies, design experiments
|
- **Researcher**: Design experiments, manage participants
|
||||||
- **Wizard**: Execute trials, control robots
|
- **Wizard**: Execute trials, control robot during sessions
|
||||||
- **Observer**: Read-only monitoring
|
- **Observer**: Read-only access to study data
|
||||||
|
|
||||||
### Plugin Identifier System
|
### Plugin Identifier System
|
||||||
- `identifier`: Machine-readable key (e.g., `nao6-ros2`)
|
- `identifier`: Machine-readable key (e.g., `nao6-ros2`)
|
||||||
@@ -50,8 +50,25 @@ Study → Experiment → Trial → Step → Action
|
|||||||
| `bun build` | Production build |
|
| `bun build` | Production build |
|
||||||
| `bun typecheck` | TypeScript validation |
|
| `bun typecheck` | TypeScript validation |
|
||||||
| `bun db:push` | Push schema changes |
|
| `bun db:push` | Push schema changes |
|
||||||
| `bun db:seed` | Seed data + sync plugins |
|
| `bun db:seed` | Seed data + sync plugins + forms |
|
||||||
| `bun run docker:up` | Start PostgreSQL |
|
| `bun run docker:up` | Start PostgreSQL + MinIO |
|
||||||
|
|
||||||
|
## Forms System
|
||||||
|
|
||||||
|
### Form Types
|
||||||
|
- **Consent**: Legal/IRB consent documents with signature fields
|
||||||
|
- **Survey**: Multi-question questionnaires (ratings, multiple choice)
|
||||||
|
- **Questionnaire**: Custom data collection forms
|
||||||
|
|
||||||
|
### Templates (seeded by default)
|
||||||
|
- Informed Consent - Standard consent template
|
||||||
|
- Post-Session Survey - Participant feedback form
|
||||||
|
- Demographics - Basic demographic collection
|
||||||
|
|
||||||
|
### Routes
|
||||||
|
- `/studies/[id]/forms` - List forms
|
||||||
|
- `/studies/[id]/forms/new` - Create form (from template or scratch)
|
||||||
|
- `/studies/[id]/forms/[formId]` - View/edit form, preview, responses
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user