Skip to content

📚 Django API with CI/CD pipeline and dockerization.

License

Notifications You must be signed in to change notification settings

BSski/books-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Books API

Build Status Maintainability CodeFactor codecov Code style: black

🎆 Live demo 🎆

[Heroku retracted its free tier, therefore all my demos are unavailable until further notice.]

Table of contents

📜 Project description

This is a project that was a previous recruitment task of mine. I fixed the points mentioned in the feedback and added dockerization, a CI/CD pipeline on SemaphoreCI, gunicorn, and changed hosting from pythonanywhere to heroku. The project is a books API: it provides a feature to upload books from Google Books API to the database and browse them (with optional filters).

🔨 Technologies used

  • Python 3.9.12
  • Django 4.0.3
  • Django REST Framework 3.13.1
  • PostgreSQL 14.2
  • Gunicorn 20.1.0
  • Docker
  • SemaphoreCI
  • Heroku

🚀 Features

The recruitment task demanded such features and all are provided in a required format:

  • accessing /books displays all stored books,
  • accessing /books?published_date=<year> displays stored books published in a certain year,
  • accessing /books?sort=-published_date displays all stored books sorted by published date in descending order,
  • accessing /books?author=<author1>&author=<author2> displays all stored books written by author1 and all stored books written by author2,
  • accessing /books/<book_id> displays details of a single book of id book_id,
  • sending a POST request to /db with a q keyword adds 10 books to the API's database; the books come from a query sent to the Google Books API with the passed keyword and the operation will update existing books if there are such.

Furthermore, the API is deployed on Heroku from a Docker image using a CI/CD SemaphoreCI pipeline:

CI/CD screenshot

⬆️ Room for improvement

Room for improvement:

  • sorting books with incomplete date as if they were written 1st of January, but displaying year only, instead of the current solution,
  • more tests.

📞 Contact

👷 Author

🔓 License

MIT