Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lazaronazareno/no_country_deploy
https://github.com/lazaronazareno/no_country_deploy
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lazaronazareno/no_country_deploy
- Owner: lazaronazareno
- Created: 2024-08-07T01:34:49.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T11:01:39.000Z (3 months ago)
- Last Synced: 2024-08-09T12:38:29.010Z (3 months ago)
- Language: JavaScript
- Size: 7.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```bash
git clone https://github.com/No-Country-simulation/c19-57-n-python-react.git
```2. Select branch
```bash
git chekout branch
```3. Install requirements
```bash
pip install -r requirements.txt
```4. Configure database credentials
```python
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmakerengine = create_engine("mysql+pymysql://:@localhost/")
localsesion = sessionmaker(autoflush=False, autocommit=False, bind=engine)
base = declarative_base()
```5. Execute application
```bash
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](readme/design-api.png)
#### Model Database
It is an entity-relationship model
![Database](readme/model-database.png)
### Migration in FastAPI
Make changes to the models and execute them in the database.
**Install Alembic:**
```bash
pip install alembic
```**Init Alembic:**
```bash
alembic init alembic
```**Configure alembic.ini:**
```bash
sqlalchemy.url = driver://user:password@localhost/dbname
```**Create a migration:**
```bash
alembic revision --autogenerate -m "Cambiar nombre de columna"
```**Execute migration:**
```bash
alembic upgrade head
```