A multi-application frontend monorepo for the Ally mental health platform, built with React and Next.js. It provides the user-facing web application, a helpline dashboard for mental health professionals, and an admin dashboard for platform management.
Ally Web is the frontend layer of the Ally platform that:
- Powers the landing page (
ally-web) with a Next.js application showcasing the platform - Provides the Helpline Dashboard (
ally-helpline-dashboard) for mental health counselors β real-time chat, appointment scheduling, case management, analytics, and LiveKit voice integration - Provides the Admin Dashboard (
ally-admin-dashboard) for super admins β simulation management, session event configuration, user and tenant management, permission-based access control, and simulation credit monitoring - Shares UI components across applications via the
libs/ui-sharedlibrary - Supports internationalisation with i18next and multi-language configuration
- Integrates with the Ally Backend (
ally-be) REST API and LiveKit for real-time communication
The system is organised as an Nx monorepo with three applications and one shared library:
- Ally Web (
apps/ally-web/) - Next.js 14 landing page with CSS Modules; mental health resource library with document search, category filtering, and infinite scroll - Helpline Dashboard (
apps/ally-helpline-dashboard/) - Vite + React application for counselors; real-time chat, LiveKit voice sessions, calendar, case management, analytics reports, and PDF export - Admin Dashboard (
apps/ally-admin-dashboard/) - Vite + React application for administrators; scenario and session-event management, user/tenant/permission management, LiveKit simulation preview, and credit monitoring - Shared UI Library (
libs/ui-shared/) - Reusable React components, utilities, feature flags, and logger shared across all applications
| Component | Tech Used |
|---|---|
| Landing Page | Next.js 14 (React 18), CSS Modules |
| Helpline Dashboard | Vite + React 18, Tailwind CSS, MUI, Redux Toolkit |
| Admin Dashboard | Vite + React 18, Tailwind CSS, RTK Query |
| State Management | Redux Toolkit / RTK Query |
| Real-time Comm | LiveKit (voice/video) |
| Authentication | JWT via Ally Backend API |
| Internationalisation | i18next, react-i18next |
| Forms | React Hook Form |
| Animations | Framer Motion |
| Testing | Vitest + Testing Library |
| Monorepo Tooling | Nx |
| Code Quality | ESLint + Prettier |
ally-web/
βββ apps/
β βββ ally-web/ # Landing page (Next.js 14, port 3000)
β β βββ src/ # Pages, components, and styles
β β βββ public/ # Static assets
β β βββ next.config.js # Next.js configuration
β β βββ Dockerfile.dev # Development Docker image
β βββ ally-helpline-dashboard/ # Helpline app for counselors (Vite + React, port 8080)
β β βββ src/
β β β βββ api/ # API client and RTK Query endpoints
β β β βββ components/ # Reusable UI components
β β β βββ containers/ # Page-level container components
β β β βββ hooks/ # Custom React hooks
β β β βββ i18n/ # Internationalisation configuration
β β β βββ pages/ # Route-level page components
β β β βββ reducer/ # Redux slices
β β β βββ routes/ # React Router route definitions
β β β βββ store/ # Redux store configuration
β β β βββ types/ # TypeScript type definitions
β β βββ Dockerfile.dev # Development Docker image
β βββ ally-admin-dashboard/ # Admin app for super admins (Vite + React, port 8081)
β βββ src/
β β βββ api/ # API client and RTK Query endpoints
β β βββ components/ # Reusable UI components
β β βββ hooks/ # Custom React hooks
β β βββ pages/ # Route-level page components
β β βββ reducer/ # Redux slices
β β βββ routes/ # React Router route definitions
β β βββ store/ # Redux store configuration
β β βββ types/ # TypeScript type definitions
β βββ Dockerfile.dev # Development Docker image
βββ libs/
β βββ ui-shared/ # Shared components, utilities, feature flags, logger
βββ docs/
β βββ colima.md # Colima Docker alternative setup guide
β βββ prompts-meta.md # Prompt display names via .meta.json
βββ scripts/
β βββ docker-switch.sh # Switch between Docker Desktop and Colima
β βββ i18n-sync.mjs # Internationalisation sync script
βββ compose.yaml # Docker Compose configuration
βββ Dockerfile.deps # Shared base dependencies image
βββ nx.json # Nx workspace configuration
βββ tsconfig.base.json # Base TypeScript configuration
βββ package.json # Workspace dependencies and npm scripts
Before you begin, ensure you have the following installed:
- Node.js (v22) - Download
- npm - Comes with Node.js
- Docker (v20.10 or higher) - Download
- Docker Compose (v2.0 or higher) - Usually included with Docker Desktop
We support two Docker environments:
- Install Docker Desktop
- No additional setup needed
- Free and open-source alternative to Docker Desktop
- See docs/colima.md for setup instructions
Switching between environments:
# Switch to Docker Desktop
./scripts/docker-switch.sh desktop
# Switch to Colima
./scripts/docker-switch.sh colimagit clone <repository-url>
cd ally-webdocker build -f Dockerfile.deps -t ally-web/deps:dev .docker compose upOr start individual services:
docker compose up web # Ally Web (port 3000)
docker compose up helpline # Helpline Dashboard (port 8080)
docker compose up admin # Admin Dashboard (port 8081)- Ally Web: http://localhost:3000
- Helpline Dashboard: http://localhost:8080
- Admin Dashboard: http://localhost:8081
If you prefer to run without Docker:
-
Install dependencies:
npm install
-
Start development servers:
npm run start:web # Ally Web (port 3000) npm run start:helpline # Helpline Dashboard (port 8080) npm run start:admin # Admin Dashboard (port 8081)
Each application reads environment variables from its own .env file. Refer to the compose.yaml for the variables required by each service:
| Variable | Service | Description |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL |
web | Backend API base URL |
NEXT_PUBLIC_API_VERSION |
web | Backend API version (e.g. v1) |
VITE_API_BASE_URL |
helpline | Backend API base URL |
VITE_API_BASE_URL |
admin | Backend API base URL |
npm run build:web # Build Ally Web
npm run build:helpline # Build Helpline Dashboard
npm run build:admin # Build Admin Dashboard
# Or build everything at once
npm run build:prod# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run tests for specific applications
npm run test:web # Ally Web tests
npm run test:helpline # Helpline Dashboard tests
npm run test:admin # Admin Dashboard tests
npm run test:ui-shared # Shared UI library tests# Check for linting errors
npm run lint
# Auto-fix linting errors
npm run lint:fix
# Format code with Prettier
npm run format
# Check formatting without making changes
npm run format:check- Real-time Chat - Live messaging with clients via WebSocket
- LiveKit Voice Sessions - Integrated voice/video communication
- Appointment & Calendar Management - Scheduling and calendar views
- Case Management - Create, track, and document client cases
- Analytics & Reporting - Session analytics with PDF export
- Dark/Light Theme - Configurable UI theme
- Internationalisation - Multi-language support via i18next
- Simulation Management - Create and configure voice-based simulation scenarios
- Session Event Configuration - Map and manage session events
- User & Tenant Management - Manage users, organisations, and permissions
- Permission-Based Access Control - Role-based routing and feature access
- LiveKit Simulation Preview - Test simulations in real time
- Credit Monitoring - Track simulation credits and usage
- Document Search - Advanced search for mental health resources
- Category Filtering - Browse by topic or resource category
- Infinite Scroll - Seamless result loading
- Responsive Design - Optimised for desktop and mobile
- Shared UI Library (
libs/ui-shared) - Common components, feature flags, and logger - Nx Monorepo - Unified build, test, and lint tooling across all applications
- Docker Compose - Single command to start all three services
"docker-credential-desktop: executable file not found"
./scripts/docker-switch.sh colimaPort already in use
# Find and kill the process using the port
lsof -ti:3000 | xargs kill -9
lsof -ti:8080 | xargs kill -9
lsof -ti:8081 | xargs kill -9Dependencies out of sync
# Local development
npm install
# Docker (rebuild base image)
docker build -f Dockerfile.deps -t ally-web/deps:dev . --no-cacheStale node_modules
rm -rf node_modules package-lock.json
npm install# Build base dependencies image (run once or when package.json changes)
docker build -f Dockerfile.deps -t ally-web/deps:dev .
# Start all services
docker compose up
# Start in detached mode (background)
docker compose up -d
# Start specific service
docker compose up helpline
# Rebuild services after code changes
docker compose build
# Stop all services
docker compose down
# View logs
docker compose logs -f
# Clean up everything (including volumes)
docker compose down -vFor contributing guidelines, refer to CONTRIBUTING.md.
For issues, questions, or contributions:
- Open an issue on GitHub
- Contact the development team
- Colima Setup: See docs/colima.md
- Prompt display names (meta JSON): See docs/prompts-meta.md
- Scripts: See scripts/README.md