Skip to content

FranZavalla/codigo-bonito-api-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Código Bonito - Product API

Description

A small REST API to manage products. The objective is to show the good guidelines for creating pretty code and teach the different layers that a project has.

NOTE: This project is a refactoring of the original project created for various talks

Requirements

  • Python 3.10.12 or higher
  • Poetry

Installation

1. Install Poetry

curl -sSL https://install.python-poetry.org | python3  -

Make sure poetry is in your PATH. You may need to restart your terminal.

2. Install dependencies

poetry install

This installs all project dependencies listed in pyproject.toml.

Running the app

Make sure you are in the root of the project. Create a .env file in the app folder with the following content:

DATABASE_PATH=path_to_your_database.sqlite
ORM=sqlalchemy
# ORM=ponyorm
BLUELYTICS_API_URL=https://api.bluelytics.com.ar/v2/latest

Then run the following command at the root of the project to start the app:

poetry run uvicorn app.main:app --reload

Running the tests

Make sure you are in the root of the project. To run the tests, use the following command:

make run_all_tests

To run an specific test, use the following command:

make run_specific_test test=test_name

Running the tests with coverage

We use # pragma: no cover to avoid coverage warnings for the abstract classes that are not covered by tests.

make run_tests_with_coverage

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •