https://www.gitpod.io/
https://github.com/gusx42/life-bank
Caso você esteja em um ambiente local execute os passos abaixo dentro da pasta do projeto no terminal do vscode
pip3 install virtualenv
virtualenv --version
python -m virtualenv venv
source venv/bin/activate
python app/main.py
pip install -r requirements.txt
docker-compose up --build
docker-compose down
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
(o terminald deve pedir a senha mypass
)
psql -h localhost -port 5432 -U postgres -W
- browser (http://127.0.0.1:8000/)
- browser (http://127.0.0.1:8000/docs/)
- [GET] thunder-client (http://127.0.0.1:8000/health)
- [GET] thunder-client (http://127.0.0.1:8000/Accounts)
- [POST] thunder-client (http://127.0.0.1:8000/Accounts/)
- [GET] thunder-client (http://127.0.0.1:8000/Transactions)
- [POST] thunder-client (http://127.0.0.1:8000/Transactions/)
sequenceDiagram
Navegador->>+account_route: GET /accounts
account_route->>account_service: get_accounts()
account_service->>account_repository: query(Account)
account_repository->>account_service: List[Account]
account_service->>account_route: List[AccountSchema]
account_route->>Navegador: HTTP Status code: 200 json [accounts]
sequenceDiagram
Navegador->>+account_route: POST /accounts
account_route->>account_service: create_accunt(AccountCreateSchema)
account_service->>account_repository: Session.add(Account)
account_repository->>account_service: Account
account_service->>account_route: AccountSchema
account_route->>Navegador: HTTP Status code: 201 json account