Giter Site home page Giter Site logo

allchat's Introduction

allChat

The project allChat is one of components of project hifi_wechat which based on nodejs express frame, wechat SDK and socket.io. In this project I rewrite it with egg.js, added some new features and optimized. I only spend 3 days to re-construct the project, maybe there are many problems remained. If you find any bugs, wish you can concat me or help me fix it. Thanks!.

You might need to know egg.js and webpack first.

QuickStart

It's easy to start allChat on your computer. Please notice that my nodejs version is 8.9.0.

  1. Fetch allChat.
$ git clone https://github.com/PorYoung/allChat.git
  1. Go to the project directory and install dependencies.
$ npm i
  1. You might need use webpack-cli to build static files.
$ npm i webpack-cli -g
$ npm run build
  1. run egg.js project
$ npm run dev
  1. Don't forget the database which I used mongodb, install it and start it directly, the connection configuration is in config/config.default.js. It's egg-mongoose here, which help you use mongoose in egg app.
config.mongoose = {
  client: {
    url: 'mongodb://127.0.0.1/chat',
    options: {},
  },
};

see [egg docs][egg] and webpack docs for more detail.

Npm Scripts

  • Use npm run lint to check code style.
  • Use npm test to run unit test.
  • Use npm run autod to auto detect dependencies upgrade, see autod for more detail.
  • Use npm run watch to start webpack-cli watch.

Structure

  • app: server end code, see egg Directory Structure for more detail.
  • build: which contain the webpack config file and web front-end code. See webpack docs for configuration help.
  • .vscode: VS Code configuration, that's not important.
  • config: egg app configuration, see egg Configuration for more detail.
  • log: log files.
  • test: egg unit test.

Some Dependencies

  • socket.io: websocket frame, FEATURING THE FASTEST AND MOST RELIABLE REAL-TIME ENGINE, see its website.
  • egg-mongoose: use mongoose in egg.
  • egg-ejs: use ejs to render html file.
  • bootstrap, jquery and other the third part plugin for web front pages, and underscroe can be removed when you replace _.compile() with ${}.
  • etc.

Other Tips

  • the Server default listening port is 7001
  • the socket client connect to host 127.0.0.1, you might to modify it if you need to run not at your local computer.
  • waiting for updating...

Questions & Suggestions

Please open an issue here.

License

MIT

allchat's People

Contributors

poryoung avatar

Stargazers

 avatar  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.