Skip to content

Maxioum/technical-test-dev-back-end-python-fast-api

Repository files navigation

Installation

  1. Clone the repository
git clone https://github.com/Maxioum/technical-test-dev-back-end-python-fast-api.git && cd technical-test-dev-back-end-python-fast-api
  1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Download dependencies
uv sync

Starting the server

uv run uvicorn app.main:app --reload

Example request:

Here’s a set of simple curl examples you can use to interact with the app once it’s running (default at http://localhost:8000):

  1. Create a Ticket
curl -X POST "http://localhost:8000/api/v1/tickets" -H "Content-Type: application/json" -d '{"title": "Feature: Add Ticket Type", "description": "Add different types of ticket, such as feature, bug etc"}'
  1. Get All Tickets
curl -X GET "http://localhost:8000/api/v1/tickets"
  1. Get a Ticket by ID

(Replace 1 with the actual ID from the create response)

curl -X GET "http://localhost:8000/api/v1/tickets/1"

4️. Update a Ticket

curl -X PUT "http://localhost:8000/api/v1/tickets/1" -H "Content-Type: application/json" -d '{"title": "Feature: Add Ticket Types"}'
  1. Mark a Ticket as closed
curl -X PATCH "http://localhost:8000/api/v1/tickets/1/close" \
     -H "Content-Type: application/json" \

Documentation

While the app is running visit:

http://localhost:8000/docs

Docker

docker compose up --build tickets-api

Unit Tests

  1. Install dev dependencies
uv sync --dev
  1. Run tests
uv run pytest
  1. Run tests with coverage
uv run pytest . --cov

Check linting

uvx ruff check

About

fast api technical test for a company

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published