All Projects → aasailan → egg-nideshop

aasailan / egg-nideshop

Licence: other
使用egg框架重写的nideshop后台

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to egg-nideshop

Egg Sequelize
Sequelize for Egg.js
Stars: ✭ 540 (+1002.04%)
Mutual labels:  sequelize, egg
Egg Commerce
Stars: ✭ 264 (+438.78%)
Mutual labels:  sequelize, egg
z
基于 MidwayJS(EggJS) + TypeScript 的多模块应用 [ NodeJS 版 ]
Stars: ✭ 122 (+148.98%)
Mutual labels:  sequelize, egg
Egg 24time
A Twitter-like news and social server for Egg. 微信小程序社区全栈解决方案
Stars: ✭ 493 (+906.12%)
Mutual labels:  sequelize, egg
mall-by-react
一个react商城客户端和egg服务端
Stars: ✭ 22 (-55.1%)
Mutual labels:  sequelize, egg
egg-userservice
userservice plugin for egg
Stars: ✭ 21 (-57.14%)
Mutual labels:  egg
egg-vue-typescript-boilerplate
Egg Vue TypeScript Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 69 (+40.82%)
Mutual labels:  egg
sequelize-guard
An Authorization library for Sequelize.js
Stars: ✭ 26 (-46.94%)
Mutual labels:  sequelize
nodejs-with-postgres-api-example
k8s course example - node.js app with Postgres, Hapi.js and Swagger
Stars: ✭ 59 (+20.41%)
Mutual labels:  sequelize
docker
Egg official docker image
Stars: ✭ 26 (-46.94%)
Mutual labels:  egg
EvaEngine.js
A micro service development engine for node.js
Stars: ✭ 31 (-36.73%)
Mutual labels:  sequelize
egg-view-vue-ssr
Egg Vue Server Side Render (SSR) Plugin
Stars: ✭ 90 (+83.67%)
Mutual labels:  egg
sequelize-adapter
Sequelize adapter for Casbin
Stars: ✭ 51 (+4.08%)
Mutual labels:  sequelize
rankr
🇰🇷 Realtime integrated information analysis service
Stars: ✭ 21 (-57.14%)
Mutual labels:  sequelize
xlong-website-cms
基于Egg + Vue + Webpack 开发的多页面和单页面服务端客户端渲染的企业CMS系统
Stars: ✭ 52 (+6.12%)
Mutual labels:  egg
egg-session
session plugin for egg
Stars: ✭ 48 (-2.04%)
Mutual labels:  egg
nest-blog-api
Blog Web API with NestJs, Postgres, and Sequelize ORM
Stars: ✭ 69 (+40.82%)
Mutual labels:  sequelize
egg-y-validator
☯️ Egg Magic Validator (Egg 魔法验证工具)
Stars: ✭ 30 (-38.78%)
Mutual labels:  egg
think-sequelize
Sequelize Extend for ThinkJS 3.x
Stars: ✭ 13 (-73.47%)
Mutual labels:  sequelize
egg-nuxt-blog
Nuxt.js(web端) + Egg.js(api 服务) + Vue.js(管理后台)+ ElementUI(通用组件库)服务器渲染(SSR)搭建的个人博客系统
Stars: ✭ 16 (-67.35%)
Mutual labels:  egg

egg-nideshop

本项目使用egg框架重写nideshop开源商城的服务端,网络接口与原版的nideshop服务端几乎完全一样。可以配合nideshop小程序端项目进行联调(特别提醒:由于小程序sdk升级,原版的nideshop小程序端项目的用户登录功能已经无法使用,我对用户登录部分代码做了修改,修改后的小程序项目点此到达

本项目要点:

  • 项目模板基于egg官方脚手架的ts模板
  • 技术栈:typescript + egg + Sequelize + mysql
  • 使用jwt + egg-userrole完成会话控制
  • 所有请求需要做参数校验
  • 测试数据来源于 NideShop商城 项目
  • 针对大部分controller提供单元测试
  • 本项目使用git flow工作流进行管理,请大家选择master分支进行clone

本地开发环境配置

本地运行

  1. git clone https://github.com/aasailan/egg-nideshop.git

  2. 使用navicat等工具创建egg-nideshop数据库,并运行sql/egg-nideshop.sql文件。注意数据库字符编码为utf8mb4

  3. config/config.local.ts 中修改数据库配置,默认配置如下:

    config.sequelize = {
        dialect: 'mysql',
        database: 'egg_nideshop',
        host: 'localhost',
        port: '3306',
        username: 'root',
        password: '12345678',
        // 数据表名前缀
        tablePrefix: 'nideshop_',
      };
  4. 填写小程序信息,配置如下(微信支付功能还未实现):

    const config: DefaultConfig = {};
    config.wechat = {
      // 小程序appid
      appid: '', 
      // 小程序secret
      secret: '', 
    
      mch_id: '',
      partner_key: '',
      notify_url: '',
    };
  5. 安装依赖并启动

    npm install
    npm run dev
  6. egg默认监听7001端口,与nideshop小程序项目进行联调时,请记得将nideshop小程序项目的api端口改为7001。

调试

在vscode中安装eggjs拓展,在项目安装依赖后,按f5进入debug模式。按shift + f5 退出debug模式

生成type文件

npm run type

运行测试用例

npm run test-local

Requirement

  • Node.js 8.x
  • Typescript 2.8+

项目目录说明

  • app文件夹:egg工程源码目录
  • config:egg工程配置目录
  • sql:数据表与测试数据文件,其中egg-nideshop.sql是整体文件,其余子文件夹是拆分出的各个数据表文件。
  • test:测试用例文件夹
  • typings:项目类型生命文件夹

下一步计划

  • 完成支付功能
  • 编写docker-compose文件,实现docker部署
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].