GithubHelp home page GithubHelp logo

mdb-webdev / angularjs-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from selmankahya/angularjs-chat

0.0 2.0 0.0 5.13 MB

A simple chat application written in AngularJS - using SockJS.

Home Page: http://selmanh.github.io/angularjs-chat/

ApacheConf 53.74% HTML 19.69% CSS 5.49% JavaScript 21.08%

angularjs-chat's Introduction

angularjs-chat

A simple chat application written in AngularJS - using SockJS (not using server-side socket library such as Socket.io).

-- For a complete overview of the project and features, see http://selmanh.github.io/angularjs-chat/

About

Currently, I am working on my Master's degree final project (Chrome Application - soon to be published on Chrome Store, you can find the source code here: link) and one of my assignments was to develop a multi-player word guessing game.

While I was looking for options to create a multi-player game with chat support in AngularJS, I realized that, in so many projects, NodeJS was serving the AngularJS application using ExpressJS as a web application framework, and it was using server-side socket libraries such as Socket.IO.

After carefully considering a few other alternatives, I decided to use SockJS which doesn't force to serve AngularJS files from the server. After playing around with it, I thought it might be useful for others to have a working application that use both AngularJS and SockJS and decided to create this application.

Details

I created a NodeJS server for this project. SockJS has implementations for other langugages as well, see https://github.com/sockjs.

Dependencies

SockJS

Taken from its readme:

SockJS is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.

Under the hood SockJS tries to use native WebSockets first. If that fails it can use a variety of browser-specific transport protocols and presents them through WebSocket-like abstractions.

For more details about the SockJS project, see https://github.com/sockjs/sockjs-client.

Issues

I am sure you can break the live server (http://angularjs-chat-server.aws.af.cm/), but please, just try not to do that :) This is a simple project to show you how to use AngularJS and SockJS to create interactive applications.

I tested the application using 2 browsers on the same computer. Sometimes when you quit chat on one browser, the connection on the other browser gets broken. Feel free to fix the issue :)

Installing Modules

  • First you need to install node_modules. Cd to node-server folder. $cd node-server

  • Execute $sudo npm install

  • Then, you need to install dependencies for our Angular application. Cd to angular-app folder. $cd angular-app

  • Execute $sudo npm install

  • And execute $sudo bower install

Running the app

  • Change directory to node-server folder $cd node-server

  • Start the Node server: $node app

  • Open another console and cd to angular-app folder $cd angular-app

  • Now, you can start the grunt server: $grunt serve

  • It will open the AngularJS app in your default browser. Have fun :)

Contact

angularjs-chat's People

Contributors

selmankahya avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.