Skip to content

Commit 283ef1e

Browse files
feat(app): create new modular entry point
Add app.py as the new application entry point: - Create main() function to initialize the application - Import modules from the new package structure - Handle multiprocessing with __mp_main__ check 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2b25fa8 commit 283ef1e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

app.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Main entry point for the application
2+
import logging
3+
from nicegui import ui, app
4+
from fastapi.staticfiles import StaticFiles
5+
6+
# Import our modules
7+
from src.config.constants import HEADER_TEXT
8+
from src.ui.pages import setup_pages, home_page, stream_page
9+
from src.core.phrases import initialize_phrases
10+
from src.core.board import generate_board, board_iteration
11+
12+
# Set up logging
13+
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
14+
15+
def main():
16+
# Initialize core components
17+
initialize_phrases()
18+
19+
# Generate initial board
20+
generate_board(board_iteration)
21+
22+
# Set up routes and pages
23+
setup_pages()
24+
25+
# Mount static files
26+
app.mount("/static", StaticFiles(directory="static"), name="static")
27+
28+
# Run the app
29+
ui.run(port=8080, title=f"{HEADER_TEXT}", dark=False)
30+
31+
if __name__ in {"__main__", "__mp_main__"}:
32+
main()

0 commit comments

Comments
 (0)