Skip to content
forked from jeneser/douban

Awesome douban DEMO created with Vue2.x + Vuex + Vue-router + Superagent

License

Notifications You must be signed in to change notification settings

maStacks/douban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Awesome douban DEMO created with Vue2.x + Vuex + Vue-router + Superagent

Build Status David Codacy Badge Powered Percentage of issues still open Average time to resolve an issue PR license





......
Live Demo

Features

  • Vue + vue-router + vuex + Superagent working together
  • Vuex divide store into modules
  • Modern JavaScript syntax with ES6
  • vue-cli webpack template
  • Single-file Vue Components
  • API request seperated
  • Real remote API and some mock data
  • eslint linter integration
  • Hot-reload in development
  • Css with Sass
  • No third party CSS framework
  • Complex and different style view logic
  • Infinite loading list
  • Complete search logic
  • Custom components like List, Rating, Tags ...
  • Authentication with JSON Web Tokens
  • Complete register login logic ......

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

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

Libraries

  • Vuex : Centralized State Management for Vue.js
  • Vue-router : The official router for Vue.js
  • vue-resource : The HTTP client for Vue.js
  • Superagent : Ajax with less suck - (and node.js HTTP client to match)
  • vue-infinite-loading : An infinite scroll plugin for Vue.js 1.0 & Vue.js 2.0.
  • normalize.css : A collection of HTML element and attribute style-normalizations
  • vue-scroll-behavior : Completely customize the scroll behavior on route navigation

API

Douban Api V2

  • Basic URI : https://api.douban.com/V2/
  • Online activities
    • Activities list : /event/list?loc=108288&count=&start=
    • Single activitie info : /event/id
  • Movie
    • In theaters : /movie/in_theaters?count=
    • Coming soon : /movie/coming_soon?count=
    • Top 250 : /movie/top250?count=
    • Single movie info : /movie/subject/id
  • Book
    • Search some books : /book/search?q=&count=
    • Single book info : /book/id
  • Search
    • Search books : /book/search?q=
    • Search movie : /movie/search?q=
    • Search music : /music/search?q=

Mock Douban Backend

  • User Basic URI : https://douban.herokuapp.com/user/
  • Register
    • Path: /user
    • method: POST
  • Login
    • Path: /user/:id
    • method: GET

For detailed explanation, checkout the Douban Api V2 and Douban Backend

File Structure

.
β”œβ”€β”€ build
β”‚   β”œβ”€β”€ build.js
β”‚   β”œβ”€β”€ check-versions.js
β”‚   β”œβ”€β”€ dev-client.js
β”‚   β”œβ”€β”€ dev-server.js
β”‚   β”œβ”€β”€ utils.js
β”‚   β”œβ”€β”€ vue-loader.conf.js
β”‚   β”œβ”€β”€ webpack.base.conf.js
β”‚   β”œβ”€β”€ webpack.dev.conf.js
β”‚   └── webpack.prod.conf.js
β”œβ”€β”€ config
β”‚   β”œβ”€β”€ dev.env.js
β”‚   β”œβ”€β”€ index.js
β”‚   └── prod.env.js
β”œβ”€β”€ index.html
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ App.vue
β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”œβ”€β”€ avatar.png
β”‚   β”‚   β”œβ”€β”€ book_zw.jpg
β”‚   β”‚   β”œβ”€β”€ camera.svg
β”‚   β”‚   β”œβ”€β”€ douban-app-logo.png
β”‚   β”‚   β”œβ”€β”€ pen.svg
β”‚   β”‚   β”œβ”€β”€ promotion_bg.jpg
β”‚   β”‚   └── user_normal.jpg
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ Banner.vue
β”‚   β”‚   β”œβ”€β”€ Card.vue
β”‚   β”‚   β”œβ”€β”€ DownloadApp.vue
β”‚   β”‚   β”œβ”€β”€ Group.vue
β”‚   β”‚   β”œβ”€β”€ HeaderBar.vue
β”‚   β”‚   β”œβ”€β”€ List.vue
β”‚   β”‚   β”œβ”€β”€ Rating.vue
β”‚   β”‚   β”œβ”€β”€ Scroller.vue
β”‚   β”‚   β”œβ”€β”€ Marking.vue
β”‚   β”‚   β”œβ”€β”€ SubNav.vue
β”‚   β”‚   β”œβ”€β”€ Tags.vue
β”‚   β”‚   β”œβ”€β”€ Types.vue
β”‚   β”‚   └── UserBar.vue
β”‚   β”œβ”€β”€ main.js
β”‚   β”œβ”€β”€ router
β”‚   β”‚   └── index.js
β”‚   β”œβ”€β”€ store
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   └── modules
β”‚   β”‚       β”œβ”€β”€ activities.js
β”‚   β”‚       β”œβ”€β”€ book.js
β”‚   β”‚       β”œβ”€β”€ group.js
β”‚   β”‚       β”œβ”€β”€ movie.js
β”‚   β”‚       β”œβ”€β”€ search.js
β”‚   β”‚       β”œβ”€β”€ subject.js
β”‚   β”‚       └── user.js
β”‚   └── views
β”‚       β”œβ”€β”€ BookView.vue
β”‚       β”œβ”€β”€ DetailView.vue
β”‚       β”œβ”€β”€ GroupView.vue
β”‚       β”œβ”€β”€ HomeView.vue
β”‚       β”œβ”€β”€ LoginView.vue
β”‚       β”œβ”€β”€ MovieView.vue
β”‚       β”œβ”€β”€ PagesView.vue
β”‚       β”œβ”€β”€ RegisterView.vue
β”‚       β”œβ”€β”€ SearchView.vue
β”‚       β”œβ”€β”€ StatusView.vue
β”‚       β”œβ”€β”€ SubjectView.vue
β”‚       └── TalionView.vue
└── static
    └── logo.png

Change log

  • June 24, 2017:
    • Update vue-scroll-behavior fix scroll behavior
  • May 28, 2017:
    • Using superagent

License

MIT Copyright (c) 2017 Jeneser

About

Awesome douban DEMO created with Vue2.x + Vuex + Vue-router + Superagent

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 68.4%
  • JavaScript 31.2%
  • HTML 0.4%