Paul Magee commited on
Commit
c016c98
Β·
1 Parent(s): 912f21d

name changed frontend to Public_Chat so it appears as Public Chat in new sidebar.

Browse files
.streamlit/config.toml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [theme]
2
+ primaryColor = "#4CAF50"
3
+ backgroundColor = "#1E1E1E"
4
+ secondaryBackgroundColor = "#262730"
5
+ textColor = "#FFFFFF"
6
+ font = "sans serif"
7
+
8
+ [server]
9
+ runOnSave = true
10
+
11
+ [browser]
12
+ gatherUsageStats = false
frontend.py β†’ Public_Chat.py RENAMED
@@ -16,8 +16,8 @@ MAX_MESSAGES = 50
16
 
17
  # Set page config
18
  st.set_page_config(
19
- page_title="Document Chatbot",
20
- page_icon="πŸ“š",
21
  layout="centered",
22
  initial_sidebar_state="collapsed"
23
  )
 
16
 
17
  # Set page config
18
  st.set_page_config(
19
+ page_title="Public Chat",
20
+ page_icon="πŸ’¬",
21
  layout="centered",
22
  initial_sidebar_state="collapsed"
23
  )
README.md CHANGED
@@ -31,7 +31,7 @@ This is a multi-page Streamlit application with two main interfaces:
31
 
32
  ### User Interface (Main Page)
33
  ```
34
- streamlit run frontend.py
35
  ```
36
  This is the main chat interface where users can ask questions about the documents.
37
 
@@ -45,6 +45,15 @@ The admin interface allows you to:
45
 
46
  Password for admin interface: `admin` (can be changed in secrets.toml)
47
 
 
 
 
 
 
 
 
 
 
48
  ### Backend CLI (Optional)
49
  ```
50
  python backend.py
@@ -62,7 +71,7 @@ If you experience issues with imports or module reloading:
62
 
63
  2. Use force-reload when starting Streamlit:
64
  ```
65
- streamlit run frontend.py --server.runOnSave=true
66
  ```
67
 
68
  See [DEPLOYMENT.md](DEPLOYMENT.md) for cloud deployment options.
 
31
 
32
  ### User Interface (Main Page)
33
  ```
34
+ streamlit run Public_Chat.py
35
  ```
36
  This is the main chat interface where users can ask questions about the documents.
37
 
 
45
 
46
  Password for admin interface: `admin` (can be changed in secrets.toml)
47
 
48
+ ### Page Naming Convention
49
+
50
+ The application uses Streamlit's multi-page naming convention:
51
+ - The main file (`Public_Chat.py`) appears as "Public Chat" in the sidebar
52
+ - Pages in the `pages` directory follow the pattern `NN_PageName.py` where:
53
+ - `NN` is an optional number for ordering pages
54
+ - `PageName` is automatically converted to "Page Name" in the sidebar
55
+ - Example: `01_Admin.py` displays as "Admin" in the sidebar
56
+
57
  ### Backend CLI (Optional)
58
  ```
59
  python backend.py
 
71
 
72
  2. Use force-reload when starting Streamlit:
73
  ```
74
+ streamlit run Public_Chat.py --server.runOnSave=true
75
  ```
76
 
77
  See [DEPLOYMENT.md](DEPLOYMENT.md) for cloud deployment options.
architecture.md CHANGED
@@ -6,7 +6,7 @@ This document describes the architecture of the Document Chatbot application, it
6
 
7
  The application follows a multi-page Streamlit structure with clear separation of concerns:
8
 
9
- ### Main Application (`frontend.py`)
10
 
11
  - Built with Streamlit
12
  - Serves as the entry point for the entire application
@@ -114,18 +114,19 @@ This provides basic security to prevent unauthorized access to administrative fu
114
 
115
  The application uses Streamlit's multi-page app framework:
116
 
117
- 1. **Main Application (`frontend.py`)**:
118
  - Serves as the entry point and main chat interface
119
- - Appears as the home page in the navigation
120
 
121
  2. **Pages Directory Structure**:
