Skip to content

jaysreeb/chat_app

Repository files navigation

Chat App

A real-time chat application built with Node.js, TypeScript, PostgreSQL and WebSockets.

Tech Stack

  • Node.js + Express + TypeScript
  • PostgreSQL
  • JWT Authentication
  • WebSockets (ws library)
  • Docker + Docker Compose

Running locally

  • git clone git@github.com:jaysreeb/chat_app.git
  • cd chat_app
  • docker compose up --build

Creating the websocket Server in websocket/server.ts

    1. Extract token from query string
    1. Verify the Token
    1. Register the Connection
    1. Tell the user they're connected
    1. Handle Incoming messages
    1. Handle disconnect
    1. If recipient is online, deliver immediately
    1. Confirm delivery to sender
    1. Recipient offline — tell sender
    1. Next step: persist to PostgreSQL

About

chat_app using Type, Node, Pg

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors