ΠΠ°ΠΏΡΡΠΊ ΠΠ ΡΠ΅ΡΠ΅Π· Π΄ΠΎΠΊΠ΅Ρ
Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Π²ΠΈΡΡΡΠ°Π»ΡΠ½ΠΎΠΉ ΡΡΠ΅Π΄Ρ
cd backend
python3 -m venv venv
source venv/bin/activate
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
pip install -r requirements.txt
prisma generate
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π΄ΠΎΠΊΠ΅ΡΠ°
sudo docker run --name pgdb -e POSTGRES_PASSWORD=12345678 -d -p 5432:5432 postgres
P.S. ΠΡΠ»ΠΈ Π΄ΠΎ ΡΡΠΎΠ³ΠΎ ΡΠΆΠ΅ Π·Π°ΠΏΡΡΠΊΠ°Π»ΠΈ
sudo docker run -e POSTGRES_PASSWORD=12345678 -d -p 5432:5432 postgres
ΠΠΈΠ³ΡΠ°ΡΠΈΡ
python3 -m prisma migrate dev
ΠΡΠΎΠ²Π΅ΡΠΊΠ° ΡΠ°Π±ΠΎΡΡ ΠΠ
ΠΡΠ½ΠΎΠ²Π½Π°Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ
ΠΠ°ΠΏΡΠΎΡ/ΠΡΠ²Π΅Ρ
ΠΡ
ΠΎΠ΄Π½ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ
ΠΡΠΎΠ²Π΅ΡΠΊΠΈ
ΠΡΡ
ΠΎΠ΄Π½ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ
ΠΠΎΠ»ΠΎΠΆΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΎΡΠ²Π΅Ρ
ΠΡΠ²Π΅Ρ Ρ ΠΎΡΠΈΠ±ΠΊΠ°ΠΌΠΈ
ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΈ
/user/{user_id}
POST
input:
π’ Successful Response(200):
{
"id": 0,
"games": [
"string"
]
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/user/{user_id}/games
GET
input:
π’ Successful Response:
[
{
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
]
}
]
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/game/{game_id}
GET
input:
π’ Successful Response(200):
{
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
]
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/game/{game_id}
DELETE
input:
π’ Successful Response(200):
{
"cardsDeleted": 0,
"deletedGame": {
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
]
}
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/game/{game_id}
PUT
input:
Request body (application/json)
{
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"rounds": 0
}
π’ Successful Response(200):
{
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
]
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Request body (application/json)
{
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [],
"rounds": 0,
"matchCards": []
}
π’ Successful Response(201):
{
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
]
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Request body (application/json)
{
"term": "string",
"description": "string",
"gameId": 0
}
π’ Successful Response(200):
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/classiccard/{card_id}
DELETE
input:
π’ Successful Response(200):
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/classiccard/{card_id}
PUT
input:
Request_body (application/json)
{
"term": "string",
"description": "string"
}
π’ Successful Response(200):
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Request_body (application/json):
{
"imageURL": "string",
"name": "string",
"description": "string",
"gameId": 0
}
π’ Successful Response(200):
{
"id": 0,
"game": {
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
"string"
]
},
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/matchcard/{card_id}
DELETE
input:
π’ Successful Response(200):
{
"id": 0,
"game": {
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
"string"
]
},
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
/matchcard/{card_id}
PUT
input:
Request_body (application/json)
{
"imageURL": "string",
"name": "string",
"description": "string"
}
π’ Successful Response(200):
{
"id": 0,
"game": {
"id": 0,
"owner": {
"id": 0,
"games": [
"string"
]
},
"ownerId": 0,
"logoURL": "string",
"background": 0,
"welcomeTitle": "string",
"welcomeBody": "string",
"subject": "string",
"leaveTitle": "string",
"leaveBody": "string",
"leaveURL": "string",
"gameType": "CLASSIC",
"classicCards": [
{
"id": 0,
"game": "string",
"gameId": 0,
"term": "string",
"description": "string"
}
],
"rounds": 0,
"matchCards": [
"string"
]
},
"gameId": 0,
"imageURL": "string",
"name": "string",
"description": "string"
}
π΄ Validation Error(422):
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}