A modern web application for managing a books database with a beautiful UI and API.
- RESTful API for managing books
- Beautiful and responsive user interface
- Real-time filtering and sorting of books
- Pagination for large datasets
- Categorization of books
The easiest way to run the application is using Docker Compose:
- Make sure you have Docker and Docker Compose installed
- Clone this repository
- Run the following command in the project directory:
docker-compose up -d
The application will be available at http://localhost:8000
To stop the application:
docker-compose down
-
Install Poetry:
curl -sSL https://install.python-poetry.org | python3 -
-
Install the Dependencies:
poetry install
-
Run the Application:
poetry run dev-server
The application will be available at http://localhost:8000
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python server.py
The application will be available at http://localhost:8000
The API documentation is available at http://localhost:8000/docs when the server is running.
Run all API tests:
poetry run pytest
Run tests with verbose output:
poetry run pytest -v
Run a specific test:
poetry run pytest tests/test_books.py::test_create_book -v
First, initialize the Browser library (only needed once):
poetry run python -m Browser.entry init
Run all Robot Framework UI tests:
poetry run robot --outputdir robot_results robot_tests/
Run a specific Robot test:
poetry run robot --outputdir robot_results -t "User Can Open Books UI" robot_tests/
Or use the provided script to run all UI tests:
./scripts/run_robot_tests.sh
The Robot Framework tests handle Docker automatically: they start the application with docker-compose up
and clean up with docker-compose down
when tests are complete.
To generate sample books data:
python scripts/migrate_db.py
python scripts/generate_books.py