Backend server code for a simple chat application using HTTP long polling instead of Websockets. Written in Nodejs using ExpressJS.
(Please note, this is the server repo, for frontend client, visit : chat-app-frontend)
-
Make sure NodeJS v12.x is installed along with npm (node package manager)
-
Make sure mysql v8.x is installed on your local.
- Clone Repository and checkout
git clone https://github.com/shivamshekhar/chat-app-backend && cd chat-app-backend
- Install Gulp CLI
sudo npm i -g gulp
- Install modules
npm i
- Run Db migrations
sudo mysql -u root -p < ./scripts/mysql/db.sql
- Run app
npm run start
- Verify that app is running successfully by visiting following url in browser
http://localhost:4000/test
If app is running successfully, you'll see following message
{
message : "App is running successfully"
}
Made a frontend web client for this server.Implement more functionality like adding a friend/contact, etc.- Improve the auth and session token logic and make it more secure.
- Improve long polling logic to make it work in cluster mode.
- Make an android client.
Reformat the code, and use Typescript instead of NodeJS.- Introduce clustering to run multiple processes.
Shivam Shekhar
[email protected]