• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A basic real time chat app using React, Socket.io and Cosmic JS

React Chat App

Screencast

This is an example of a basic real time chat app using React, Socket.io and Cosmic JS. This example consists of the following:

  1. React for UI
  2. Babel for ES6 and JSX transformation
  3. Webpack for bundling
  4. Socket.io for real-time communication
  5. Cosmic JS for saving and returning messages from a cloud-hosted API

The following dev tools are used:

  1. ESLint to make sure our code is consistent
  2. React Hot Loader for instant updates on save

Install

Run the following commands to install the app:

git clone https://github.com/tonyspiro/react-chat-app
cd react-chat-app
npm install

Run in production

Run the following command to run the app in production:

npm start

View the app running in production at http://localhost:3000

Run in development

Run the following commands to run the app in development with hot reloading:

npm start server

and in another terminal tab run:

npm run development

View the app running in development at http://localhost:8080

Configure your own chat app

  1. Set up a bucket in Cosmic JS with an object type of messages.
  2. Edit config.js:
// config.js
export default {
  bucket: {
    slug: 'your-bucket-slug',
    type_slug: 'messages'
  },
  server: {
    host: process.env.APP_URL || 'http://localhost:3000'
  }
}

More Repositories

1

react-universal-blog

A universal blog app built using React, Express and Cosmic
JavaScript
158
star
2

blackjack

This is a blackjack program built using HTML5, JQuery and CSS.
CSS
46
star
3

easy-mobx-example

Easy MobX + React Example
JavaScript
43
star
4

tonyspiro.com-react

My blog (tonyspiro.com) built using React and the Cosmic JS content API.
JavaScript
42
star
5

react-flux-cosmicjs

Data-driven React application using the Flux pattern and the Cosmic JS browser client.
JavaScript
38
star
6

easy-flux-example

An easy React application that demonstrates basic usage of the Flux architecture pattern.
JavaScript
35
star
7

shorti

Shorti helps you style your React components by rendering short-hand "class names" into inline styles.
JavaScript
22
star
8

react-typeahead-search

A basic search app that shows a bootstrap modal search form and, on typing, pulls in search results via ajax and React.
JavaScript
13
star
9

gulp-mamp

Gulp MAMP allows you to configure, start and stop your MAMP server from the terminal.
JavaScript
11
star
10

progressive-image

Progressive Image is a JQuery plugin that progressively adds larger images based on the current browser width.
JavaScript
6
star
11

react-es6-app-example

This is an example app that uses react in es6 to pull information from a github user with a little Browser Sync thrown in for easy development.
JavaScript
4
star
12

grunt-html5-boilerplate

An HTML5 boilerplate with Grunt task managment functionality
JavaScript
4
star
13

php-gulp-boilerplate

PHP Gulp Boilerplate gives you everything you need to get started with a well-organized, modern web application.
PHP
3
star
14

gatsby-starter

JavaScript
1
star
15

something-awesome-gatsby

🚀⚡️ Blazing fast blog built with Gatsby and Cosmic JS 🔥
JavaScript
1
star
16

vue-blog-netlify-template

JavaScript
1
star
17

vue-blog-cosmicjs

JavaScript
1
star
18

twitter-class-php

This is an easy php class to pull search results from twitter
PHP
1
star
19

another-gatsby-test-site

🚀⚡️ Blazing fast blog built with Gatsby and Cosmic JS 🔥
JavaScript
1
star
20

tony-spiro-netlify

JavaScript
1
star