Simplified Chinese | English
Management backend scaffolding project developed using Node.js (Express.js) and Vue2
Full stack Javascript application
Clean and testable REST API built with Express.js
Minimized user/role/rights management capabilities
Simple backend interface built using iview framework
express-vue-admin uses many components (libraries) to build the back-end interface and front-end UI:
express - backend web framework
sequelize - database ORM
joi - Parameter validation
dotenv - environment configuration
mocha/chai/chai-http - interface testing related components
mysql-database
redis-caching
...
vue2 - front-end JS framework
iview - front-end UI framework
vue-resource/vue-router/vuex - vue-related routing, state management and other components
...
. ├── .env.example 环境配置示例 ├── .sequelizerc sequelize配置 ├── screenshots/ 应用运行截图 ├── web/ vue web应用 ├── test/ 接口测试文件 ├── server.js 服务器 ├── middleware/ 中间件 | ├── base.js 基础中间件 | ├── auth.js 鉴权中间件 | └── ... 其他业务中间件 ├── route/ 路由 | ├── base.js 基础路由 | ├── admin.js admin模块路由 | └── ... 其他路由 ├── controller/ 控制器 | ├── base.js 基础控制器 | ├── rest.js rest基础控制器 | ├── session.js session控制器 | ├── admin/ admin模块控制器 | └── ... 其他业务模块控制器 ├── database/ sequelize数据库文件 | ├── models/ 模型 | └── migrations/ migration文件 | └── seeders/ seeder文件 ├── util.js 工具 └── config/ 配置 └── database.js sequelize-cli数据库配置
Install redis for session storage (optional)
Copy .env.example to .env, and configure each project (without configuring redis, the session will be saved in memory, which is not recommended for production environments)
#server NODE_ENV=development 环境配置 SERVER_PORT=3000 服务器端口 API_PATH=/api 接口基路径 API_VERSION=v1 接口版本 #db DB_HOST=localhost 数据库host DB_DATABASE=admin 数据库名称 DB_USER=root 数据库用户 DB_PASSWORD=root 数据库密码 #redis REDIS_HOST=localhost redis缓存host REDIS_PORT=6379 redis端口 #misc ADMIN_SEED_PASSWORD=adminpwd admin帐号密码 TEST_SEED_PASSWORD=testpwd 测试帐号密码 SERVER_PORT_TEST=3001 单元测试服务器端口
Install dependencies, initialize the database, and fill in seed data:
$ npm install // 安装依赖 $ npx sequelize db:migrate // 数据库结构构建 $ npx sequelize db:seed:all // 数据库数据填充
Run server and web applications
$ npm start // 开启后端服务 $ cd ./web // 进入web文件夹 $ npm install // 安装依赖 $ npm run dev // 运行web应用
Basic interface testing:
$ npm run test
MIT