• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    JavaScript
  • Created almost 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visualize your reading history.

[豆瓣酱] repo dependency

This repo has been deprecated. 由于豆瓣关闭了 API 通道,本网站已下线。

豆瓣 私人收藏数据可视化。

依赖

数据库服务器

同时依赖 mongodb 和 redis ,配置参数参见 conf/default.conf.js

工具包

npm install forever -g
npm install component -g
npm install grunt-cli -g
npm install

开始开发

make init
make grunt
make

make 的默认命令是使用 forever 执行 app.js

如果需要修改静态文件,请执行 make watch ,利用 grunt 监视静态文件改动。

一点说明

MongoDB 的用处

  1. 存储用户账户信息、收藏信息、条目信息
  2. 利用 aggregation 生成统计结果

redis 的用处

  1. 替代 memcached 的缓存服务
  2. 存储统计结果(计划中)

队列管理

使用 node-pool,数据库请求、API请求、统计请求,都有分别的队列。

静态文件

  • 依赖的开源库都用 component 来管理。
  • 使用 grunt 来打包。具体配置参见 Gruntfile.js
  • 服务器递送的总是 /static/dist 目录下的文件,调试时也要保证 dist 目录下有所有需要的文件。没有 fallback 。因此请保证修改静态文件时,watch 有运行。

客户端JS的模块化

  • static/js/do.core.js 是由豆瓣的 do.js 修改而来的文件加载器
  • 用了 component-build 的一套东西,参看 static/js/do.cmd.js
  • Gruntfile.js 里定义了对 js 文件包裹 CommonJS require 定义的命令
  • 使用模版配套的 #{urlmap()} 方法为 Do 生成所需文件的真实地址
  • 使用 Do('module1', 'module2', ... 显式延时加载你需要的模块,模块名即文件名,在 Do 内部安全地使用 require('xxx') 具体使用实例参见 static/js/people/booter.js

版本管理

发布上线前执行 grunt build ,将为压缩后的文件生成一个 hashmap (即 static/hash.json ),并重命名文件为 static/dist/js/xx_HASH.js 格式。 为了保证这套机制的顺利运行,请保证新加的静态文件名中不包括下划线(_)。

提供 API Key

采集豆瓣数据需要使用豆瓣 API。请配置一下环境变量来制定豆瓣 API KEY:

  • DOUBAN_APP_KEY
  • DOUBAN_APP_SECRET
  • DOUBAN_APP_MORE - 格式:key1:secret1, key2:secret2

More Repositories

1

huggle

hugo + gulp
JavaScript
37
star
2

kwiki

ktmud wiki
Shell
37
star
3

bing-wallpaper

Bing.com wallpaper for OS X, and any Unix like desktop (eg. Ubuntu).
Shell
36
star
4

kwiki_tpl

kwiki_tpl
JavaScript
33
star
5

wechat-api

Nodejs Wechat Official Account advanced API sdk
JavaScript
27
star
6

owa-chrome

An extension for access OWA in Chrome.
JavaScript
21
star
7

cached-dependencies

Github Action for setting up a multiple cache targets in one step
TypeScript
21
star
8

koa-spa

pushState friendly static file server, with koa
JavaScript
17
star
9

koa-wechat

Wechat API middlewares for koajs
JavaScript
16
star
10

autostatic

Automatically manage static file versions for Express/ NodeJS
JavaScript
14
star
11

zita

Build, train, serve your own image classifier within a day
JavaScript
13
star
12

grunt-hashmap

hash mapping for static files.
JavaScript
13
star
13

http-proxy-middleware-secure-cookies

Securely add auth cookies to your webpack-dev-server proxies.
TypeScript
11
star
14

loudlaw

大声看法网站源码
JavaScript
10
star
15

istatic

Inline compressed javascript and css for Express on node.js.
JavaScript
8
star
16

vuelastic

A simple ElasticSearch web interface built with Vue.js
CSS
7
star
17

david

A simple CMS using flask, SQLAlchemy, stylus..
JavaScript
5
star
18

fsauor2018

Fine-grained Sentiment Analysis of User Reviews from AI Challenger
Jupyter Notebook
5
star
19

yaml-i18n-brunch

Use yaml to edit i18n translations for you brunch project.
JavaScript
4
star
20

mmseg4j

just a github mirror of mmseg4j of chenlb
Java
4
star
21

vim

Woo, things are getting crazy, hah?
Vim Script
4
star
22

releval

Relevancy Evaluation Tool for ElasticSearch vertical search engine
CSS
3
star
23

github-life

A data explorer for GitHub projects' life cycles
R
3
star
24

webot-dashboard

Web based dashboard for webot.
3
star
25

data-science-intuition

Intuitive answers to Data Science / Machine Learning interview questions.
Shell
3
star
26

cacheable

python decorator like cache management in nodejs
JavaScript
3
star
27

native2ascii.js

native2ascii in nodejs
JavaScript
2
star
28

douban-api

Simple helper for douban api v2
JavaScript
2
star
29

ant-design-theme-lunar

airbnb/lunar built with Ant Design
TypeScript
2
star
30

chakra-ui-select

A demonstration of advanced Select component with Chakra UI, supports multiple select and different rendering modes
TypeScript
2
star
31

yjc.me

Personal website
HTML
1
star
32

mass211-map

Massachusetts 211 Map
CSS
1
star
33

chakra-ui-downshift-select

A flexible Select and MultiSelect component for Chakra UI built with Downshift.js
TypeScript
1
star
34

macos-high-sierra-deep-learning-wheel

Native built Tensorflow and Pytorch on macOS 10.13.6 with CUDA/GPU support
1
star
35

yjc.me-zh-old

yjc.me with Hugo.
JavaScript
1
star
36

perl-tmpl.vim

Perl's HTML::Template Syntax highlight and snippets
Vim Script
1
star
37

tempo

A php demo template.
PHP
1
star
38

odc

ODC Front End
JavaScript
1
star
39

koa-passport-fw

Passport Authenticator framework for koajs.
JavaScript
1
star
40

react-windowed-syntax-highlighter

Highly performant syntax highlighter for large chunk of text, built with Refractor and react-window
1
star
41

perfect-code

Perfect JS code structure for old large codebase
JavaScript
1
star
42

paoding

mirror from google code
Java
1
star