Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,43 @@
|
|
| 1 |
-
|
| 2 |
-
from
|
| 3 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
if __name__ == "__main__":
|
| 16 |
-
|
|
|
|
| 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()
|