122
  - `pages/01_Admin.py`: Admin interface accessible via sidebar navigation
123
  - File naming with numbers (01_) controls the order in the sidebar
124
 
125
- 3. **Shared Resources**:
126
- - Backend module is imported by both the main app and pages
127
- - Session state is maintained across pages
128
- - Resources like the LLM and index are shared via caching
 
129
 
130
  4. **Benefits**:
131
  - Simpler deployment (only one Streamlit app to run)
@@ -187,7 +188,7 @@ Keeping files within these limits improves:
187
 
188
  ```
189
  llamaindex-app/
190
- β”œβ”€β”€ frontend.py # Main Streamlit interface/entry point
191
  β”œβ”€β”€ pages/ # Streamlit multi-page directory
192
  β”‚ β”œβ”€β”€ 01_Admin.py # Admin interface as a page
193
  β”‚ └── 02_Analytics.py # Future analytics page (if needed)
@@ -226,7 +227,7 @@ llamaindex-app/
226
  ## Architecture Principles
227
 
228
  ### 1. Frontend/Backend Separation
229
- - `frontend.py` provides a web interface using Streamlit
230
  - `backend.py` contains the core chatbot logic and a CLI interface
231
  - Both can be run independently depending on user needs
232
 
 
6
 
7
  The application follows a multi-page Streamlit structure with clear separation of concerns:
8
 
9
+ ### Main Application (`Public_Chat.py`)
10
 
11
  - Built with Streamlit
12
  - Serves as the entry point for the entire application
 
114
 
115
  The application uses Streamlit's multi-page app framework:
116
 
117
+ 1. **Main Application (`Public_Chat.py`)**:
118
  - Serves as the entry point and main chat interface
119
+ - Appears as "Public Chat" in the navigation
120
 
121
  2. **Pages Directory Structure**:
122
  - `pages/01_Admin.py`: Admin interface accessible via sidebar navigation
123
  - File naming with numbers (01_) controls the order in the sidebar
124
 
125
+ 3. **Page Naming Convention**:
126
+ - File naming follows the pattern `[nn_]PageName.py`
127
+ - The main file `Public_Chat.py` displays as "Public Chat"
128
+ - The admin file `01_Admin.py` displays as "Admin"
129
+ - Numbers are used for ordering, and underscores are converted to spaces
130
 
131
  4. **Benefits**:
132
  - Simpler deployment (only one Streamlit app to run)
 
188
 
189
  ```
190
  llamaindex-app/
191
+ β”œβ”€β”€ Public_Chat.py # Main Streamlit interface/entry point
192
  β”œβ”€β”€ pages/ # Streamlit multi-page directory
193
  β”‚ β”œβ”€β”€ 01_Admin.py # Admin interface as a page
194
  β”‚ └── 02_Analytics.py # Future analytics page (if needed)
 
227
  ## Architecture Principles
228
 
229
  ### 1. Frontend/Backend Separation
230
+ - `Public_Chat.py` provides a web interface using Streamlit
231
  - `backend.py` contains the core chatbot logic and a CLI interface
232
  - Both can be run independently depending on user needs
233
 
pages/01_Admin.py CHANGED
@@ -9,12 +9,15 @@ import backend
9
  from utils.logging_config import setup_logging
10
  import config
11
 
 
 
 
12
  # Setup logging
13
  logger = setup_logging()
14
 
15
  # Set page config
16
  st.set_page_config(
17
- page_title="Document Chatbot Admin",
18
  page_icon="πŸ”§",
19
  layout="wide"
20
  )
 
9
  from utils.logging_config import setup_logging
10
  import config
11
 
12
+ # The 01_Admin.py filename pattern automatically makes this page show as "Admin" in the sidebar
13
+ # The main file "Public_Chat.py" will similarly display as "Public Chat" without needing special config
14
+
15
  # Setup logging
16
  logger = setup_logging()
17
 
18
  # Set page config
19
  st.set_page_config(
20
+ page_title="Admin",
21
  page_icon="πŸ”§",
22
  layout="wide"
23
  )