Skip to content

Patitas es una pagina de adopción de mascotas desarrollada en el contexto de simulación laboral con No Country.

Notifications You must be signed in to change notification settings

No-Country-simulation/c19-57-n-python-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI

Application focused on the adoption of animals, this allows users to enter and adopt the pet you like, you can also apply to adopt the pet or be a temporary home.

Installation

  1. Clone the repository
git clone https://github.com/No-Country-simulation/c19-57-n-python-react.git
  1. Select branch
git chekout branch
  1. Install requirements
pip install -r <paht/path>requirements.txt
  1. Configure database credentials
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

engine = create_engine("mysql+pymysql://<user>:<password>@localhost/<name_database>")

localsesion = sessionmaker(autoflush=False, autocommit=False, bind=engine)

base = declarative_base()
  1. Execute application
uvicorn Backend.main:main_app --reload

Application design

The application is based on the RESTful (Representational State Transfer) architectural model, which performs operations on resources:

  • GET
  • POST
  • PUT
  • DELETE

Design

Model Database

It is an entity-relationship model

Database

Migration in FastAPI

Make changes to the models and execute them in the database.

Install Alembic:

pip install alembic

Init Alembic:

alembic init alembic

Configure alembic.ini:

sqlalchemy.url = driver://user:password@localhost/dbname

Create a migration:

alembic revision --autogenerate -m "Cambiar nombre de columna"

Execute migration:

alembic upgrade head

About

Patitas es una pagina de adopción de mascotas desarrollada en el contexto de simulación laboral con No Country.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published