A sample repository to support New To Tech sessions exploring REST for Gem City Tech.
See the backing presentation here.
You must have Python 3.12 and Poetry installed.
Ensuring that you have Poetry available in your terminal, run
poetry shell
to use Poetry's virtual environment, and then
poetry install
to install FastAPI and the other dependencies. Then, change directory to the api
folder:
cd api
and run the service using Uvicorn:
uvicorn main:app --reload
Navigate to http://127.0.0.1:8000/docs
to see the built-in Swagger API documentation.
-
Add a 'genre' field to Book. Make sure that you can see this field using
GET /books
and update it usingPUT /books/{id}
. -
Add an endpoint that lets you
GET
a book by author and/or publication year. -
Add a
GET
endpoint that shows the average rating across all books. -
Add support for multiple ratings - and reviewers - per book, and to view both individual reviews and the average review score for a book.
-
Share your solutions to one of the above exercises using a GitHub Pull Request.
-
Return the summary and ratings for a book using Goodreads' API.
-
Return author biographies using Wikipedia's API.
-
Rework this book-based sample app into a different domain: customer tracking, RPG character creator, pizza store, etc.
-
Add an ORM tool such as SQLAlchemy and use it to persist data between runs.
-
Migrate the app's API to GraphQL.
-
Dockerize the app.
-
Host/deploy the app publicly.
-
Build a small JS UI in front of the API.
If you use Insomnia, Insomnia REST call collection.json
can be imported to get you started making calls against this API.