A real-time chat application built with Node.js, TypeScript, PostgreSQL and WebSockets.
- Node.js + Express + TypeScript
- PostgreSQL
- JWT Authentication
- WebSockets (ws library)
- Docker + Docker Compose
- git clone git@github.com:jaysreeb/chat_app.git
- cd chat_app
- docker compose up --build
-
- Extract token from query string
-
- Verify the Token
-
- Register the Connection
-
- Tell the user they're connected
-
- Handle Incoming messages
-
- Handle disconnect
-
- If recipient is online, deliver immediately
-
- Confirm delivery to sender
-
- Recipient offline — tell sender
-
- Next step: persist to PostgreSQL