{"id":13671584,"url":"https://github.com/halloffamezwx/zshop","last_synced_at":"2025-04-27T18:31:33.502Z","repository":{"id":200394288,"uuid":"111490934","full_name":"halloffamezwx/zshop","owner":"halloffamezwx","description":"zshop是一个nodejs写的商城系统","archived":false,"fork":false,"pushed_at":"2019-10-29T20:53:18.000Z","size":13588,"stargazers_count":252,"open_issues_count":4,"forks_count":63,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-11T09:43:50.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://120.78.200.74:3000/zshop/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halloffamezwx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-21T02:55:41.000Z","updated_at":"2024-10-23T17:38:03.000Z","dependencies_parsed_at":"2023-10-16T20:11:54.907Z","dependency_job_id":null,"html_url":"https://github.com/halloffamezwx/zshop","commit_stats":null,"previous_names":["halloffamezwx/zshop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halloffamezwx%2Fzshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halloffamezwx%2Fzshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halloffamezwx%2Fzshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halloffamezwx%2Fzshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halloffamezwx","download_url":"https://codeload.github.com/halloffamezwx/zshop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187206,"owners_count":21549601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:13.874Z","updated_at":"2025-04-27T18:31:28.486Z","avatar_url":"https://github.com/halloffamezwx.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"zshop是一个nodejs写的商城系统，看完廖雪峰的[《javaScript全栈教程》](https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000)后，想练练手，已是开始踩坑之路。目前完成了首页，商品搜索，购物车，我的，登录，商品详情，结算等，后面将继续完善其它功能。完善后会把数据库的er图画出来。\n\n在线预览效果地址：\u003chttp://120.25.167.14:3000/zshop/\u003e（pc浏览器请切换为手机模式）。部署在阿里云上面，`centOS 6.5 64位`，`1核cpu`，`1g内存`，`1m带宽`，`40g普通硬盘`，登录手机：18312345678，密码：123456。\n\n\u003cb\u003e一 部署方式：\u003c/b\u003e\u003c/br\u003e\n\n\u003cb\u003e\u003ci\u003e1\u003c/i\u003e\u003c/b\u003e 安装`node.js`（7.6版本以上，因为要支持`async/await`）；\u003c/br\u003e\n\u003cb\u003e\u003ci\u003e2\u003c/i\u003e\u003c/b\u003e 安装`mysql`数据库（utf-8编码的配置），创建数据库`zshop`；\u003c/br\u003e\n\u003cb\u003e\u003ci\u003e3\u003c/i\u003e\u003c/b\u003e 下载本工程文件，可修改数据库的用户名密码等连接配置（middleware目录下的`config-default.js`和`config-test.js`两个配置文件），在根目录下执行`npm install`下载依赖库，然后执行`node init-db.js`（初始化数据库表和表数据）；\u003c/br\u003e\n\u003cb\u003e\u003ci\u003e4\u003c/i\u003e\u003c/b\u003e 最后在工程根目录下执行`node app.js`，看到日志`app started at port 3000...`就代表启动成功了，浏览器访问\u003chttp://localhost:3000/zshop/\u003e（pc浏览器请切换为手机模式）。\n\n\u003cb\u003e二 涉及的技术框架：\u003c/b\u003e\u003c/br\u003e\n\n\u003cb\u003e\u003ci\u003e1\u003c/i\u003e\u003c/b\u003e 前端：`weui.css`，`jquery`，`jquery.spinner`，`requirejs`，`swiper-4.1.6`，`vue`，`vue-resource`；\u003c/br\u003e\n\u003cb\u003e\u003ci\u003e2\u003c/i\u003e\u003c/b\u003e 后端：`koa2`，`koa-bodyparser`，`koa-router`，`nunjucks`，`mime`，`mz`，`koa-compress`，`sequelize`，`mysql`，`koa-session2`，`log4js`，`moment`。\n\n\u003cb\u003e三 工程目录的主要结构：\u003c/b\u003e\u003c/br\u003e\n|-zshop\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-controllers       \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//controller\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-html_template     \u0026nbsp;\u0026nbsp;//如果你只需要本项目的那些静态的html文件等\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-middleware        \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//本项目的koa2的一些middleware\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-models            \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//数据库实体\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-service           \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//service\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-static            \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//静态文件目录，包括图片，js，css等，这部分可以部署在nginx\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-utils             \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//工具函数目录\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-views             \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//模板页面文件\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-app.js            \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//程序主入口文件\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-init-db.js        \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//执行这个可以初始化数据库表和表数据，谨慎执行\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-init-sql.sql      \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//init-db.js执行的sql文件\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-LICENSE           \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;//MIT协议，拿走不谢\u003c/br\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;|-package.json      \u0026nbsp;\u0026nbsp;\u0026nbsp;//依赖的库\n  \n\u003cb\u003e四 一些截图：\u003c/b\u003e\u003c/br\u003e\n\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/1.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/2.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/3.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/4.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/5.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/6.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/8.jpg)\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/9.jpg)\n\n\u003cb\u003e五 如果你觉得对你有所启发，star一下或者扫码请我喝杯咖啡，金额任意。\u003c/b\u003e\u003c/br\u003e\n\n![image](https://github.com/halloffamezwx/zshop/raw/master/html_template/screenshot/7.png)\n\n\u003cb\u003e六 我的博客：\u003c/b\u003e\u003chttp://zhuwx.iteye.com/\u003e。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalloffamezwx%2Fzshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalloffamezwx%2Fzshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalloffamezwx%2Fzshop/lists"}