Top Quality Products

What’s App Chat Clone – An Ionic Framework ,Socket.io and Nodejs Full Hybrid App

2.61
Expert ScoreRead review

$20.00

Added to wishlistRemoved from wishlist 0
Add to compare

515 sales

LIVE PREVIEW

What’s App Chat  Clone – An Ionic Framework ,Socket.io and Nodejs Full Hybrid App

Review: What’s App Chat Clone – An Ionic Framework, Socket.io, and Nodejs Full Hybrid App

Introduction:

Are you looking for a fully functional WhatsApp chat clone? Look no further! What’s App Chat Clone is a robust, feature-rich, and scalable app built using the Ionic Framework, Socket.io, and Nodejs. With a perfect score of 2.61, this app is a super set of all hybrid apps available in the market. It’s not just a template or a basic component; it’s a fully fledged WhatsApp chat code with tons of component integration, socket.io, and everything you need to create a top-notch messaging app.

Key Features:

  • 100% source code for Ionic, Node.js for server-side scripting, and MongoDB for storing contacts and user profiles
  • Uses SQL-Lite plugins to store chat messages
  • Supports offline chat with stored messages in MongoDB
  • Native Facebook integration code for registration
  • Phone number validation against country
  • Contact syncing with server using CouchDB and PouchDB
  • Local push message integration
  • Web-services written with Node.js and Socket.io for sending one-to-one messages
  • UI/UX based on SASS and Material Design

What You’ll Get:

  • 100% white-labeled clone code of WhatsApp with Ionic Framework-based frontend and server-side Socket.io component + Node.JS API Layer along with Mongo Database
  • Layered PSDs
  • Documentation on how to set up and reskin
  • Freebies: Bug relate to UI/UX and loading, addition of CRM Template worth $20, and a basic hosting package

Change Log:

The app has a changelog, which is regularly updated to reflect the latest bug fixes and enhancements. Version 1.2, released on 25 May 2016, fixed offline message bug, displayed latest chats on top, added missing folders, and resolved miscellaneous issues. Version 1.1, released on 6 May 2016, included several bug fixes, enhancements, and new features such as current chat messages displayed on top of the list, share images bug, and more.

Hosting and Performance:

For hosting, I recommend using a cloud hosting service with 1 GB Ram or above, with SSH connectivity. Some recommended hosting services include Digital Ocean, Linode, and Heroku.

Conclusion:

What’s App Chat Clone is an outstanding app that offers unparalleled functionality, scalability, and ease of use. With its robust server-side technology, socket.io, and Material Design UI/UX, this app is perfect for developers, entrepreneurs, and businesses looking to create a top-notch messaging app. The app’s changelog and regular updates ensure that it stays ahead of the curve and is always in line with the latest best practices.

Score: 2.61

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “What’s App Chat Clone – An Ionic Framework ,Socket.io and Nodejs Full Hybrid App”

Your email address will not be published. Required fields are marked *

Introduction

In this tutorial, we will be building a WhatsApp chat clone using Ionic Framework, Socket.io, and Node.js. The app will have a simple chat interface where users can send and receive messages, similar to WhatsApp. We will be building a full hybrid app, meaning it will run on both desktop and mobile devices.

The technologies we will be using are:

  1. Ionic Framework: A popular framework for building hybrid mobile apps using web technologies such as HTML, CSS, and JavaScript.
  2. Socket.io: A JavaScript library for real-time communication between the client and server.
  3. Node.js: A JavaScript runtime environment for building the server-side logic.

Prerequisites

Before starting this tutorial, make sure you have the following installed on your computer:

  • Node.js
  • npm (Node Package Manager)
  • Ionic Framework
  • A code editor or IDE (Integrated Development Environment)
  • A text editor

Step 1: Create a new Ionic Project

Open a terminal or command prompt and run the following command to create a new Ionic project:

ionic start whatsapp-clone blank

This will create a new directory called whatsapp-clone containing the basic structure for an Ionic app.

Step 2: Set up the Server

Create a new directory called server inside the whatsapp-clone directory:

mkdir server

Inside the server directory, create a new file called index.js:

// server/index.js

const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);

app.use(express.static('public'));

let users = [];

server.listen(3000, () => {
  console.log('Server started on port 3000');
});

io.on('connection', (socket) => {
  console.log('New client connected');

  socket.on('disconnect', () => {
    console.log('Client disconnected');
  });

  socket.on('message', (data) => {
    console.log(`Received message from ${data.username}: ${data.message}`);

    io.emit('message', data);
  });

  socket.on('newUser', (data) => {
    console.log(`New user joined: ${data.username}`);
    users.push(data);

    io.emit('users', users);
  });
});

