/fiora

An interesting chat application power by koa, react and react-native.

Primary LanguageJavaScript

Language: 简体中文 | English

Fiora

Fiora is a web chat application. Made by node.js, koa, react.

Function

  1. Register user, create group, join group, private chat, group chat
  2. Support text, image, code, url types of message
  3. Desktop notification, sound notification, notification switch
  4. Customize avatar, collect expression, customize group announcement
  5. Limit message length, message frequency
  6. A simple plugin system

Installation

The project is powered by node.js(>= 6.0, recommend use 6.9.1) and mongodb database. To install node.js (For China mirror). To install mongodb.

  1. Clone this repository
    git clone git@github.com:yinxin630/fiora.git
  2. Go to repository directory and run
    npm install
  3. Create config file from simple config. The localServer, localPort, database, jwtSecret is necessary.
    cp config/config.simple.js config/config.js.
  4. Set database and other params in config file
  5. Run the project
    npm start
  6. Open http://localhost:8080/webpack-dev-server/ and enjoy it

Script

  • start: start backend server, redux devtool server, pc web webpack dev server and mobile web webpack dev server
  • devPc: start pc web webpack dev server
  • devMobile: start mobile web webpack dev server
  • buildPc: build pc web release version
  • buildMobile: build mobile web release version
  • rnServer: start react native package server
  • android: start react native android client
  • ios: start react native ios client
  • eslint: run eslint check

Run Shot

目录结构

|-- [android]                 //react-native android directory
|-- [bin]                     //executable scripting tools
|    |-- develop.js           //back-end develop hot-reload support
|    |-- reduxDevServer.js    //redux-devtool local server
|-- [config]                  //project config
|    |-- config.simple.js     //simple config
|-- [ios]                     //react-native ios directory
|-- [public]                  //file server public root directory
|-- [src]                     //source
|    |-- client               //client source
|    |    |-- [action]        //redux action define
|    |    |-- [assets]        //resource
|    |    |-- [common]        //public component
|    |    |-- [middleware]    //message handle middleware
|    |    |-- [reducer]       //redux reducer define
|    |    |-- [rnMobile]      //react native client
|    |    |-- [util]          //tool function
|    |    |-- [webMobile]     //mobile web client
|    |    |-- [webPc]         //pc web client
|    |    |-- api.js          //web global api
|    |    |-- socket.js       //socket.io client
|    |    |-- store.js        //redux store define
|    |-- server               //server source
|    |    |-- [model]         //database model define
|    |    |-- [police]        //police
|    |    |-- [route]         //route define
|    |    |-- [util]          //tool function
|    |    |-- app.js          //entry
|-- [webpack]                 //webpack config
|    |-- webpackk.dev.js      //webpack dev config
|    |-- webpack.prod.js      //webpack prod config
|-- .babelrc                  //babel config
|-- .buckconfig               //react native need config
|-- .eslintignore             //eslint ignore config
|-- .eslintrc.json            //eslint rule config
|-- .flowconfig               //react native need config
|-- .gitignore                //git ignore config
|-- .watchmanconfig           //react native need config
|-- package.json              //npm
...

Contribute

If you want to add functionality or fix bug, please observe the following process.

  1. Fork this repository and clone the fork
  2. Install dependencies npm install
  3. Modify the code and check for bug
  4. Commit your code. If you get any error or warning from eslint, please fix it
  5. Create a pull request

Roadmap

v1.1

  • Mobile web support
  • Self message instead to add it when before send
  • Use chinese to format time

v1.2

  • Theme mechanism
  • Message encrypt mechanism
  • Nav bar optimize
  • Save user setting on server