This repository is a school project for practising database design and web programming. Use Node.jswith Express.js framework. Use Mysql as main database. Also use Mongodb to store part of the data.
Install Node.js v6.9.4. Install Mysql and Mysql workbrench. Install Mongodb v3.4.3
PS: Suggest Use Visual Studio Code as and IDE for this project.
User Mysql Workbrench in import the schema file /surprise/schema/surprise-v4.0.mwb PS: please use the lastest version.
Please use user:root password:root123 as you mysql account. Or you can go to file /surprise/dao/baseDao.js and change the mysql user and password.
$ cd <path to dir>/surprise
$ npm install $ cd <path to dir>/surprise
$ node app.jsUser home page: http://127.0.0.1:3000/
User login page: http://127.0.0.1:3000/login
Built-in user account: user: test@test.com password:test
Admin login page: http://127.0.0.1:3000/admin
Admin login account: user: super@admin.com password: 1234
Node.js: https://nodejs.org/dist/latest-v6.x/docs/api/util.html
Express routing: https://expressjs.com/en/starter/basic-routing.html https://expressjs.com/en/guide/routing.html
Express middleware: https://expressjs.com/en/guide/writing-middleware.html https://expressjs.com/en/guide/using-middleware.html
Passport-local Doc and Examples: https://github.com/passport/express-4.x-local-example/blob/master/server.js
How to write javascript in object-orientation style? https://www.sitepoint.com/simple-inheritance-javascript/ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain