Skip to content

tillraab/library_api

Repository files navigation

Books API

A FastAPI-based REST API for managing a library of books, using SQLite for storage and Docker for deployment.

Setup

  1. Clone the repository
  2. Install dependencies
    • For production:
      pip install -r requirements.txt
    • For development/testing:
      pip install -r requirements.txt -r requirements-dev.txt
  3. Database
    • To manually create or reset the example database, use the scripts in database/.

Workflow

  • Build Docker image:
    • Run the VS Code task "Build Docker Container" or:
      ./bin/build.sh
  • Run the API in Docker:
    • Run the VS Code task "Run Docker Container" or:
      ./bin/up.sh
  • Stop the Docker container:
    • Run the VS Code task "Down Docker Container" or:
      ./bin/down.sh

Testing

  • Development dependencies:
    • Install from requirements-dev.txt for local testing.
  • Unit tests:
    • Run all tests:
      python3 -m unittest discover -s test

Project Structure

  • main.py — FastAPI app entry point
  • api/ — API routes and routers
  • database/ — SQLite connector and scripts
  • test/ — Unit and integration tests
  • bin/ — Shell scripts for Docker workflow

For more details, see comments in the code and test files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published