jdalfonso commited on
Commit
df80fb7
·
1 Parent(s): f0f671a

:rocket: feature: first commit

Browse files
Files changed (8) hide show
  1. .streamlit/config.toml +4 -0
  2. Dockerfile +27 -0
  3. README.md +40 -2
  4. app.py +52 -0
  5. img/logo.png +0 -0
  6. views/analytics.py +12 -0
  7. views/home.py +12 -0
  8. views/ml.py +12 -0
.streamlit/config.toml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [theme]
2
+ base="dark"
3
+ primaryColor="#7c99b4"
4
+
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python image from the Docker Hub
2
+ FROM python:3.11-slim
3
+
4
+ # Create a new user with a specific UID and switch to it
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+
8
+ # Set the PATH environment variable
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
+
11
+ # Set the working directory in the container
12
+ WORKDIR /app
13
+
14
+ # Copy the requirements.txt file into the container with the correct ownership
15
+ COPY --chown=user ./requirements.txt requirements.txt
16
+
17
+ # Install the dependencies
18
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
+
20
+ # Copy the rest of the application code into the container with the correct ownership
21
+ COPY --chown=user . /app
22
+
23
+ # Expose the port that Streamlit will use
24
+ EXPOSE 7860
25
+
26
+ # Command to run the Streamlit app on port 7860
27
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
README.md CHANGED
@@ -1,2 +1,40 @@
1
- # SISE-ultimate-challenge
2
- This is the ultimate challenge for Master SISE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SISE Ultimate Challenge
2
+
3
+ This is the ultimate challenge for Master SISE.
4
+
5
+ ## Overview
6
+
7
+ This project is a Streamlit-based dashboard for analyzing security logs, data trends, and applying machine learning models.
8
+
9
+ ## Features
10
+
11
+ - Home: Overview of the challenge
12
+ - Analytics: View and analyze security logs and data trends
13
+ - Machine Learning: Train and evaluate machine learning models
14
+
15
+ ## Installation
16
+
17
+ To run this project locally, follow these steps:
18
+
19
+ 1. Clone the repository:
20
+ ```sh
21
+ git clone https://github.com/jdalfons/sise-ultimate-challenge.git
22
+ cd sise-ultimate-challenge
23
+ ```
24
+
25
+ 2. Create a virtual environment and activate it:
26
+ ```sh
27
+ python3 -m venv venv
28
+ source venv/bin/activate
29
+ ```
30
+
31
+ 3. Install the required dependencies:
32
+ ```sh
33
+ pip install -r requirements.txt
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ To start the Streamlit app, run the following command:
39
+ ```sh
40
+ streamlit run [app.py](http://_vscodecontentref_/1)
app.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_option_menu import option_menu
3
+ from views.home import home
4
+ from views.analytics import analytics
5
+ from views.ml import ml
6
+
7
+ # Set the logo
8
+ st.sidebar.image("img/logo.png", use_container_width=True)
9
+
10
+ # Create a sidebar with navigation options
11
+ # Sidebar navigation with streamlit-option-menu
12
+ with st.sidebar:
13
+ # st.image("img/logo.png", use_container_width=True)
14
+ # st.markdown("<h1 style='text-align: center;'>SecureIA Dashboard</h1>", unsafe_allow_html=True)
15
+ # Navigation menu with icons
16
+ selected_tab = option_menu(
17
+ menu_title=None, # Added menu_title parameter
18
+ options=["Home", "Analytics", "Machine Learning"],
19
+ icons=["house", "bar-chart", "robot"],
20
+ menu_icon="cast",
21
+ default_index=0,
22
+ # styles={
23
+ # "container": {"padding": "5px", "background-color": "#f0f2f6"},
24
+ # "icon": {"color": "orange", "font-size": "18px"},
25
+ # "nav-link": {"font-size": "16px", "text-align": "left", "margin": "0px", "color": "black"},
26
+ # "nav-link-selected": {"background-color": "#4CAF50", "color": "white"},
27
+ # }
28
+ )
29
+
30
+ if selected_tab == "Home":
31
+ home()
32
+ elif selected_tab == "Analytics":
33
+ analytics()
34
+ elif selected_tab == "Machine Learning":
35
+ ml()
36
+
37
+ # Quick links section after filters and content
38
+ st.markdown("---")
39
+ col1, col2 = st.columns(2)
40
+
41
+ with col1:
42
+ st.markdown("### About")
43
+ st.write("This dashboard is maintained by the M2 SISE team.")
44
+ st.write("For more information, please visit the [GitHub repository](https://github.com/jdalfons/sise-ultimate-challenge/tree/main).")
45
+
46
+ with col2:
47
+ st.markdown("### Collaborators")
48
+ st.write("""
49
+ - [Warrior 1](https://github.com/jdalfons)
50
+ - [Warrior 2](https://github.com/jdalfons)
51
+ - [Juan Alfonso](https://github.com/jdalfons)
52
+ """)
img/logo.png ADDED
views/analytics.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ def analytics():
4
+ st.title("Analytiques")
5
+ st.write("Welcome to the Analytics page!")
6
+ st.markdown("""
7
+ **Overview:**
8
+ - View your security logs
9
+ - Analyze data trends
10
+ - Explore datasets
11
+ - Apply machine learning models
12
+ """)
views/home.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+
4
+ def home():
5
+ st.title("SISE ultimate challenge")
6
+ st.write("C'est le dernier challenge de la formation SISE.")
7
+ st.markdown("""
8
+ **Overview:**
9
+ - Analyse de logs
10
+ - Analyse de données
11
+ - Machine learning
12
+ """)
views/ml.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+
4
+ def ml():
5
+ st.title("Machine Learning")
6
+ st.write("Welcome to the Machine Learning page!")
7
+ st.markdown("""
8
+ **Overview:**
9
+ - Train machine learning models
10
+ - Evaluate model performance
11
+ - Make predictions
12
+ """)