A facilitator-led, interactive group psychoeducation web application for the U.S. Department of Veterans Affairs. This application uses playful, engaging mechanics to help veterans practice evidence-based tools (CBT, mindfulness) in group settings.
- Facilitator Console: Desktop interface for licensed therapists to create and manage sessions
- Participant Interface: Mobile-first interface for veterans to join sessions via QR code or room code
- Real-time Synchronization: WebSocket-based real-time updates for all participants
- CBT Reframe Relay Module: Practice identifying alternative, balanced thoughts
- Response Moderation: Facilitators can spotlight, hide, or save responses for follow-up
- 72-Hour Auto-Purge: Automatic deletion of participant data after 72 hours
- Section 508 Compliant: High contrast, ARIA labels, keyboard navigation, screen reader support
- Next.js 14+ (App Router) with TypeScript
- Custom Node.js Server with Socket.io for WebSocket support
- Prisma ORM + PostgreSQL
- Tailwind CSS (mobile-first, Section 508 compliant)
- Zustand for state management
- Docker Compose for local PostgreSQL
- Node.js 18+
- Docker and Docker Compose
- npm or yarn
npm installCopy .env.example to .env and configure:
cp .env.example .envEdit .env with your configuration:
DATABASE_URL="postgresql://va_user:va_password@localhost:5432/va_psychoeducation"
NEXTAUTH_SECRET="your-secret-key-change-in-production"
NEXTAUTH_URL="http://localhost:3000"
SESSION_RETENTION_HOURS=72
NODE_ENV="development"
PORT=3000
NEXT_PUBLIC_SOCKET_URL="http://localhost:3000"docker-compose up -dThis will start PostgreSQL on port 5432.
# Generate Prisma Client
npm run db:generate
# Push schema to database
npm run db:push
# (Optional) Open Prisma Studio to view data
npm run db:studionpm run devThe application will be available at http://localhost:3000.
Important: The custom server (server.ts) runs both the Next.js app and Socket.io server in the same process. This is required for WebSocket functionality.
- Navigate to
/register - Enter email, password, and select "Facilitator" role
- Log in at
/login
- Log in as a facilitator
- Navigate to Dashboard
- Click "Create Session"
- Select:
- Care Team
- Module (CBT Reframe Relay)
- Prompt Pack
- Number of rounds
- Intro media
- Share the QR code or room code with participants
- Navigate to
/joinor scan QR code - Enter room code
- Enter nickname (and optional pseudonym ID)
- Join the session
- Lobby: Participants join via room code
- Intro: Play intro media, facilitator marks as completed
- Rounds: Facilitator selects prompts, participants submit responses
- Moderation: Facilitator can spotlight, hide, or save responses
- End: Session summary is generated automatically
va-group-psychoeducation/
├── prisma/
│ └── schema.prisma # Database schema
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # Authentication routes
│ │ ├── (facilitator)/ # Facilitator routes
│ │ ├── (participant)/ # Participant routes
│ │ └── api/ # API routes
│ ├── components/ # React components
│ │ ├── facilitator/ # Facilitator UI components
│ │ ├── participant/ # Participant UI components
│ │ └── shared/ # Shared components
│ ├── lib/ # Utilities
│ ├── modules/ # Module implementations
│ │ └── cbt-reframe-relay/ # CBT Reframe Relay module
│ ├── server/ # Custom server code
│ │ ├── socket-handlers/ # WebSocket handlers
│ │ └── jobs/ # Background jobs (purge)
│ ├── stores/ # Zustand stores
│ └── types/ # TypeScript types
├── server.ts # Custom Node.js server entry point
└── docker-compose.yml # PostgreSQL setup
- 72-Hour Retention: All participant responses auto-purged after 72 hours
- No Persistent Tracking: No device identifiers or cross-session tracking
- Explicit Consent: Participants explicitly join sessions
- Audit Logging: All access to sensitive data logged
- Full Autonomy: Participants can skip, pass, or leave at any time
- No Pressure: No scores, rankings, or performance metrics
- Facilitator Control: Licensed therapists control all pacing and content visibility
- Safe Defaults: All sharing defaults to facilitator-only
- No Automated Inference: No sentiment analysis, risk detection, or diagnostic scoring
- No Behavioral Metrics: No timing data, skip counts, or response rates in summaries
- Neutral Summaries: Session summaries contain only explicitly saved content and attendance notes
- Facilitator Judgment: All clinical interpretation remains with licensed facilitators
# Create a new migration
npm run db:migrate
# Reset database (WARNING: deletes all data)
npx prisma migrate resetnpm run lintnpm run build
npm start| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Required |
NEXTAUTH_SECRET |
Secret for session encryption | Required |
NEXTAUTH_URL |
Base URL of the application | http://localhost:3000 |
SESSION_RETENTION_HOURS |
Hours before auto-purge | 72 |
PORT |
Server port | 3000 |
NEXT_PUBLIC_SOCKET_URL |
Socket.io server URL | http://localhost:3000 |
The application includes:
- Real-time WebSocket testing with multiple concurrent participants
- Purge job verification (test with short retention period)
- Audit logging verification
- Mobile responsiveness testing
- Accessibility testing (keyboard, screen reader)
docker build -t va-psychoeducation .
docker run -p 3000:3000 --env-file .env va-psychoeducationEnsure all environment variables are set in production. Use a secure NEXTAUTH_SECRET and configure DATABASE_URL for your production database.
This project is developed for the U.S. Department of Veterans Affairs.
For issues or questions, please contact the development team.
Important Notes:
- This is NOT a party game, consumer therapy software, or diagnostic system
- It is a facilitator-led "skills engagement experience" for group settings
- All clinical interpretation remains with licensed facilitators
- Participant data is automatically purged after 72 hours