XL
GitHub

Book Club API

Ecto
Phoenix

Introduction: Help a Book Club Keep Track of Their Reading!

A local book club needs your help! They’re looking for a system to store their books and track reading progress.

Here’s how the book club works:

The club organizes social events where members discuss the pages of a book they read beforehand. At any given time, multiple books are being read simultaneously. Members can choose which events to attend, but they usually select one book and only participate in the events for that book.

Since the club is managing multiple books at once, it’s easy to lose track of which books are being read and where each one left off. Can you save the day by creating an API that helps them keep everything organized and on track?

Task

Create an API for listing a book club’s books, along with the last page that was read.

When implementing the project, you must use:

Requirements

Data model

The mix phx.gen command in Phoenix creates an application configured to use PostgreSQL by default. For a quick start, consider sticking with PostgreSQL as your database.

Seeding

To be able to showcase your application, you need to allow for database seeding. Note that the seeding only serves for demonstration (and development) purposes

You can use Elixirland’s Xl Faker package to generate random titles and page content.

Endpoints

GET /api/books

GET /api/books/:param

Documentation

Include a README.md file in the root directory of your application to provide documentation.

Taking it further

To keep the project simple, the requirements are kept relatively simple. However, if you are looking for an extra challenge, consider implementing one or several of the following features:

However, keep in mind that the example implementation provided by Elixirland does not cover these features.

How to get started

Here is an overview of some useful commands and tips to get started with your implemenation of a project.

Where is the example?

You can find the author’s example solution to this project in the project’s GitHub repository, inside the /example directory.