A lightweight boilerplate for a universal webapp based on koa, mongodb, node, vue, and webpack
Project based on Webpack4 is in Releases.
This project aims to build a small but structured full-stack application, so it would be relatively clear for a programmer/beginner to understand how to build a website from scratch.
Click here to see demo website.
email: [email protected] password: 123456
├─client # frontend folder
│ ├─src # frontend src
│ │ ├─api
│ │ ├─router
│ │ ├─styles
│ │ ├─components
│ │ ├─store # state management
│ │ │ └─modules
│ │ └─view # app pages
│ │ └─auth
│ └─static # static folder
|
└─server # server folder
└─src # server src
├─api # server api list
│ ├─auth # completely token-based authentication
│ ├─thing
│ └─user
├─config # server configurations
│ ├─index # default server port, mongo uri, etc settings
│ ├─security # security settins
│ └─seed # populate database with sample data on server start
├─entry.js # entry file for environment setup
├─main.js # main file after entry
└─routes.js # router
cd server # You can boost the server by using Docker
docker-compose up
# Open a new tab
cd client
npm install
npm start
cd client
npm install
npm start # Running dev client
# Open a new tab
mongod # Boost Mongo DB
# Open a new tab
cd server
# CREATE a .env file under server folder, and copy and paste the contents of .env.default file into this .env, and assign values
touch .env
npm install
npm start # Running dev server
npm run build # Running production mode
npm run eslint # Check your coding style
npm run eslint-fix # Use auto ESLint fix