simpleshelf: track your books
JavaScript HTML Python Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.docker
app-ddoc
app
config
docs
sample-data
security
server
simpleshelf
tasks
util
.eslintrc.json
.gitignore
LICENSE.txt
README.rst
couchdb_init.sh
docker-compose-production.yml
docker-compose.override.yml
docker-compose.yml
gulpfile.babel.js
package-lock.json
package.json
simpleshelf.dev.env
simpleshelf.prod.env

README.rst

simpleshelf: track your books

simpleshelf stores your personal library of books to read, have read, want to read, and lets you track your progress.

simpleshelf is deliberately designed for simplicity: it tracks enough information for you to identify a book, and to get more information from other sources. The (envisioned) links to OpenLibrary, the Library of Congress, and others will provide more detailed information.

Technical details

simpleshelf is a web application; it stores data in CouchDB, and presents it with a single page app served by NodeJS and written in Backbone.js.

Tools, libraries, plugins

How to install

Development

  1. Install Docker & docker-compose.

  2. Install NodeJS.

  3. Install gulp globally.

  4. Install node dependencies: npm install.

  5. Customize simpleshelf.dev.env by copying/linking it to .env in same directory as docker-compose*.yml.

  6. Build Docker images:

    # Use your Docker Hub ID, or an empty string.
    sudo DOCKER_ACCT=X docker-compose build
    # Append --pull to get latest versions of images
    
  7. Run the app:

    sudo DOCKER_ACCT=X docker-compose up
    

Production

After the npm install step...

  1. Customize simpleshelf.prod.env by copying/linking it to .env in same directory as docker-compose*.yml.

  2. Build Docker production images:

    # Use your Docker Hub ID, or an empty string.
    sudo DOCKER_ACCT=X docker-compose -f docker-compose.yml -f docker-compose-production.yml build
    
  3. Copy docker-compose*.yml & the customized .env to the target directory.

  4. If you intend to run multiple versions on the same system, change the COMPOSE_PROJECT_NAME environment variable in .env, customizing the container names for that instance.

  5. In the target directory, pass the initial CouchDB admin name & password to couchdb_init.sh, and run it.

  6. Run the app:

    sudo DOCKER_ACCT=A docker-compose -f docker-compose.yml -f docker-compose-production.yml up
    
  7. ONE-TIME To seed CouchDB's initial databases:

    # NOTE: the containers MUST be running, and you MUST be able to access them.
    # The two "node" values are intentional (the first references the node container, the second runs the node executable).
    # It is safe to run multiple times; a flag will be set once it successfully runs.
    

    sudo DOCKER_ACCT=A docker-compose -f docker-compose.yml -f docker-compose-production.yml exec --env CDB_USER=Y --env CDB_PW=Z node node runsetup.js

  8. Restart the server if the seed was necessary.

Configuration

Available configuration values are:

  • Port to expose
  • Volumes to customize

How to test

  • gulp test-phantom: runs the PhantomJS test runner, outputting to the console.
  • gulp test-in-browser: runs the BrowserSync runner, launching (or updating) the test page, typically at http://localhost:3000/index.html.
  • gulp test-watch: run the console and browser tests, reloading both when any code changes.

License

GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL-3.0)