A digital give-a-book, take-a-book library for ebooks https://library.quietplace.tk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Robbie Antenesse a0cd714933 Add a glow to taken styled books 5 months ago
public Add a glow to taken styled books 5 months ago
routes Make history page always use "readable" book template 5 months ago
templates Add a glow to taken styled books 5 months ago
.gitignore Add ability to add custom html to bottom of body (for analytics, etc.) 5 months ago
Procfile Add Heroku-specific stuff 6 months ago
README.md Update readme and version 5 months ago
customHtmlAfterFooter.example.html Add ability to add custom html to bottom of body (for analytics, etc.) 5 months ago
package.json Update readme and version 5 months ago
server.js Allow custom SSL port 5 months ago
settings.example.json Allow custom SSL port 5 months ago
yarn.lock Add a button to toggle styled bookshelf 5 months ago

README.md

# Little Library

A digital give-a-book, take-a-book library for ebooks.

Features

  • Free Contribution: allows DRM-free ebooks to be uploaded by anyone
  • Built-in Reviews: requires a description/reason/note for uploading
  • Small Footprint: only allows ebook files and limited metadata and optional library size limit
  • Digital Physicality: know when you’re not the only one visiting the little library
  • Single-borrower: removes ebook files from server when someone takes it
  • Metadata history: keeps a history of all books that have been on shelf

Requirements

Installation

Clone the repo:

> git clone https://github.com/Alamantus/little-library.git

Navigate to the folder:

> cd path/to/little-library

Run yarn to install all the dependencies:

> yarn

Then copy settings.example.json to settings.json and make sure everything is to your liking. Below is the default settings.example.json file:

{
  "port": 3000, // The server's port
  "siteTitle": "Little Library",  // The name that appears in the site header
  "titleSeparator": " | ",  // The separator for the browser bar's title between page and site titles
  "fileLocation": "./public/files/",  // The relative path to where the ebook files will be served from
  "historyLocation": "./public/history/", // The relative path to where the history metadata files will be served from
  "maxLibrarySize": 0,  // The maximum number of books that can be added to the library. 0 means unlimited
  "maxFileSize": 0, // The maximum file size of an ebook allowed to be uploaded. 0 means unlimited
  "maxHistory": 0,  // The maximum number of history metadata files that will be saved on your server. 0 means unlimited
  "allowedFormats": [".epub", ".mobi", ".pdf"], // The file formats allowed to be uploaded
  "backupPassword": "password",  // The plaintext password that allows you to access the /backup features. Be sure to change this before going live!
  "hideVisitors": false,  // If true, the "Current Visitors" counter will not update on the front end
  "sslPort": 443,  // The port to serve HTTPS content from if your private key and certificate are specified
  "sslPrivateKey": null,  // The ssl private key received from your certificate authority for HTTPS support
  "sslCertificate": null, // The ssl certificate received from your certificate authority for HTTPS support
  "sslCertificateAuthority": null,  // The ssl certificate authority (CA) received from Let's Encrypt for HTTPS support
  "forceHTTPS": false // Redirect all traffic for http to https (not sure why you wouldn't want this)
}

You can optionally copy the customHtmlAfterFooter.example.html to customHtmlAfterFooter.html if you want to add additional HTML to the bottom of the content container’s body. This is useful for adding <script> snippets like what you get from Fathom for analytics.

Usage

Run npm start to start the Little Library server:

> npm start

Navigate to localhost:3000 in your favorite browser to see the Little Library.

The Little Library allows anyone with access to it to give or take ebooks. I’ll write a more in-depth bit about how exactly to use it when I have some more time.

Management

There is a backup utility located at the /backup path when running the server, i.e. http://localhost:3000/backup. In order to utilize it, you need to include your backupPassword in the url, like this:
http://localhost:3000/backup?pass=password

This utility allows you to download a .zip file of all the ebook and history files on your server and then re-upload those same .zip files back to another server. This is helpful if you use a service like Heroku that does not persist your files when you re-upload the core script files.