Skip to content

Latest commit

 

History

History
97 lines (73 loc) · 5.5 KB

README.md

File metadata and controls

97 lines (73 loc) · 5.5 KB

WhatsApp-Clone-Server

The backend of an application is responsible for things like calculations, business logic, database interactions, and performance. Most of the code that is required to make an application work will be done on the backend.This part of the repository mainly deals with the server side implementation of the Whatsapp clone.

Following are the technologies used in order to construct this backend,

Other Platforms ✨

Refer the following links for platform specific implementation,

Heroku Deployment 🔥

Heroku runs the customer's apps in virtual containers which execute on a reliable runtime environment. Heroku calls these containers "Dynos." These Dynos can run code written in Node, Ruby, PHP, Go, Scala, Python, Java, or Clojure. Heroku also provides custom buildpacks with which the developer can deploy apps in any other language. Heroku lets the developer scale the app instantly just by either increasing the number of dynos or by changing the type of dyno the app runs in.

The Backend code has been deployed & made live via Heroku

MongoDb Deployment (mLab) 🔥

mLab is a fully managed cloud database service that hosts MongoDB databases. mLab runs on cloud providers Amazon, Google, and Microsoft Azure, and has partnered with platform-as-a-service providers.

The MongoDb databse code has been deployed & made live on mLab

Getting Started ✨

Install Dependencies

npm install express cors mongoose nodemon typescript config moment ts-node

Install MongoDb

MongoDB is a general purpose, document-based, distributed database built for modern application developers. MongoDB is a document database, which means it stores data in JSON-like documents.

$ brew tap mongodb/brew
$ brew install mongodb-community
$ brew services start mongodb-community

If you have a previous version of mongodb
$ brew services stop mongodb
$ brew uninstall mongodb

$ brew tap mongodb/brew
$ brew install mongodb-community
$ brew services start mongodb-community

For windows installation click here.

Install Socket.io

Socket.IO enables real-time bidirectional event-based communication which is used here for realtime transmission of data across all the active users.

npm install socket.io

Sample code:

io.on('connection', socket => {
  socket.emit('request', /* … */); // emit an event to the socket
  io.emit('broadcast', /* … */); // emit an event to all connected sockets
  socket.on('reply', () => { /* … */ }); // listen to the event
});

Check out their Github Link for more information.

Install JSON Web Token

JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.

npm install jsonwebtoken

Check out their Github Link for more information.

Start Server ⚡

Once the installation is completed as highlighted above you can now move on to start the server & experience the magic yourself.

cd web-server
nodemon start

Author ✍️

Yuvraj Pandey

I am a passionate Engineer which likes to push himself on various fronts of technologies.

For more exciting updates follow me,