There are many node scaffoldings based on Mongoddb, but MySQL is rare. This is a simple scaffolding built on express and mysql.
- Register with fullname, email, passord, very simple
- Login with passport-local strategy
- Twitter Bootstrap Support Note: I just want keep the scaffolding clean, no more complex function, and keep it flexible.
NOTE: You need to have node.js, mysql installed
- Clone the project
$ git clone https://github.com/lgrcyanny/node-express-mysql-scaffolding.git
$ npm install
$ cp config/config.disk.js config/config.js
Please config your MySQL in the config.js
;
-
Install MySQL server[http://dev.mysql.com/downloads/]
-
Start MySQL service
-
Build the database
$ mysql -u root -p
> create database scaffolding
> quit
$ mysql -u root -pyourpassword scaffolding < scaffolding.sql
- Start Server
$ npm start
- Then visit http://localhost:3000/
Thanks node-express-mongoose-demo, it's a great scaffolding, but it still took me 2 days to migrate the mongodb based scaffolding to MySQL
-app/
|__controllers/
|__models/
|__mailer/
|__views/
-config/
|__routes.js
|__config.js
|__passport.js (auth config)
|__express.js (express.js configs)
|__middlewares/ (custom middlewares)
-public/
Tests are not shipped now, I will write tests later.
$ npm test
(The MIT License)