https://github.com/sebastianruizm/fastapi-postgres
Integración entre FastAPI y Postgres
https://github.com/sebastianruizm/fastapi-postgres
docker fastapi postgres python
Last synced: 3 months ago
JSON representation
Integración entre FastAPI y Postgres
- Host: GitHub
- URL: https://github.com/sebastianruizm/fastapi-postgres
- Owner: sebastianruizm
- License: gpl-3.0
- Created: 2024-06-03T02:08:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-04T18:15:26.000Z (about 2 years ago)
- Last Synced: 2025-01-08T20:48:23.933Z (over 1 year ago)
- Topics: docker, fastapi, postgres, python
- Language: Python
- Homepage:
- Size: 824 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-postgres
Lectura y escritura en base de datos Postgres con FastAPI
```mermaid
flowchart LR
U["User"]
U-.->|"POST"|F
U-->|"GET"|F
subgraph D["Docker"]
P[("Postgres")]
F["FastAPI"]
F-.->|"INSERT"|P
F-->|"SELECT"|P
end
```
## Quickstart
En este ejemplo utilicé GitHub Codespaces pero también se puede ejecutar localmente
### 0 Add port
Solo para GitHub Codespaces


### 1 Build
Ejecutar docker-compose mediante Makefile
```bash
make build
```

### 2 Check Postgres
Validar que Postgres se está ejecutando correctamente

### 3 Check FastAPI
Validar que FastAPI se está ejecutando correctamente
http://0.0.0.0:8000


### 4 FastAPI Docs
Acceder a FastAPI docs para interactuar con la base de datos Postgres
http://0.0.0.0:8000/docs

### 5 API POST
Insertar registro en la base de datos mediante método POST


### 6 API GET
Consultar registro en la base de datos mediante método GET


### 7 Validate Postgres
Validar datos en Postgres
