Skip to content

yorch-codes/task_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task API

A simple API Tasks created whit FastAPI, use the PostgreSQL database to store tasks with SQLAlchemy ORM.


Features

  • Create tasks
  • Read tasks
  • Update tasks
  • Delete tasks

Tech Stack

  • Python3
  • FastAPI
  • PostgreSQL
  • SQLAlchemy
  • Pytest

Installation

Clone the repository:

git clone git@github.com:yorch-codes/task_api.git
cd task_api

Create environment and install dependencies:

Using uv

# Create environment with uv
uv venv
# Use uv to install dependencies
uv pip install -r requirements.txt

Using pip

# Create environment with pip in windows
python -m venv venv
# Create environment with pip in linux/macOS
python3 -m venv venv
# Use pip to install dependencies
pip install -r requirements.txt

Create database migrations with alembic

alembic revision --autogenerate -m "create task table"
# Apply the latest migration
alembic upgrade head
# Downgrade to the previous migration
alembic downgrade -1

Usage

Run the project:

# Run the application in windows
uvicorn app.main:app --reload
# Run the application in linux/MacOS
uvicorn app.main:app --reload

Run the tests:

pytest

Project Structure

task_api/
│   alembic/
│   ├── versions/
│   │   ├── 000000000_init_db.py
│   ├── env.py
│   ├── script.py.mako
│   ├── README.md
├── app/
│   ├── models/
│   │   ├── __init__.py
│   │   ├── task.py
│   ├── main.py
│   ├── db/
│   │   ├── __init__.py
│   │   ├── database.py
├── docs/
│   ├── planning.md
│   ├── architecture.md
├── tests/
    ├── test_main.py
├── postman/
│   ├── Task_API.postman_collection.json
├── requirements.txt
├── .env
├── .gitignore
├── alembic.ini
├── README.md

API Documentation

Once the server is running, interactive documentation is available at:

Swagger Interactive API Docs ReDoc API Docs

Postman Collection

A Postman collection is included in the repository:

Postman Collection

Import it into Postman to test all endpoints quickly.


Aditional Documentation

Project documentation:


Roadmap

Planned improvements:

  • Data persistence
  • Authentication
  • Authorization
  • Deployment
  • API documentation
  • tests

License

MIT

About

A simple API Task project created whit FastAPI, using local memory to work whit HTTP Methods for CRUD operations.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors