Healthcare PWA Chat Integration
Challenge
A healthcare web application connecting clients and doctors was missing its core communication feature — a real-time user chat — with a hard deadline approaching. The existing codebase was a React PWA with a NestJS/Amplication backend, both lacking tests or quality gates. The client had no tooling strategy and needed both a technology recommendation and a full implementation.
Solution
We researched and evaluated chat solutions with React support (including GetStream.io and RocketChat), presented findings to the client, and led the integration of RocketChat. We extended the existing Docker Compose setup to run RocketChat against the project's existing MongoDB instance, disabled self-registration, and implemented automatic user creation in RocketChat on login and registration. Proxy endpoints were built in NestJS to intercept chat-room creation and messaging with business logic, covered by Jest unit tests. On the frontend, we implemented a custom RocketChat WebSocket connection from scratch to enable real-time messaging within the app's existing UI design.
Impact
The chat feature was delivered on time and fully integrated into the existing application. NestJS endpoints were covered with Jest unit tests — the first quality-assurance layer in the project. The solution kept user management centralised and real-time messaging performant through a direct WebSocket connection.
Technology Stack
Project Overview
This NDA-protected project involved integrating a real-time chat system into an existing React progressive web application serving clients and healthcare professionals. The app managed user data for both roles and required a communication channel between them. The project scope was narrowly focused: select the right chat technology and implement it end-to-end under a tight deadline.
Key Features
- RocketChat integrated via Docker into the existing infrastructure
- Automatic RocketChat user provisioning on app registration and login
- NestJS proxy endpoints for chat-room creation, message handling, and business logic
- Custom WebSocket client implementation for real-time messaging in the React frontend
- Jest unit tests on all new NestJS endpoints using dependency injection and module mocking
Technical Highlights
The backend was generated with Amplication and already used MongoDB, which made it straightforward to share the same database instance with RocketChat. Rather than using RocketChat's pre-built UI, we implemented the WebSocket connection manually to match the client's existing interface design. NestJS's module system and dependency injection made it easy to write isolated unit tests for the new proxy endpoints, providing the first test coverage the project had seen.
Ready to Create Something Extraordinary?
Let's discuss how we can help solve your challenges and build something that drives real business value.
Get in touch