cryogenic22 commited on
Commit
103dfda
·
verified ·
1 Parent(s): 6a4b42c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -13
app.py CHANGED
@@ -1,16 +1,43 @@
1
- from fastapi import FastAPI
2
- from fastapi.staticfiles import StaticFiles
3
- import uvicorn
 
 
 
 
4
 
5
- app = FastAPI()
6
-
7
- # Add your API routes here
8
- @app.get("/api/health")
9
- def health_check():
10
- return {"status": "ok"}
11
-
12
- # Mount frontend files - we'll set this up after building
13
- app.mount("/", StaticFiles(directory="frontend/build", html=True), name="static")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  if __name__ == "__main__":
16
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
1
+ import streamlit as st
2
+ from src.components.ai_tutor import AITutor
3
+ from src.components.code_playground import CodePlayground
4
+ from src.components.learning_paths import LearningPaths
5
+ from src.components.sidebar import Sidebar
6
+ from src.utils.session import initialize_session_state
7
+ from src.utils.ui import set_page_config, apply_custom_css
8
 
9
+ def main():
10
+ # Initialize app
11
+ set_page_config()
12
+ apply_custom_css()
13
+ initialize_session_state()
14
+
15
+ # Initialize components
16
+ ai_tutor = AITutor()
17
+
18
+ # Display sidebar
19
+ Sidebar.display()
20
+
21
+ # Title
22
+ st.title("🎓 EduAI Platform")
23
+
24
+ # Welcome message for new users
25
+ if 'username' not in st.session_state:
26
+ st.info("👋 Welcome to EduAI Platform! Please enter your nickname to start learning.")
27
+ return
28
+
29
+ # Main content tabs
30
+ tab1, tab2, tab3 = st.tabs(["📚 Learning Paths", "🤖 AI Tutor", "💻 Code Playground"])
31
+
32
+ with tab1:
33
+ LearningPaths.display()
34
+
35
+ with tab2:
36
+ ai_tutor.display_chat_interface()
37
+ ai_tutor.display_learning_metrics()
38
+
39
+ with tab3:
40
+ CodePlayground.display()
41
 
42
  if __name__ == "__main__":
43
+ main()