From 7dc9d18ccd869ab162b2d2ae379d365d60dcf8d9 Mon Sep 17 00:00:00 2001 From: shadowik Date: Tue, 24 Sep 2024 13:45:23 +0400 Subject: [PATCH] Initial Commit + FastApi server structure --- front/README.md | 1 + server/README.md | 27 +++++++++++++++++++++++++++ server/main.py | 13 +++++++++++++ server/requirements.txt | 33 +++++++++++++++++++++++++++++++++ server/src/router.py | 0 5 files changed, 74 insertions(+) create mode 100644 front/README.md create mode 100644 server/README.md create mode 100644 server/main.py create mode 100644 server/requirements.txt create mode 100644 server/src/router.py diff --git a/front/README.md b/front/README.md new file mode 100644 index 0000000..02e6fb7 --- /dev/null +++ b/front/README.md @@ -0,0 +1 @@ +# Evaluation Efficiency Optimization Wind Front \ No newline at end of file diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..5e79c49 --- /dev/null +++ b/server/README.md @@ -0,0 +1,27 @@ +# Evaluation Efficiency Optimization Wind Server + + +## Requirements +1) Python 3.12 + + +## Getting Started +1. Create virtual environment + ```zsh + python3 -m venv .venv + ``` + +2. Source virtual environment + ```zsh + source .venv/bin/activate + ``` + +3. Install dependencies + ```zsh + pip install -r requirements.txt + ``` + +4. Start FastAPI process + ```zsh + fastapi dev main.py + ``` \ No newline at end of file diff --git a/server/main.py b/server/main.py new file mode 100644 index 0000000..fba166a --- /dev/null +++ b/server/main.py @@ -0,0 +1,13 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +async def read_item(item_id: int, q: str | None = None): + return {"item_id": item_id, "q": q} \ No newline at end of file diff --git a/server/requirements.txt b/server/requirements.txt new file mode 100644 index 0000000..5d438d4 --- /dev/null +++ b/server/requirements.txt @@ -0,0 +1,33 @@ +annotated-types==0.7.0 +anyio==4.6.0 +certifi==2024.8.30 +click==8.1.7 +dnspython==2.6.1 +email_validator==2.2.0 +fastapi==0.115.0 +fastapi-cli==0.0.5 +h11==0.14.0 +httpcore==1.0.5 +httptools==0.6.1 +httpx==0.27.2 +idna==3.10 +Jinja2==3.1.4 +markdown-it-py==3.0.0 +MarkupSafe==2.1.5 +mdurl==0.1.2 +pydantic==2.9.2 +pydantic_core==2.23.4 +Pygments==2.18.0 +python-dotenv==1.0.1 +python-multipart==0.0.10 +PyYAML==6.0.2 +rich==13.8.1 +shellingham==1.5.4 +sniffio==1.3.1 +starlette==0.38.6 +typer==0.12.5 +typing_extensions==4.12.2 +uvicorn==0.30.6 +uvloop==0.20.0 +watchfiles==0.24.0 +websockets==13.1 diff --git a/server/src/router.py b/server/src/router.py new file mode 100644 index 0000000..e69de29