- Mysql
- Express server
- Forever
- Nodemon
- Redis
- Vue@2.5.2
- Vue Router@3.0.1
- ---------- Essentials ----------
- Seperate frontend and backend server
- ---------- Backend server ----------
- Signin
- Signup
- Signout
- JWT authenticate
- Store refresh token in redis
- Read logic with permission
- Create logic with permission
- Delete logic with permission
- Update logic with permission
- ---------- Frontend server ----------
- handling jwt token with vuex
- handling Authenticate
-
- Signup
-
- Signin
-
- Signout
- management toast popup about server's response
- install module
# install frontend
$ cd frontend
$ npm install
- install module
# install frontend
$ cd frontend
$ npm install
- start frontend server
$ npm start
$ cp ./backend/.env.sample ./backend/.env
- Setting database
CREATE TABLE `users` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(50) NOT NULL,
`role` varchar(50) NOT NULL,
`position` varchar(50) NOT NULL,
`password` varchar(80) DEFAULT NULL,
PRIMARY KEY (`index`)
) ENGINE=InnoDB AUTO_INCREMENT=8;
CREATE TABLE boards (
`index` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Board item`s primary key',
`user` varchar(50) NOT NULL COMMENT 'Creator',
`upk` int(11) NOT NULL COMMENT 'Creator`s primary key',
`title` varchar(50) NOT NULL COMMENT 'Board item`s title',
`content` mediumtext NOT NULL COMMENT 'Board item`s content',
`regdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Board item`s regdate',
`editdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Board item`s edit date',
PRIMARY KEY (`index`)
)
COLLATE='utf8_general_ci' ENGINE=InnoDB AUTO_INCREMENT=1;
- Start redis cli server on background
$ redis-server &
- Install all backend dependencies
$ cd backend && npm install
- Edit database.config.js
$ vi backend/config/database.config.js
# After that setting git command
$ git update-index --assume-unchanged backend/config/database.config.js
- Make logs directory for loggin backend server
# Directory: /backend
$ mkdir logs && cd logs && touch err.log & touch forever.log & touch out.log
- Serve the app
$ node ./bin/www