Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/molunerfinn/vue-koa-demo
:beginner:A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
https://github.com/molunerfinn/vue-koa-demo
docker docker-compose docker-support jest jest-tests koa koa2 mysql todolist vue vue-koa-demo vue-koa-ssr vue-ssr vue2
Last synced: 27 days ago
JSON representation
:beginner:A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
- Host: GitHub
- URL: https://github.com/molunerfinn/vue-koa-demo
- Owner: Molunerfinn
- License: mit
- Created: 2017-01-17T06:46:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T07:23:16.000Z (over 2 years ago)
- Last Synced: 2024-10-11T09:01:41.026Z (27 days ago)
- Topics: docker, docker-compose, docker-support, jest, jest-tests, koa, koa2, mysql, todolist, vue, vue-koa-demo, vue-koa-ssr, vue-ssr, vue2
- Language: JavaScript
- Homepage:
- Size: 737 KB
- Stars: 756
- Watchers: 24
- Forks: 166
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-koa-demo
A fullstack demo used Vue2 & Koa2(Koa1 version is [here](https://github.com/Molunerfinn/vue-koa-demo/tree/koa1))
:sunny: Easy to setup and learn
:100: Api test coverage
:rocket: Instant feedback
:stuck_out_tongue_winking_eye: Vue SSR support in the [ssr](https://github.com/Molunerfinn/vue-koa-demo/tree/ssr) branch
:tada: Docker support
![Todolist](https://i.loli.net/2018/12/13/5c123b40a1baa.gif 'todolist')
View the [article](https://molunerfinn.com/Vue+Koa/) for more details.
If you want to check the info of the test, view the [article](https://molunerfinn.com/Use-Jest-To-Test-Vue-Koa/) for more details.
## Install
`git clone https://github.com/Molunerfinn/vue-koa-demo.git`
`npm install` or `yarn`
if you are using yarn & meet this error:
```bash
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
```please use
```
yarn --ignore-engines
```Also you need to install MySQL & create a database named `todolist`,and execute 2 sql files `list.sql` & `user.sql`.They are in `sql/`
After that, create a `.env` file and set the database username & password:
```env
# your database username
DB_USER=XXXX
# your database
DB_PASSWORD=YYYY
# Koa is listening to this port
PORT=8889
```If you want to run the test for the Project, please create a `.env.test` file to face this situation:
```env
# your database username
DB_USER=XXXX
# your database
DB_PASSWORD=YYYY
# The port which is listened by koa in the test environment
PORT=8888
```### Run
> Node.js & Docker support. **You need to create a `.env` file as above**.
### Node.js
Beacuse of using Koa2, `Node.js >= v7.6.0` is needed.
#### Development:
`npm run dev` && `npm run server`
open browser: `localhost:8080`
> tips: login password is 123
#### Production:
`npm run start`
open browser: `localhost:8889`
> tips: login password is 123
#### Test:
`npm run test` and find the coverage report in the `coverage/lcov/index.html`
### Docker
`docker-compose build` && `docker-compose up`
> mysql in docker use 3306 port inside & outside.
open browser: `localhost:8889`
> tips: login password is 123
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2017 Molunerfinn