A couple of weeks ago, I participated in Minnehack 2023. Minnehack is a hackathon where students are given a prompt and have 24 hours to write software that best addresses the prompt. This year, the prompt was to write software that improved civic engagement. And while the prompt was civic engagement, my teammates and I came to the hackathon with an app idea already in mind.
Our idea was to develop a library management system for people to manage their book libraries and track which books were checked-out, and by who.
Inspiration
The teammate who originally presented the idea had already developed a basic library management system for his wife, who is a grade school teacher. He had developed the system so that his wife could track which students had books checked-out of her personal in-class library (which contains over 500 books). The system was basic and consisted of a simple web page that interfaced with a Google spreadsheet. Funnily enough, I had developed a very similar system to manage the inventory of arts and crafts materials for my girlfriend’s campus housing job while in college. I understood why he would want to develop a system that leveraged an actual database after my own experience.
Introducing Bookend
Bookend is a self-hosted web application that can manage your personal library and easily track check-outs and returns.
Bookend can:
- Import existing library data (csv)
- Display and sort your current library
- Check-in and out books to users
- Search for books
- Track which books users have checked-out
- Export your library and users as a .csv
- Scan books with your mobile phone (using the mobile app)
- Automatically gather book metadata when ISBN is provided
Implementation
Before the competition, we had decided on using Django, a python web framework to build the web app. None of us had experience using Django, but we had heard it was easy to get started and fast to develop web pages with. I think it paid off to come with a framework pre-chosen, as it let us spend less time trying to figure out new technology (to us) and more time on building the actual project.
Even though Python isn’t my first language, I thoroughly enjoyed using Django. The templating system was great to use, and similar to Hugo which I was already familiar with. It was very easy to include integration for styling frameworks like Bootstrap and TailwindCSS.
I think my favorite part of Django though, is the way it handles the database.
Django comes with a Sqlite database out-of-the-box and automatically creates tables based on the model classes you develop in Django.
But that’s not all, as you don’t really need to write a data-access layer to interface with the database. If you have an endpoint or website that saves objects, you won’t have to write any SQL to add or select data.
Django lets you easily save and access the data through what they call QuerySets. This means that getting all books is as simple as Book.objects.all()
.
Since we had learned how to use Django before the hackathon, we were quickly able to implement the core features of the website by 2AM. With plenty of time left, I decided to make a mobile app using Flutter so that users could scan books using their phone camera to add them to their library. This app is really simple, and not anything to brag about, but it gets the job done by simply making a POST request to an endpoint exposed by the Django website.
Results
While we didn’t place in the top three teams this time around, I still had a lot of fun coding all night with friends and seeing the ideas that other teams built upon.
You can check out screenshots of the app here! And you can check out the code here!