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-cli
to 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-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.
- 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.
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
: useejs
to render html file.bootstrap
,jquery
and other the third part plugin for web front pages, andunderscroe
can 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.