Code Monkey home page Code Monkey logo

egg-24time's Introduction

egg-24time

微信小程序社区功能全栈解决方案,配合以下项目使用:

egg-24time

后端使用Egg,Mysql,Redis,基于Nodejs开发,全套代码使用ES6编写

weapp-24time

微信小程序端

egg-weapp-sdk

egg的微信小程序的用户会话管理插件,客户端需配合腾讯云出品的qcloud-weapp-client-sdk使用,Redis保存会话信息


本示例包含:

  1. 微信小程序登录示例
  2. 进行带会话的网络请求示例
  3. 基于腾讯云COS上传图片或文件的示例
  4. 发送帖子,点赞,举报,删除帖子示例

QuickStart

Development

git clone https://github.com/seasonstar/egg-24time.git
cd egg-24time

Config Redis and Mysql on config/config.default.js

  config.redis = {
    client: {
      host: '127.0.0.1',
      port: '6379',
      password: '',
      db: '0',
    },
  };

  config.sequelize = {
    dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
    database: 'tftime',
    host: 'localhost',
    port: '3306',
    username: 'root',
    password: '',
  };

  config.weappSDK = {
    appId: '', // your weapp appId
    appSecret: '', // weapp appSecret
  };

  // Qcloud Cloud Object Storage
  config.cos = {
    secretId: '',
    secretKey: '',
    appId: '',
    bucket: '',
    folder: '',
  };

Import test data into Mysql

mysql -u root -p  < db.sql
$ npm install
$ npm run dev
$ open http://localhost:7001/

Deploy

Use EGG_SERVER_ENV=prod to enable prod mode

$ EGG_SERVER_ENV=prod npm start

or EGG_SERVER_ENV=prod nohup node index.js > stdout.log 2> stderr.log & run quietly

npm scripts

  • Use npm run autod to auto detect dependencies upgrade
  • Use npm run lint to check code style
  • Use npm test to run unit test

Credits && Inspiration

cos-auth

wafer-node-server-sdk

LICENSE

MIT

Please Open Issues if you have troubles.

egg-24time's People

Contributors

seasonstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

egg-24time's Issues

npm install 报错

npm WARN deprecated [email protected]: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm ERR! Unexpected end of JSON input while parsing near '...4.0","tough-cookie":"'

test data

你好,关于这个导入测试数据不是很明白啊
Import test data into Mysql
mysql -u root -p < db.sql
从哪里导的?

项目运行起来,但是点赞,评论都会出这个登录的问题,请问是要注意哪里配置?THX!

服务器报错:
2017-08-06 01:06:40,872 ERROR 26435 [-/127.0.0.1/-/2ms POST /v1/posts/2016/like] nodejs.Error: ERR_LOGIN_FAILED
at LoginServiceError (/data/egg-24time/node_modules/egg-weapp-sdk/lib/auth/login-service-error.js:5:5)
at LoginService. (/data/egg-24time/node_modules/egg-weapp-sdk/lib/auth/login-service.js:54:23)
at throw (native)
at onRejected (/data/egg-24time/node_modules/co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
type: 'ERR_INVALID_SESSION'

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.