This code sets up an Express.js server that listens on port 3000. It also sets up Socket.io for real-time communication between the client and server.

Step 3: Create the Chat Interface

Inside the whatsapp-clone directory, create a new file called chat.page.html:

<!-- chat.page.html -->

<ion-header>
  <ion-toolbar>
    <ion-title>Chat</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-list>
    <ion-item *ngFor="let message of messages">
      {{ message.text }}
    </ion-item>
  </ion-list>
  <ion-input [(ngModel)]="newMessage" placeholder="Type a message"></ion-input>
  <ion-button (click)="sendMessage()">Send</ion-button>
</ion-content>

This HTML file defines the basic layout for the chat interface.

Step 4: Add the Chat Logic

Inside the chat.page.ts file, add the following code:

// chat.page.ts

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { WebSocket } from 'ws';
import { ChatService } from './chat.service';

@IonicPage()
@Component({
  selector: 'page-chat',
  templateUrl: 'chat.page.html',
})
export class ChatPage {

  newMessage: string;
  messages: any[];

  constructor(private navCtrl: NavController, private navParams: NavParams, private chatService: ChatService) {
    this.messages = [];
  }

  ionViewDidLoad() {
    this.chatService.connect();
  }

  sendMessage() {
    if (this.newMessage) {
      this.chatService.sendMessage(this.newMessage);
      this.newMessage = '';
    }
  }

}

This code sets up the chat page and defines the sendMessage method that sends a message to the server using the ChatService class.

Step 5: Add the Chat Service

Inside the chat.service.ts file, add the following code:

// chat.service.ts

import { Injectable } from '@angular/core';
import { WebSocket } from 'ws';

@Injectable()
export class ChatService {

  private socket: WebSocket;

  connect() {
    this.socket = new WebSocket('ws://localhost:3000');

    this.socket.onopen = () => {
      console.log('Connected to the server');
    };

    this.socket.onmessage = (event) => {
      this.messages.push(JSON.parse(event.data));
    };

    this.socket.onerror = () => {
      console.log('Error occurred while connecting to the server');
    };

    this.socket.onclose = () => {
      console.log('Connection to the server closed');
    };
  }

  sendMessage(message: string) {
    this.socket.send(JSON.stringify({ text: message, username: 'John' }));
  }

}

This code sets up the ChatService class that establishes a connection to the server using WebSocket and defines the sendMessage method that sends a message to the server.

Step 6: Add the User List

Inside the chat.page.html file, add the following code:

<!-- chat.page.html -->

<ion-list>
  <ion-item *ngFor="let user of users">
    {{ user.username }}
  </ion-item>
</ion-list>

This HTML file defines the user list that will be displayed at the top of the chat interface.

Step 7: Add the User List Logic

Inside the chat.page.ts file, add the following code:

// chat.page.ts

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { WebSocket } from 'ws';
import { ChatService } from './chat.service';

@IonicPage()
@Component({
  selector: 'page-chat',
  templateUrl: 'chat.page.html',
})
export class ChatPage {

  newMessage: string;
  messages: any[];
  users: any[];

  constructor(private navCtrl: NavController, private navParams: NavParams, private chatService: ChatService) {
    this.messages = [];
    this.users = [];
  }

  ionViewDidLoad() {
    this.chatService.connect();
  }

  sendMessage() {
    if (this.newMessage) {
      this.chatService.sendMessage(this.newMessage);
      this.newMessage = '';
    }
  }

  get users() {
    return this.chatService.users;
  }

}

This code sets up the user list and defines the get users method that retrieves the list of users from the ChatService class.

Step 8: Run the App

Run the following command to start the app:

ionic run android

This will start the app on an Android emulator or a physical Android device.

Conclusion

In this tutorial, we built a WhatsApp chat clone using Ionic Framework, Socket.io, and Node.js. We established a connection to the server using WebSocket, sent and received messages, and displayed the user list. With this tutorial, you now have a basic understanding of how to build a real-time chat app using Ionic and Socket.io.

What's App Chat Clone – An Ionic Framework, Socket.io and Nodejs Full Hybrid App Settings

Database Configuration

To configure the database, go to the config.js file located in the server folder. Add the following settings:

module.exports = {
    db: {
        host: 'your_database_host',
        user: 'your_database_username',
        password: 'your_database_password',
        database: 'your_database_name'
    }
};

Socket.io Configuration

To configure Socket.io, go to the server/socket.js file. Add the following settings:

var io = require('socket.io').listen(server);
var db = require('./config').db;

io.set('transports', ['websocket', 'polling', 'flashsocket', 'htmlfile', 'hybi']);

