Skip to content

Commit c3aa969

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 87ce2bc commit c3aa969

File tree

4 files changed

+616
-15
lines changed

4 files changed

+616
-15
lines changed

main.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,35 @@
55
from typing import Dict
66
import asyncio
77

8+
import src.common.config as config
9+
810
async def setup_webserver() -> None:
911
"""Setup web server configuration."""
10-
# Placeholder for web server setup logic
1112
from src.modules.api import server
13+
# import src.modules.yolo_train
1214
await server()
15+
pass
1316

1417
async def setup_transporter() -> None:
1518
"""Setup transporter configuration."""
16-
# Placeholder for transporter setup logic
17-
# import src.modules.
1819
import src.modules.transporter
20+
pass
21+
22+
async def setup_gradio() -> None:
23+
"""Setup transporter configuration."""
24+
# import src.modules.gradio_app
25+
pass
1926

2027
async def main() -> None:
2128
"""Main application entry point."""
2229
try:
2330
print("Start app...")
31+
2432
# import src.modules.transporter
2533
task1 = asyncio.create_task(setup_webserver())
2634
task2 = asyncio.create_task(setup_transporter())
27-
await asyncio.gather(task1, task2)
35+
task3 = asyncio.create_task(setup_gradio())
36+
await asyncio.gather(task1, task2, task3)
2837
print("App started successfully.")
2938

3039

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
8+
"aiokafka>=0.12.0",
89
"fastapi[standard]>=0.115.8",
10+
"gradio>=5.34.2",
11+
"gradio-webrtc>=0.0.31",
912
"ipykernel>=6.29.5",
1013
"matplotlib>=3.10.3",
1114
"numpy>=2.2.3",
15+
"opencv-python>=4.11.0.86",
1216
"pika>=1.3.2",
1317
"pytest>=8.3.4",
1418
"rabbitmq>=0.2.0",
19+
"redis>=6.2.0",
1520
"sentence-transformers>=4.1.0",
1621
"uvicorn>=0.34.0",
1722
]

shell.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ in pkgs.mkShell {
2727
fi
2828
alias python='python3'
2929
alias dev1='python3 main.py'
30-
alias dev='nodemon --exec python main.py --ext py --watch src/'
30+
alias dev='nodemon'
3131
32-
3332
which python3
3433
3534
'';

0 commit comments

Comments
 (0)