Coder Social home page Coder Social logo

nodejs-private-webchat's Introduction

Realtime Chat with Node.js

Realtime chat system with Node.js and the socket.io library

Requirements

All dependencies are declared in the package.json file. They are not included in the zip and you will have to run npm install to get them.

Dependencies

  • express.js
  • gravatar
  • socket.io
  • ejs

Buzz Words

What's included

Within the download you'll find the following directories and files, You'll see something like this:

nodejs-private-webchat/
├── public/
│   ├── css/
│   │   ├── bootstrap.icon-large.min.css
│   │   └── stylesheet.css
│   ├── img/
│   │   ├── glyphicons.png
│   │   ├── nodejslogo.png
│   │   └── unnamed.jpg
│   └── js/
│   │   ├── chat.js
│   │   └── moment.min.js
├── views/
│   ├── chat.html
│   └── home.html
├── app.js
├── config.js
├── routes.js
└── package.json

Testing

To begin running locally make sure you have Node.js installed and fork/clone this repo.

Navigate to directory

cd nodejs-private-webchat

Install dependencies

npm install

Start app on local server

node app.js

Deploying

Setup

  1. Create an account, if you don’t have one already.
  2. Install the Heroku toolbelt for your operating system. It will give you access to the heroku command from a terminal window.
  3. Initialize an empty git repository (explained below)
  4. Push your code to Heroku. This will deploy it and give you a URL which you can share with your friends.

How to deploy

Creating a git repo

git init

Create a new empty text file named .gitignore with the following content:

node_modules/

Create a new empty text file named Procfile with the following content:

web: node app.js

Then commit the changes with these commands:

git add Procfile
git commit -m 'Added a procfile'

Pushing to Heroku

First you need to login to heroku from the command line tool:

heroku login

Add your ssh key if one is not auto generated.

heroku keys:add

Create a new heroku application from the code in this folder:

heroku create

finally, push code.

git push heroku master

Your application code was sent to heroku, where their servers will process your package.json file and install all libraries that your app needs. Do this every time you need to upload a new version of the code (you must have made a commit beforehand). All that is left, is to enable websockets so that our real-time chat can work

heroku labs:enable websockets

Open it in a tab in your default browser.

heroku open

License

The MIT License

Copyright (c) 2014 Korben Carreno

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

nodejs-private-webchat's People

Contributors

korbenc avatar

Stargazers

 avatar

Watchers

 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.