io.on('connection', function(socket){
    console.log('User connected');

    socket.on('disconnect', function(){
        console.log('User disconnected');
    });

    socket.on('message', function(data){
        var message = {
            id: Date.now(),
            text: data.text,
            sender: data.sender,
            recipients: data.recipients,
            isRead: false
        };

        var recipientsIds = message.recipients;

        message = messageFilter(message, message.text);

        for (var i = 0; i < recipientsIds.length; i++) {
            if (recipientsIds[i]!= socket.request.session.user._id) {
                io.to(recipientsIds[i]).emit('message', message);
            }
        }

        Message.create(message).then(function(message) {
            db.collection('chats').update({users: db.collection('users').find({}).fetch().map(function(user) {return user._id;}).join(',')}, {
                $push: {'messages': message._id}
            }).then(function() {
                console.log('Message pushed to database');
            }).catch(function(err) {
                console.log('Error pushing message to database', err);
            });
        }).catch(function(err) {
            console.log('Error saving message to database', err);
        });
    });

    socket.on('file', function(fileData, userId) {
        console.log('Received file', fileData, userId);
    });
});

function messageFilter(message, text) {
    message.text = cleanText(text);
    message.text = message.text.replace(/((http|https)://[^s]+)/gi, '');
    return message;
}

function cleanText(text) {
    var text = text.replace(new RegExp('<[a-z]+>', 'gi'), '');
    return text.replace(new RegExp('</[a-z]+>', 'gi'), '');
}

Node.js and Express.js Configuration

To configure Node.js and Express.js, go to the server/index.js file. Add the following settings:

var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('./socket').listen(server);

app.set('views', __dirname + '/views');
app.set('view engine', 'jade');

app.use(express.logger('dev'));
app.use(express.static(__dirname + '/public'));

app.use(express.json());
app.use(express.urlencoded());

var mysql = require('mysql');
var mongoose = require('mongoose');
var bcrypt = require('bcrypt');

app.get('/login', function(req, res) {
    res.render('login');
});

app.post('/login', function(req, res) {
    User.findOne({username: req.body.username}, function(err, user) {
        if (!err && user) {
            var valid = bcrypt.compareSync(req.body.password, user.password);
            if (valid) {
                req.session.user = user;
                res.json({message: 'success'});
            } else {
                res.json({message: 'failure'});
            }
        } else {
            res.json({message: 'failure'});
        }
    });
});

server.listen(3000, function() {
    console.log('Listening on *:3000');
});

Ionic App Configuration

To configure the Ionic app, go to the ionic.config.js file. Add the following settings:

module.exports = {
    "protractor.config": './protractor.config.js',
    "before_run": {
        "tasks": []
    }
};

protractor.config.js Configuration

To configure the Protractor configuration, go to the protractor.config.js file. Add the following settings:

exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    capabilities: {
        browserName: 'chrome'
    },
    specs: ['./e2e/**/*.e2e-spec.js']
};

Here are the features mentioned about this WhatsApp Chat Clone application:

  1. Fully functional WhatsApp chat code with Socket.io and Nodejs: The application is a full-fledged clone of WhatsApp with a robust architecture, using Socket.io, Nodejs, and MongoDB as the database.
  2. IONIC Framework based front-end: The application uses the Ionic Framework for the front-end development.
  3. Hybrid app: The app is a hybrid app that can run on both Android and iOS platforms.
  4. Native Facebook integration: The app integrates Facebook for registration.
  5. Phone number validation: The app validates phone numbers based on the country.
  6. Contact syncing: The app synchronizes contacts with the server using CouchDB and PouchDB.
  7. Offline chat: The app allows offline chatting, storing messages in MongoDB.
  8. Local push notifications: The app supports local push notifications.
  9. Web-services with Node.js: The app's web-services are written with Node.js.
  10. Socket.io implementation for one-to-one messaging: The app uses Socket.io for sending one-to-one messages.
  11. UI/UX design using SASS: The app's UI/UX is designed using SASS (CSS with superpowers).
  12. Customized Edit Profile screen: The app has a customized Edit Profile screen with options to change avatars and status messages.
  13. Addition of "Typing..." feature: The app includes a "Typing..." feature, notifying the user when the other person is typing a message.

Additional features:

  1. Login with Facebook
  2. Contact list management
  3. Search contact
  4. Pull to refresh
  5. Offline messaging bug fix
  6. Latest chats on top
  7. Current chat messages on top while chatting with multiple users

FREEBIES: The seller is offering some freebies, including a CRM template worth $20.

What’s App Chat  Clone – An Ionic Framework ,Socket.io and Nodejs Full Hybrid App
What’s App Chat Clone – An Ionic Framework ,Socket.io and Nodejs Full Hybrid App

$20.00

Shop.Vyeron.com
Logo
Compare items
  • Total (0)
Compare
0