Files

37 lines
906 B
Python

#!/usr/bin/env python3
"""AI Software Factory - Main application with FastAPI backend and NiceGUI frontend.
This application uses FastAPI to:
1. Provide HTTP API endpoints
2. Host NiceGUI frontend via ui.run_with()
The NiceGUI frontend provides:
1. Interactive dashboard at /show
2. Real-time data visualization
3. Audit trail display
"""
import frontend
from fastapi import FastAPI
from database import init_db
app = FastAPI()
@app.get('/')
def read_root():
"""Root endpoint that returns welcome message."""
return {'Hello': 'World'}
@app.post('/init-db')
def initialize_database():
"""Initialize database tables (POST endpoint for NiceGUI to call before dashboard)."""
init_db()
return {'message': 'Database initialized successfully'}
frontend.init(app)
if __name__ == '__main__':
print('Please start the app with the "uvicorn" command as shown in the start.sh script')