1 | bkmrkd
|
2 | ======
|
3 |
|
4 | [![Build Status](https://travis-ci.org/mike-engel/bkmrkd.svg?branch=redux-tests-43)](https://travis-ci.org/mike-engel/bkmrkd)
|
5 | ![Dependencies](https://david-dm.org/mike-engel/bkmrkd.svg)
|
6 |
|
7 | bkmrkd is a self-hosted, lightweight bookmarking service running on [node.js](https://nodejs.org), [react](https://facebook.github.io/react), and [rethinkdb](https://rethinkdb.com).
|
8 |
|
9 | [screenshots](#screenshots)
|
10 | [installation](#installation)
|
11 | [running in a production environment](#running-in-a-production-environment)
|
12 | [migrating from 1.0 to 2.0](#migrating-from-10-to-20)
|
13 | [contributing](#contributing)
|
14 | [license](LICENSE.md)
|
15 |
|
16 | # screenshots
|
17 | ## desktop
|
18 | ![Home page](screenshots/desktop.png)
|
19 |
|
20 | ## mobile
|
21 | ![Mobile](screenshots/mobile.png)
|
22 |
|
23 | ## colophon
|
24 | ![Colophon](screenshots/colophon.png)
|
25 |
|
26 | # installation
|
27 |
|
28 | ## assumptons
|
29 |
|
30 | 1. You have node.js >= 4.2 installed
|
31 | 2. You have rethinkdb installed and running
|
32 |
|
33 | ## running bkmrkd
|
34 |
|
35 | With version `2.3.0`, there are a couple of options to run bkmrkd. You can run it with one of the npm scripts, programmatically, or as a global command.
|
36 |
|
37 | ### npm script
|
38 |
|
39 | There are npm scripts for development, staging, and production. This is the only one that doesn't work if you're using this from npm.
|
40 |
|
41 | ```shell
|
42 | # install the required modules
|
43 | npm install
|
44 |
|
45 | # if you want to run locally
|
46 | npm start
|
47 |
|
48 | # for testing daemonized with pm2
|
49 | npm run stage
|
50 | npm run stage:restart
|
51 | npm run stage:stop
|
52 |
|
53 | # for production daemonized with pm2
|
54 | # unless you put your SSL certs in the `ssl` directory
|
55 | # you'll want to provide the path with an env variable
|
56 | BKMRKD_CONFIG_PATH=/path/to/config/file npm run prod
|
57 | BKMRKD_CONFIG_PATH=/path/to/config/file npm run prod:restart
|
58 | npm run prod:stop
|
59 | ```
|
60 |
|
61 | ### programmatically
|
62 |
|
63 | If you'd like to mount bkmrkd inside another app/node script, this is totally do-able too. The module exports both the express app and the [SPDY](https://github.com/indutny/node-spdy) server.
|
64 |
|
65 | It's important to note here, however, that if you want to use the SPDY server bundled, you need to either move your certs into `./ssl/server.crt` and `./ssl/server.key`. You can also specify the path to your config (relative to your cwd) by setting the `BKMRKD_CONFIG_PATH` environment variable.
|
66 |
|
67 | ```javascript
|
68 | const bkmrkdApp = require('bkmrkd').app
|
69 | const bkmrkdServer = require('bkmrkd').server
|
70 |
|
71 | // mount the app as you will
|
72 | app.use('/bkmrkd', bkmrkdApp)
|
73 |
|
74 | // run the server with some other logic around it
|
75 | bkmrkdServer.listen(3000)
|
76 | ```
|
77 |
|
78 | ### global command
|
79 |
|
80 | Upon installation, npm will symlink a bkmrkd binary into a folder in your path. The command is `bkmrkd`, and there are a few options you can provide.
|
81 |
|
82 | ```shell
|
83 | Usage:
|
84 | bkmrkd [options]
|
85 |
|
86 | Options:
|
87 | --daemon, -d Daemonize the bkmrkd process with pm2
|
88 | --config, -c The path to your config file for bkmrkd
|
89 | --port, -p The port that bkmrkd should bind to. Defaults to 3000. Precedence is given to the config file
|
90 | --help, -h Print this help info
|
91 | ```
|
92 |
|
93 | ## saving
|
94 |
|
95 | Simply drag the bookmarklet to your bookmarks bar and click it on a webpage you want to save. Simple.
|
96 |
|
97 | # running in a production environment
|
98 | So you want to run this for real. On the web. That's awesome. Everyone will want this to be setup differently, but this is how I've approached it.
|
99 |
|
100 | 1. Proxy through nginx. Listen on port 80 for a domain/subdomain and proxy_pass to the app running on port 3000.
|
101 | 2. Use SSL certs to avoid a new window opening when bookmarking things.
|
102 | 3. Use a variety of [startup scripts](#running-bkmrkd) and [backup](http://rethinkdb.com/docs/backup/) scripts.
|
103 |
|
104 | # developing
|
105 |
|
106 | To work on bkmrkd locally, you'll want to start the node server and run gulp.
|
107 |
|
108 | ```shell
|
109 | # make sure rethinkdb is running
|
110 | rethinkdb --daemon
|
111 |
|
112 | # start the server in development mode
|
113 | npm start
|
114 |
|
115 | # in another window or tab, start gulp and watch for file changes
|
116 | gulp
|
117 | ```
|
118 |
|
119 | # migrating from 1.0 to 2.0
|
120 |
|
121 | I don't think there are enough instances of bkmrkd (plus it didn't work that well) to warrant an upgrade guide. If you want one though, let me know and I'll create a guide. You can also check out migrating from mongodb to rethinkdb.
|
122 |
|
123 | # contributing
|
124 |
|
125 | Please make a pull request! bkmrkd follows the [js standard](https://github.com/feross/standard) styleguide.
|
126 |
|
127 | # Roadmap
|
128 |
|
129 | To keep track of the roadmap, I'm using [issues](https://github.com/mike-engel/bkmrkd/issues), and more specifically, [milestones](https://github.com/mike-engel/bkmrkd/milestones).
|
130 |
|
131 | # [changelog](CHANGELOG.md)
|
132 |
|
133 | # license
|
134 | [MIT](LICENSE.md)
|