chore(): Initial code commit

This commit is contained in:
Elia el Lazkani 2024-11-21 20:56:50 +01:00
parent c7dd0fbd20
commit 68143f8ba0
8 changed files with 1139 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
__pycache__/

1074
poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

19
pyproject.toml Normal file
View file

@ -0,0 +1,19 @@
[tool.poetry]
name = "pokeritup"
version = "0.0.1"
description = "Poker It Up is a Pointing Poker style application."
authors = ["Elia el Lazkani <elia@lazkani.io>"]
license = "BSD-2"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
fastapi = {extras = ["standard"], version = "^0.115.5"}
[tool.poetry.group.dev.dependencies]
black = "^24.10.0"
isort = "^5.13.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

1
src/__init__.py Normal file
View file

@ -0,0 +1 @@
from src.main import app

4
src/entities/cards.py Normal file
View file

@ -0,0 +1,4 @@
CARDS = {
"fibonacci": [0.5, 1, 2, 3, 5, 8, 13, 21, 34, 55, "?"],
"tshirt": ["XS", "S", "M", "L", "XL", "XXL", "XXXL", "?"],
}

10
src/entities/person.py Normal file
View file

@ -0,0 +1,10 @@
class Person:
"""
Person entity
"""
def __init__(self, name):
"""
Person entity initializer
"""
self.name = name

10
src/entities/room.py Normal file
View file

@ -0,0 +1,10 @@
class Room:
"""
Room entity
"""
def __init__(self, name):
"""
Room entity initializer
"""
self.name = name

20
src/main.py Normal file
View file

@ -0,0 +1,20 @@
from typing import Annotated
from fastapi import FastAPI, HTTPException
from src.entities.cards import CARDS
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World!"}
@app.get("/cards/{card}")
def get_cards(card: str):
for key in CARDS:
if key in card:
return {"cards": CARDS[card]}
raise HTTPException(status_code=404, detail="Cards with this type not found")