Coder Social home page Coder Social logo

christophediprima / relay-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hungtuchen/relay-chat

0.0 2.0 0.0 185 KB

an chat example showing Relay with routing and pagination

License: MIT License

JavaScript 94.91% CSS 3.49% HTML 1.61%

relay-chat's Introduction

Relay Chat

Installation

npm install --global babel
npm install

Running

Start a local server:

npm start

Developing

Any changes you make to files in the js/ directory will cause the server to automatically rebuild the app and refresh your browser.

If at any time you make changes to data/schema.js, stop the server, regenerate data/schema.json, and restart the server:

npm run update-schema
npm start

Feature Highlight:

  1. use with relay-nested-routes and react-router to let multiple routes work and route params as query params

  2. using route params as global state variable (ex: currentThreadID), not ideal for now, but it shows a different possibility

  3. and a more complicated model structure as user-> threads-> messages

  4. pagination for messages

Advice

If you don't know much about GraphQL and Relay, I suggest you:

  1. To know GraphQL first (at least things before introspection part)
  2. Know how Relay connect to GraphQL (and the series below)
  3. Last, learn Relay (and the series below)

I tried these 3 steps in reverse, and I went step by step again.

relay-chat's People

Contributors

chentsulin avatar

Watchers

James Cloos avatar dip 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.