BidYourAuction
Setup
Requirements
- PostgreSQL
- Python 3.9
- Libraries & Frameworks
python -m pip install wheel
python -m pip install flask
python -m pip install jwt
python -m pip install psycopg2
python -m pip install cryptographyConnect to database
psql -h localhost -p 5432 -d postgres -U postgresDatabase Setup
- Connect to the database
psql -h <host> -p <port> -d <db_name> -U <user>- Insert password
<password>- Execute data.sql
\i data.sql;
Register admins
- Modify registAdmins.py
# [ [username, password, email], ... ]
admins = [
["username1", "password1", "e@mail1.com"],
["username2", "password2", "e@mail2.com"],
...
]- Execute Script
python3 registAdmins.pyRequests
User Sign Up
POST http://localhost:8080/dbproj/user{
"username": "maria",
"email": "maria@email.com",
"password": "password"
}Sign In
PUT http://localhost:8080/dbproj/user{
"username": "mara",
"password": "password"
}Create Auction
POST http://localhost:8080/dbproj/leilao{
"artigoId": 69,
"precoMinimo": 10000.00,
"titulo": "Lingote de ouro",
"descricao": "Ouro puro (24 quilates)",
"dataFim": "2021-06-10 23:59"
}List existing Auctions
GET http://localhost:8080/dbproj/leiloesSearch existing Auctions
GET http://localhost:8080/dbproj/leiloes/{keyword}Auction's details
GET http://localhost:8080/dbproj/leilao/{leilaoId}List Auctions where user has some activity
GET http://localhost:8080/dbproj/user/leiloesBid
POST http://localhost:8080/dbproj/licitar/{leilaoId}/{licitacao}Edit Auction's details
PUT http://localhost:8080/dbproj/leilao/{leilaoId}{
"titulo": "Agua do Mondegoo",
"descricao": "Agua fresca do rio Mondegoo"
}Write feed message
POST http://localhost:8080/dbproj/feed/{leilaoId}{
"message": "O que justifica o preco do artigo?",
"type": "question"
}List notifications
GET http://localhost:8080/dbproj/inboxCheck if Auction ended
PUT http://localhost:8080/dbproj/leilao/checkFinishCancel Auction
PUT http://localhost:8080/dbproj/leilao/cancel/{leilaoId}Ban user
PUT http://localhost:8080/dbproj/ban/{username}Get some statistics
GET http://localhost:8080/dbproj/stats