# zshop **Repository Path**: oldginger/zshop ## Basic Information - **Project Name**: zshop - **Description**: zshop是一个nodejs写的商城系统 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-03-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README zshop是一个nodejs写的商城系统,看完廖雪峰的[《javaScript全栈教程》](https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000)后,想练练手,已是开始踩坑之路。目前完成了首页,商品搜索,购物车,我的,登录,商品详情,结算等,后面将继续完善其它功能。完善后会把数据库的er图画出来。 在线预览效果地址:(pc浏览器请切换为手机模式)。部署在阿里云上面,`centOS 6.5 64位`,`1核cpu`,`1g内存`,`1m带宽`,`40g普通硬盘`,登录手机:18312345678,密码:123456。 一 部署方式:
1 安装`node.js`(7.6版本以上,因为要支持`async/await`);
2 安装`mysql`数据库(utf-8编码的配置),创建数据库`zshop`;
3 下载本工程文件,可修改数据库的用户名密码等连接配置(middleware目录下的`config-default.js`和`config-test.js`两个配置文件),在根目录下执行`npm install`下载依赖库,然后执行`node init-db.js`(初始化数据库表和表数据);
4 最后在工程根目录下执行`node app.js`,看到日志`app started at port 3000...`就代表启动成功了,浏览器访问(pc浏览器请切换为手机模式)。 二 涉及的技术框架:
1 前端:`weui.css`,`jquery`,`jquery.spinner`,`requirejs`,`swiper-4.1.6`,`vue`,`vue-resource`;
2 后端:`koa2`,`koa-bodyparser`,`koa-router`,`nunjucks`,`mime`,`mz`,`koa-compress`,`sequelize`,`mysql`,`koa-session2`,`log4js`,`moment`。 三 工程目录的主要结构:
|-zshop
   |-controllers         //controller
   |-html_template   //如果你只需要本项目的那些静态的html文件等
   |-middleware       //本项目的koa2的一些middleware
   |-models              //数据库实体
   |-service               //service
   |-static                 //静态文件目录,包括图片,js,css等,这部分可以部署在nginx
   |-utils                   //工具函数目录
   |-views                 //模板页面文件
   |-app.js                //程序主入口文件
   |-init-db.js           //执行这个可以初始化数据库表和表数据,谨慎执行
   |-init-sql.sql         //init-db.js执行的sql文件
   |-LICENSE            //MIT协议,拿走不谢
   |-package.json    //依赖的库 四 一些截图:
![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/1.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/2.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/3.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/4.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/5.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/6.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/8.jpg) ![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/9.jpg) 五 如果你觉得对你有所启发,star一下或者扫码请我喝杯咖啡,金额任意。
![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/7.png) 六 我的博客: