dokenzy / vue-express-mongodb

Vue.js and Express and MongoDB project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-express-mongodb

Vue.js and Express and MongoDB project

Thanks

Function

  • find user
  • add user
  • token validate
  • login intercept

Technology

  • vue
  • vue-router
  • vuex
  • express
  • mongodb
  • less/scss
  • axios
  • ElementUI

API

  • /api/user/useradd
  • /api/user/login
  • /api/user/getuser

Schema

const userSchema = mongoose.Schema({
  userId: {
    type: Number,
    required: true
  },
  userPwd: {
    type: String,
    required: true
  },
  token: {
    type: String,
    required: true
  },
  create_time: {
    type: Date,
    required: true
  }
})

demo

start server

vue-express-mongodb

Login and Register successfully

vue-express-mongodb

Token validate

vue-express-mongodb

Register validate

vue-express-mongodb

Login validate

vue-express-mongodb

Build Setup

# install dependencies
npm install

# run express server,this should be the first execution
# the server api run on localhost:3000
npm run server

# serve with hot reload at localhost:8080
# [HPM] Proxy created: /api  ->  http://127.0.0.1:3000/api/
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

About

Vue.js and Express and MongoDB project

License:MIT License


Languages

Language:JavaScript 68.5%Language:Vue 26.4%Language:CSS 3.7%Language:HTML 1.4%