Open source a mall system written by nodejs

Zshop is a mall system written by nodejs. After reading Liao Xuefeng's "JavaScript Full Stack Tutorial" , if you want to practice your skills, you have already started to step on the road. At present, the home page, product search, shopping cart, my, login, product details, settlement, etc. have been completed, and other functions will continue to be improved later. After completion, the er of the database will be drawn. github address: https://github.com/halloffamezwx/zshop .

 

Online preview effect address: http://120.78.200.74:3000/zshop/ (Please switch PC browser to mobile mode). Deployed on Alibaba Cloud, centOS 6.5 64-bit, 1-core cpu, 1g memory, 1m bandwidth, 40g ordinary hard disk, login mobile phone: 18312345678, password: 123456.

 

A deployment method:

1 Install node.js (version 7.6 and above, because async/await is to be supported);

2 Install the mysql database (utf-8 encoded configuration) and create the database zshop;

3 Download this project file, you can modify the connection configuration such as the username and password of the database (two configuration files, config-default.js and config-test.js in the middleware directory), execute npm install in the root directory to download the dependent library, and then Execute node init-db.js (initialize database tables and table data);

4 Finally, execute node app.js in the project root directory, and see the log app started at port 3000... that means the startup is successful, and the browser accesses http://localhost:3000/zshop/ (PC browser please switch to phone mode).

 

Two technical frameworks involved:

1 前端:weui.css,jquery,jquery.spinner,requirejs,swiper-4.1.6,vue,vue-resource;

2 Rear end: koa2, koa-bodyparser, koa-router, nunjucks, mime, mz, koa-compress, sequencerize, mysql, koa-session2, log4js, moment.

 

The main structure of the three project directories:

|-zshop

  |-controllers            //controller

  |-html_template //If you only need those static html files of this project, etc.

  |-middleware //Some middleware of koa2 in this project

  |-models //Database entity

  |-service                 //service

  |-static //static file directory, including pictures, js, css, etc., this part can be deployed in nginx

  |-utils //Tool function directory

  |-views //Template page file

  |-app.js //The main entry file of the program

  |-init-db.js //Execute this to initialize database tables and table data, execute with caution

  |-init-sql.sql //sql file executed by init-db.js

  |-LICENSE //MIT agreement, thank you for taking it

  |-package.json //dependent library

  

Four some screenshots:

        

    
 

5. If you think it inspires you, star or scan the code to invite me for a cup of coffee, the amount is arbitrary.


 Thanks for reading! ! !

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326089909&siteId=291194637