Loading repository dataβ¦
Loading repository dataβ¦
Bekhx / repository
π΄ This is a real time chat application built with Node.js, Express.js, Typescript, PostgreSQL, Redis.
$ npm install -g ts-node@10.5.0
$ npm install -g nodemon
$ npm install -g db-migrate
$ npm install -g db-migrate-pg
Before starting, install docker-compose to your machine and start docker containers:
$ docker-compose up
# Create tables
$ npm run up
# Delete tables
$ npm run down
$ npm install
$ npm run start:dev
Message send: type JSON
{
"room": "2d52e031-7039-48bb-8052-056649670bd1",
"interlocutorId": 2,
"message": "Hi, I'm Robert Deniro"
}
Message receive: type JSON
{
"id": 10,
"room": "2d52e031-7039-48bb-8052-056649670bd1",
"date": "2022-08-09T09:55:22.753Z",
"message": "Hi, I'm Robert Deniro",
"filePath": null,
"from": 4,
"to": 2
}
File send: type JSON
{
"room": "2d52e031-7039-48bb-8052-056649670bd1",
"interlocutorId": 2,
"file": "text file",
"extension": "txt"
}
File receive: type JSON
{
"id": 9,
"room": "2d52e031-7039-48bb-8052-056649670bd1",
"date": "2022-08-09T08:15:59.816Z",
"message": null,
"filePath": "http://localhost:8050/files/a39d83eb-ad2d-4182-a270-5c576d29e340.txt",
"from": 4,
"to": 2
}