An open API service indexing awesome lists of open source software.

https://github.com/dm-zhuk/goit-pythonweb-hw-012

REST API-app
https://github.com/dm-zhuk/goit-pythonweb-hw-012

docker-compose python3 rest-api

Last synced: about 2 months ago
JSON representation

REST API-app

Awesome Lists containing this project

README

          

# Contacts Management REST API

This project is a fully tested and Dockerized RESTful API for managing contacts, featuring:

- JWT-based authentication
- Role-based access control
- PostgreSQL & Redis integration
- Pytest coverage for both unit and integration tests

## ๐Ÿงช Testing & Coverage

This project uses **Poetry**, **Pytest**, **Coverage.py**, and **Docker Compose** to run unit and integration tests with combined coverage reporting.

### ๐Ÿ”ง Prerequisites

- [Poetry](https://python-poetry.org/docs/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)

### ๐Ÿงผ Clean up previous results

```bash
make clean

### โœ… Run local unit tests (pure mocks)

```bash
make .coverage.unit

### ๐Ÿณ Run integration tests (DB + Redis via Docker)

```bash
make .coverage.integration

### ๐Ÿ“ฆ Combine & view coverage reports

```bash
make combine-coverage

Combines coverage data from unit + integration runs and generates an HTML report:

๐Ÿ‘‰ Open htmlcov/index.html in your browser to view it.

### ๐Ÿš€ Full test pipeline (clean โ†’ test โ†’ report)

```bash
make test-all

#### Runs everything in order:

Run Clean up

Run unit tests

Run integration tests

Combine coverage reports