klydekushy commited on
Commit
74b1d78
·
verified ·
1 Parent(s): 4650fae

Create src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +95 -0
src/app.py ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_gsheets import GSheetsConnection
3
+ import pandas as pd
4
+
5
+ # 1. CONFIGURATION DE LA PAGE
6
+ st.set_page_config(
7
+ page_title="Vortex-Flux | Ontology",
8
+ page_icon="🌀",
9
+ layout="wide",
10
+ initial_sidebar_state="expanded"
11
+ )
12
+
13
+ # 2. INJECTION CSS - DESIGN GOTHAM & SPACE GROTESK
14
+ st.markdown("""
15
+ <style>
16
+ @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;700&display=swap');
17
+
18
+ /* Couleurs de fond Gotham */
19
+ .stApp {
20
+ background-color: #10161A;
21
+ color: #F5F8FA;
22
+ font-family: 'Space Grotesk', sans-serif;
23
+ }
24
+
25
+ /* Barre latérale */
26
+ [data-testid="stSidebar"] {
27
+ background-color: #182026;
28
+ border-right: 1px solid #2B95D6;
29
+ }
30
+
31
+ /* Boutons de type Palantir Cobalt */
32
+ .stButton>button {
33
+ background-color: #2B95D6 !important;
34
+ color: white !important;
35
+ border-radius: 2px !important;
36
+ border: none !important;
37
+ font-weight: 700;
38
+ text-transform: uppercase;
39
+ letter-spacing: 1px;
40
+ }
41
+
42
+ /* Inputs et champs */
43
+ input, textarea, select {
44
+ background-color: #202B33 !important;
45
+ color: #F5F8FA !important;
46
+ border: 1px solid #30404D !important;
47
+ }
48
+
49
+ /* Titres */
50
+ h1, h2, h3 {
51
+ font-family: 'Space Grotesk', sans-serif;
52
+ font-weight: 700;
53
+ color: #2B95D6;
54
+ letter-spacing: -1px;
55
+ }
56
+ </style>
57
+ """, unsafe_allow_html=True)
58
+
59
+ # 3. CONNEXION À L'ONTOLOGIE (GOOGLE SHEETS)
60
+ conn = st.connection("gsheets", type=GSheetsConnection)
61
+
62
+ # 4. FONCTION GÉNÉRATRICE D'ID UNIQUE (ONTOLOGIE)
63
+ def generate_ontology_id(prefix, sheet_name):
64
+ try:
65
+ data = conn.read(worksheet=sheet_name)
66
+ next_id = len(data) + 1
67
+ return f"{prefix}-{2025}-{next_id:04d}"
68
+ except:
69
+ return f"{prefix}-{2025}-0001"
70
+
71
+ # 5. INTERFACE PRINCIPALE
72
+ st.sidebar.title("🌀 VORTEX-FLUX")
73
+ st.sidebar.caption("Jumeau Numérique de Trésorerie")
74
+ st.sidebar.divider()
75
+
76
+ menu = st.sidebar.radio(
77
+ "NAVIGATION",
78
+ ["TABLEAU DE BORD", "KYC CLIENTS", "SIMULATION PRÊTS", "FLUX & ANALYTICS"]
79
+ )
80
+
81
+ # CONTENU TEMPORAIRE POUR TESTER LE DESIGN
82
+ if menu == "TABLEAU DE BORD":
83
+ st.header("OBJECT EXPLORER")
84
+ col1, col2, col3 = st.columns(3)
85
+ col1.metric("CAPITAL DEHORS", "1.2M XOF", "+5%")
86
+ col2.metric("FLUX ATTENDU (J+7)", "450k XOF", "-2%")
87
+ col3.metric("SCORE LIQUIDITÉ", "8.5/10")
88
+
89
+ st.info("Système Vortex-Flux prêt pour l'ontologie.")
90
+
91
+ elif menu == "KYC CLIENTS":
92
+ st.header("ENTITÉ : NOUVEAU CLIENT")
93
+ new_id = generate_ontology_id("CLI", "Clients_KYC")
94
+ st.subheader(f"ID : {new_id}")
95
+ st.write("Demain, nous coderons le formulaire complet ici.")