Code Monkey home page Code Monkey logo

bookmarker's Introduction

Bookmarker

A personal project to help me retain information from the books I'm reading. MIT license.

Currently only supports a single user, but I plan to extend it to support multiple users eventually.

Demo

You can view a read-only active demo at http://bookmarker.dellsystem.me. This is also a great way to creep on what books I'm reading.

Setup

If you're familiar with Django, you can skip this; it's a standard deployment with Django 4.1. Pip requirements can be found in requirements.txt.

Here's the step-by-step for how to set it up via the command line on a Linux machine that already has git, Python (v3), and virtualenv installed:

Cloning from git

This will create a folder called "bookmarker" in your working directory with all the necessary code.

If you have a Github account with your SSH keys set up:

git clone [email protected]:dellsystem/bookmarker.git

Otherwise:

git clone https://github.com/dellsystem/bookmarker.git

Setting up the virtualenv

Now, access the new directory (cd bookmarker). You'll want to set up a virtualenv in this directory for installing all the dependencies (basically a way to isolate requirements so you can develop multiple projects on the same machine). The exact command may depend on your setup, but for me, it looks like this:

virtualenv -p python3 env

This creates a new directory named "env" within "bookmarker", which will contain all the Python dependencies for this project. You'll want to activate the virtualenv every time you need to run Bookmarker, which you can do in the command line by running

source env/bin/activate

I personally set up an alias to do this automatically every time I need to work on a project. In my bash profile, I have aliases like

alias bm="cd ~/Projects/bookmarker && source env/bin/activate"

so I can just type "bm" in a terminal any time I need to work on Bookmarker.

You can leave the virtualenv at any time with the command deactivate.

Installing the dependencies

Now that you're in the virtualenv, it's to install all the dependencies. This might be a little finnicky depending on your machine and on the state of the dependencies at any given time - if you run into any problems, I'd suggest either Googling the error messages or deleting dependencies from requirements.txt until you get it working (some of them don't need to be there explicitly).

pip install -r requirements.txt

(Make sure you're in the project directory - mine is ~/Projects/bookmarker.)

Setting up the database

For development, we use SQLite, which you may have to install through your OS package manager. In production, you should PostgreSQL or something like that (if that's running locally, all you have to do is set up POSTGRES_PASSWORD as an environment variable), but don't worry about that for now.

To set up the database initially (and create all the basic tables), run:

python src/manage.py makemigrations activity books vocab
python src/manage.py migrate

(Again, this should be in the project directory, bookmarker/).

This will create all the database tables needed for this app to work.

Setting up your account

You'll want to create an admin account to access the admin tools & add/edit/delete data via the frontend. Run

python src/manage.py createsuperuser

and set your desired username/password. Don't worry about the email address.

Almost done, I promise! Final step: reactivate the virtualenv one more time.

deactivate && source env/bin/activate

Running your server locally

Now you're all set to test it out! Run

python src/manage.py runserver

and navigate your browser to http://localhost:8000. It should show you an empty dashboard. To log in, click the "Log in" link in the menu and enter the username and password you set earlier.

Adding data

TODO [goodreads sync page]

note: it's currently hardcoded to my user id lol

Advanced

If you want to deploy this in production, I'd recommend using nginx, gunicorn, systemd, and postgres. To enable postgres, set POSTGRES_PASSWORD.

Unit tests (the few that exist) can be run with python src/manage.py test.

Contact

If this is something you'd be interested in using, send me an email at [email protected].

bookmarker's People

Contributors

dellsystem avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kznmft

bookmarker's Issues

Create umbrella organisation

(Need to figure out a name for it first)

Something to encompass this project as well as a few other reading-related app ideas (most of which will have goodreads integration):

  • Bibliography or mentioned book tracking (similar to Goodreads lists but more suited for the purpose)
  • A WorldCat/GoodReads mashup that lets you see which libraries (among those you've selected) contain books in your to-read shelf

Fill in existing sections

I can close this as soon as I get the number of books w/ unfilled sections down to 0 (however briefly, as long as I don't cheat).

Once all page numbers are filled in, set the first_page field to mandatory (and make it a PageNumberField)

Go through Kindle books

Especially all the Verso books I've recently read. Add terms, notes, summaries (some books will have already been highlighted).

Consider allowing multiple authors

For terms, notes, and sections.

For terms and notes, there should be an option to inherit the author(s) from the section, or book, if there are no sections. (Think about how to pair this with multi-author books due to translations or introductions.)

Search bar in header

  • Books (title, authors, summary)
  • Notes (subjects, quotes, text)
  • Terms (term, definition, quote, comment)
  • Sections (title, summary)

Improve author page

Make it easier to view all sections, notes, and termoccurrences for a given author (not just books)

Create superclass for TermOccurrence, Note

Can abstract away section logic (and more). I know there was a specific annoyance that prompted this but I can't remember it at the moment. I'm sure I'll think of it eventually.

Better section listing

Either create a new page or fill in the existing template with:

  • Rating (out of 5 stars? optional)
  • A truncated summary
  • Author? (Useful for books containing works by multiple authors. That requires a structural change though)

Deploy it

Probably just on my Digital Ocean box, unless I can find a cheap alternative.

Make sure it gets backed up!

Markdown extension for internal links

This should be allowed within quotes, comments, definitions, summaries, etc.

Types of internal links:

  • author (a)
  • book (b)
  • section (s)
  • term (t)
  • termoccurrence (o)
  • note (n)

Not yet sure of the syntax - maybe classic Wikilinks (like [a:David Foster Wallace])? make sure it doesn't conflict with raw text

Eventually it should be possible to see all of the notes, terms, etc that linked to a certain book/author/etc

Add multi-user support

with the ability to set visibility of notes in general, and of certain notes (like with youtube videos)

Add author field to Section model

Useful when a book is a collection of essays by different authors.

If a section is by the same author as the rest of the book, or if there are multiple listed authors, leave it empty.

Improve view_term layout

Looks kind of cluttered now that we have more fields for TermOccurrences. Should look more consistent with the rest of the app.

Better progress indicator on homepage

Need a more visual, colourful indication of how many books I have yet to go through.

Also consider merging completed_notes and completed_terms once I've finished it for the initial batch of books, since ideally, it'll all be done in one go going forward.

Redesign homepage

As I add more books, it'll just get more and more cluttered.

Need to think of a better paradigm based on the way I want to use it in the future. Maybe involving a separate books page? (Once search is complete.)

New field type for page numbers

Used for sorting terms/notes. Integers need to be sorted correctly, and so do Roman numerals and any other page numbers that might be used.

Necessary if I want, say, the section page to contain notes and terms in order of appearance. Also for catching mistakes when entering page numbers (i.e., if the just-entered page number is less than the previously-entered page; not always an error, but often so).

Need to think about whether or not this is actually necessary or if timestamp is a sufficient proxy.

EDIT: Oh yeah. I needed this for determining the section from the page number. So it is necessary, if I ever want to be able to accomplish #13.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.