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.
It's easy to start allChat on your computer. Please notice that my nodejs version is 8.9.0.
- Fetch allChat.
$ git clone https://github.com/PorYoung/allChat.git
- Go to the project directory and install dependencies.
$ npm i
- You might need use
webpack-clito build static files.
$ npm i webpack-cli -g
$ npm run build
- run egg.js project
$ npm run dev
- 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'segg-mongoosehere, 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.
- Use
npm run lintto check code style. - Use
npm testto run unit test. - Use
npm run autodto auto detect dependencies upgrade, see autod for more detail. - Use
npm run watchto start webpack-cli watch.
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.
socket.io: websocket frame, FEATURING THE FASTEST AND MOST RELIABLE REAL-TIME ENGINE, see its website.egg-mongoose: use mongoose in egg.egg-ejs: useejsto render html file.bootstrap,jqueryand other the third part plugin for web front pages, andunderscroecan be removed when you replace_.compile()with${}.- etc.
- 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...
Please open an issue here.