This application demonstrates the use of WebSockets to build a simple chat application. It also showcases how NX Monorepos can be used to efficiently combine backend and frontend applications.
To run this application, follow these steps:
- Install all dependencies:
npm install
- Create a
.env
file in the root of the project
JWT_SECRET=YOUR_JWT_SECRET
WS_PORT=8765
API_PORT=3333
- Start both the frontend and backend services:
npm run start:star-chat
This application includes a basic implementation of JWT (JSON Web Tokens) for authentication. However, since users connect using only their username—without a password—the JWT implementation is somewhat redundant and does not provide real security.
For a production-ready application, consider implementing a proper authentication mechanism with password protection and secure token handling.