LibAwesome

Sabrina Lowney

My name's Sabrina and I'm a Cohort 12 student at Ada Developer's Academy in Seattle, WA. LibAwesome is an iOS app I created in three weeks for my capstone project.

This project can also be found on github.

The Wrapping: What Does the App Do?

LibAwesome is a book-tracker app geared towards book-lovers who want to see what they want to read and what they've read over time in an uncluttered phone app -- especially for book-lovers like me, who don't have a lot of time to read and end up with long, unorganized lists of books they want to read.

LibAwesome is geared around three main functions: adding books, organizing books, and viewing books.

Adding Books

LibAwesome provides two main ways of adding books to the app.

Accessing the Google Books API

LibAwesome has three capabilities that access the Google Books API to generate a book's data automatically.

  • Scan a Barcode

    Most books published after 2007 have their ISBN-13 identifier encoded in their barcode. If the user grants the app access to the camera, LibAwesome can scan the ISBN from the barcode, query the Google Books API, and create a new book in the user's library automatically.

    This process may fail for books that were published before 2007, and since the Google Books database is incomplete and may only have certain versions of a book on record, the app may pop up an alert saying it couldn't find a book with that ISBN.

    In this case, users have various other options for adding a book.

  • Search by ISBN

    Users can search for a book by typing its ISBN-10 or ISBN-13 into a form. LibAwesome will query the Google Books API and, if any books match, it will automatically add the book to the user's library and take them to its detail page.

    This can work even when scanning does not in cases where the ISBN printed on a book is an ISBN-10, which would not be encoded on the barcode.

  • Search by Title/Author

    If the ISBN cannot be found or if the user does not have it on hand, they can also simply search by entering a book's title and/or any number of author names.

    LibAwesome will query the Google Books API and display a list of up to 20 resulting books. The user can then view details of these books and choose one of these books to add to their library.

Manually Entering Data

Users can also manually enter a book's data to create a book, if, for instance, they have a particularly rare book.

Organizing Books

LibAwesome allows books to be organized along two main axes: status and tag.

Status

All books can have one of the following statuses:

  • Want to Read
  • Currently Reading
  • Completed
  • Paused
  • Discarded

All books entered into the library are automatically given a starting status of 'Want to Read', set to the current date.

The idea is, users will spot a book that looks interesting and add it to their library. Later, they may start reading it and change the status to match.

The statuses have dates and users can view the status history of their book to see when they first added it and what's happened since. The status history is essentially a history of a user's interaction with a given book.

Dates also allow users to sort their library by date to get an idea of what they've read or added over time, and to pick the least or most recently added book to read next.

Tags

Users can give books tags. These tags can be nested simply by separating the nested elements with a slash, "/".

Tags can be used as genres, to allow users who feel like reading a particular genre next a way to easily find books that fit that criteria, or in any way the user wants. They provide user's a customizable way of organizing their library.

Viewing Books

LibAwesome allows books to be viewed by tag, by author, by series, or in a main book list which can be filtered by status or rating and sorted by title or status date.

The Filling: What Does The App Look Like?

Signing Up and Logging In

Adding A Book: Scanning A Barcode

Adding A Book: Entering an ISBN

Adding A Book: Using the Search Function

Updating a Book

Working With Series

Sorting By Tag

Sorting by Author

Changing A Book's Status

Changing A Book's Rating

The Current Reads List

The Filling Under a Microscope: How Does The App Work?

Okay, so we can all conclude: the app is pretty great.

But what makes it great? How does it work under the hood?

Diagrams

Data Flow Diagram
Database Table Diagram
Database Models Diagram

The Frontend -- iOS

The LibAwesome app is a native iOS app: I wrote it in Swift using XCode as my development environment.

Apple provides two methods of writing apps in Swift: UIKit (with storyboards) and SwiftUI (declarative, more like React). SwiftUI sounded intruiging, and also like the direction Apple intends to push developers toward in the future, so I used SwiftUI.

SwiftUI came with its pros and cons. The biggest pro: it is pretty darn cool. The biggest con: it's not yet quite as fully-fledged in terms of functionality as UIKit.

The frontend of my app is not deployed on the App Store, but it is a breeze to install if you want to test it out for yourself. The repository and instructions for installing the app can be found here.

The Backend -- API

The LibAwesome iOS app is really only half of the capstone project, the other half being the REST API the iOS app communicates with in order to interact with the database.

This API is written with Django and Python using the Django REST Framework. It uses token authentication, so when users sign up, a token is created and associated with their account and Django saves a hashed version of their password.

When a user logs in, Django hashes the password and compares it and the username against the users in the database. If it finds a match, it sends back the token.

My Swift app caches this token and then uses it to make HTTP requests for operations such as getting a list of the books that are associated with the user or updating the information for a particular book.

The API is deployed to Heroku and the helloworld endpoint -- the only endpoint besides signing up that doesn't require authentication -- can be found here. The API is also on github.