Private and personal bookmark manager
- Local, password-protected bookmark storage (in a sqlite3 database)
- HTML for each bookmark is fetched and the metadata is cached locally (the filename is hashed)
- Bookmarklet (Javascript) to save from a browser
- Simple view of the latest 100 bookmarks with an "added" date & a "seen" flag/date
- Multi-user (Note: there is no connection between users (and there never will be). See "What is missing?" below.)
- URL-shortening: For bookmarks, you can access the bookmark by visiting
.../n/<id>
where<id>
is the nanoid for that URL. - Data Matrix barcode for each bookmark (optional).
- Social networking features: This tool is not meant to connect people. (See "Motivation" above for explanation.)
- A full API. (Only an "add" method exists today. Others may be added later.)
-
Create a user
- Rename
users/users-template.js
tousers/users.js
- Run
node generatePassword.js <_password_>
and save the output inusers/users.js
as hashedPwd
- Rename
-
Create the database:
sqlite bkmrks.db < bkmrks.sql
(Note: change to the dbFile location as set in the configuration file. See below.) -
Configure the server
-
Required
- Rename template config file
default-template.json
todefault.json
- Set the sessionKey with any unique string
- Set the port to an open port value (default: 8000)
- Set dbFile as the database name (default:
./data/bkmrks.sqlite
) - Set cookie.maxAgeDays (default: 7)
- Rename template config file
-
Optional
- Set cookie.domain to your domain. (Delete this entry if you don't want to set it. Default: none)
- Set useHttps to true (Default: false)
- Set contact with an email address (must be set in the header to add links to https://crates.io. Default: none)
- Set useTecITBarcodeGenerator to true to display Data Matrix barcode for each bookmark - useful for printing bookmarks or opening bookmarks from a phone. (Default: false)
-
-
Add the node modules:
npm i
-
Start the server:
node server.js
-
Open your browser:
http://localhost:8000/bkmrkr/
/bkmrkr/display
- Required Parameters: None
- Optional Parameters [If provided, they override any config settings.]
format
: Eithercard
(Bootstrap cards) orlist
(UL). (Default:card
)offset
: Database row to start. (Default: 0)showAll
: Show all (i.e. seen (i.e.ToRead
is a date value) and unseen (i.e.ToRead
isno
ornull
). Eitheryes
orno
. (Default:no
)barcode
: Show Data Matrix barcode (provided by TEC-IT Barcode Generator). (Default:no
)
/bkmrkr/add
- Required Parameter:
url
: The encoded URL (e.g./bkmrkr/add?url=https%3A%2F%2Fmy.new.bookmark.com%2F%0A
)
- Optional Parameter:
title
: The encoded page title (/bkmrkr/add?url=https%3A%2F%2Fmy.new.bookmark.com%2F&title=Some%20clever%20title
). If not provided, the URL will be fetched and the title captured automatically
- Required Parameter:
URLs
(andTitles
, when provided) must be URL encodedToRead
is set to "yes" by default
- Two options:
- Nanoid:
/n/<id>
- Hash:
/bkmrkr/visit/<hash>
- Nanoid:
ToRead
is updated in the database to the current time when either fetch URL is called
- sqlite3
- debug - Flexible debugging output
- config - Easy configuration tool
- jsdom - Parse the HTML
- express - Web app framework
- express-session - Track logged in users
- passport - Authentication framework
- passport-local - Local user management
- connect-ensure-login - Middleware to make sure users are logged in
- bcrypt - Encrypt the password
- got - Fetch the HTML
- @meltwater/fetch-favicon - Gets the favicon from the remote site
- nanoid - URL shortener.
- nanoid is configured with a slightly reduced alphabet - removing any potentially ambiguous letters/numbers - e.g. 0, 1, i, l, I.
const alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz';
const nanoid = customAlphabet(alphabet, 8);
See customer alphabet or size in the nanoid README for more info. According to the Nano ID CC, with this configuration "~159 years [are] needed, in order to have a 1% probability of at least one collision"
I've been a pinboard.in user for 10 years. I have really enjoyed the service and appreciate that it was so cheap to join back then. Recently, the creator of that service asked me (and others who had paid a one-time fee) to switch to a subscription model. A completely reasonable request/model that will help him continue to develop and enhance the application.
If you want social networking and don't mind a "no-frills" service, pinboard.in is really great. It's cheap, easy to use, and rock solid. And he's promising more features. But it bills itself as "Social Bookmarking for Introverts" - and I don't need the "Social" part. In fact, I don't want my bookmarks in a service that is advertised and designed to be shared.
So I created this simple node app to save my bookmarks. It takes just a few minutes to set up and works great for me, without having to set all my bookmarks to "private" by default or ignoring how many other people have already bookmarked what I just added. If this is what you want, feel free to download and set up this app for yourself.
MIT. See the LICENSE file for the full license.
Initial starting point: https://github.com/passport/express-4.x-local-example