Skip to content

Commit 9033ab5

Browse files
committed
Update on Building Mental Health, Companion Hub and Docker File Compose for ACR!
1 parent 635bf82 commit 9033ab5

File tree

9 files changed

+310
-9
lines changed

9 files changed

+310
-9
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
".vscode{,/**}"
3232
],
3333
"appService.defaultWebAppToDeploy": "/subscriptions/b7cc4711-4d61-4b3d-b26c-c222c1b5e233/resourceGroups/StudiwellProj/providers/Microsoft.Web/sites/StudiwellAI",
34-
"appService.deploySubpath": "."
34+
"appService.deploySubpath": "deployment.zip"
3535
}

backend/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

2-
FROM python:3.11-slim
2+
FROM python:3.13-slim
33

44
WORKDIR /app
55

6+
RUN apt-get update && apt-get install -y curl
7+
68
COPY requirements.txt .
79
RUN pip install --no-cache-dir -r requirements.txt
810

9-
COPY . .
11+
COPY . /app/
1012

1113
EXPOSE 8000
1214

backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ requests==2.32.3
5858
requests-oauthlib==2.0.0
5959
six==1.17.0
6060
sniffio==1.3.1
61-
starlette==0.41.3
61+
starlette==0.41.34
6262
tqdm==4.67.1
6363
typing_extensions==4.12.2
6464
urllib3==2.2.3

build/styles/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,9 @@ select {
793793
.border {
794794
border-width: 1px;
795795
}
796+
.border-b {
797+
border-bottom-width: 1px;
798+
}
796799
.border-gray-300 {
797800
--tw-border-opacity: 1;
798801
border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
@@ -865,6 +868,9 @@ select {
865868
padding-top: 2rem;
866869
padding-bottom: 2rem;
867870
}
871+
.pb-2 {
872+
padding-bottom: 0.5rem;
873+
}
868874
.text-center {
869875
text-align: center;
870876
}

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.8'
22

33
services:
44
backend:
5-
image: chatbot-api:latest
5+
image: studiwellchatcontainery.azurecr.io/chatbot-api:latest
66
build:
77
context: ./backend
88
dockerfile: Dockerfile
@@ -17,7 +17,7 @@ services:
1717
volumes:
1818
- ./backend:/app
1919
healthcheck:
20-
test: ["CMD-SHELL", "wget -q --spider http://localhost:8000/health || exit 1"]
20+
test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
2121
interval: 30s
2222
timeout: 10s
2323
retries: 3

public/companion-hub.html

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,97 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Companion Hub - Email Communication</title>
77
<link rel="stylesheet" href="styles/styles.css">
8+
<style>
9+
body {
10+
font-family: Arial, sans-serif;
11+
margin: 0;
12+
padding: 0;
13+
background-color: #f9f9f9;
14+
}
15+
.container {
16+
max-width: 1200px;
17+
margin: 0 auto;
18+
padding: 20px;
19+
}
20+
.text-center {
21+
text-align: center;
22+
}
23+
.text-gray-500 {
24+
color: gray;
25+
}
26+
.text-gray-900 {
27+
color: #1a202c;
28+
}
29+
.font-bold {
30+
font-weight: bold;
31+
}
32+
.font-semibold {
33+
font-weight: 600;
34+
}
35+
.mb-8 {
36+
margin-bottom: 2rem;
37+
}
38+
.grid {
39+
display: grid;
40+
gap: 2rem;
41+
grid-template-columns: 1fr;
42+
}
43+
@media (min-width: 768px) {
44+
.grid {
45+
grid-template-columns: repeat(2, 1fr);
46+
}
47+
}
48+
.card {
49+
background: white;
50+
border-radius: 8px;
51+
padding: 20px;
52+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
53+
}
54+
.card-header {
55+
margin-bottom: 1rem;
56+
}
57+
.space-y-4 > * + * {
58+
margin-top: 1rem;
59+
}
60+
.border-b {
61+
border-bottom: 1px solid #e2e8f0;
62+
}
63+
.pb-2 {
64+
padding-bottom: 0.5rem;
65+
}
66+
.btn {
67+
display: inline-block;
68+
padding: 0.5rem 1rem;
69+
font-size: 1rem;
70+
border: 1px solid #e2e8f0;
71+
border-radius: 4px;
72+
background: #edf2f7;
73+
cursor: pointer;
74+
width: 100%;
75+
box-sizing: border-box;
76+
text-align: center;
77+
text-decoration: none;
78+
color: #1a202c;
79+
}
80+
.btn:disabled {
81+
background: #e2e8f0;
82+
cursor: not-allowed;
83+
}
84+
.compose-container {
85+
display: flex;
86+
flex-direction: column;
87+
gap: 1rem;
88+
}
89+
.compose-container > * {
90+
flex: 1;
91+
}
92+
#email-subject, #email-body {
93+
text-align: left;
94+
}
95+
#email-body {
96+
height: 150px;
97+
}
98+
</style>
899
</head>
9100
<body class="bg-custom-green">
10101
<header class="bg-white shadow-md">
@@ -41,15 +132,15 @@ <h2 class="text-xl font-bold mb-4">Account</h2>
41132
<div class="container">
42133
<h1 class="text-3xl font-bold text-gray-900 mb-8 text-center">Companion Hub - Email Communication</h1>
43134
<div class="mb-4">
44-
<a href="/welcome" class="btn">Back to Welcome</a>
135+
<a href="/welcomePage.html" class="btn">Back to Welcome</a>
45136
</div>
46137
<div class="grid">
47138
<!-- Compose Email Card -->
48139
<div class="card">
49140
<div class="card-header">
50141
<h2 class="font-semibold">Compose Email</h2>
51142
</div>
52-
<div class="space-y-4">
143+
<div class="compose-container">
53144
<select id="counselor-select" class="btn">
54145
<option value="" disabled selected>Select a counselor</option>
55146
<option value="1">Taylor S. - Academic Counseling</option>
@@ -61,7 +152,7 @@ <h2 class="font-semibold">Compose Email</h2>
61152
<p id="counselor-email"></p>
62153
</div>
63154
<input id="email-subject" type="text" placeholder="Subject" class="btn">
64-
<textarea id="email-body" placeholder="Your message" rows="6" class="btn"></textarea>
155+
<textarea id="email-body" placeholder="Your message" class="btn"></textarea>
65156
<button id="send-email" class="btn" disabled>Send Email</button>
66157
</div>
67158
</div>

public/mental-health.html

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Mental Health Tracker</title>
7+
<link rel="stylesheet" href="styles/styles.css">
8+
<script type="module" src="scripts/mental-health.js"></script>
9+
<style>
10+
/* Basic styling for layout and components */
11+
body {
12+
font-family: Arial, sans-serif;
13+
margin: 0;
14+
padding: 0;
15+
background-color: #f4f4f4;
16+
color: #333;
17+
}
18+
.container {
19+
max-width: 800px;
20+
margin: 2rem auto;
21+
padding: 1rem;
22+
background: #fff;
23+
border-radius: 8px;
24+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
25+
}
26+
h1 {
27+
text-align: center;
28+
color: #2c3e50;
29+
}
30+
.card {
31+
margin: 1rem 0;
32+
padding: 1rem;
33+
border: 1px solid #fff9f9;
34+
border-radius: 8px;
35+
}
36+
.button {
37+
background-color: #3498db;
38+
color: white;
39+
padding: 10px 20px;
40+
border: none;
41+
border-radius: 4px;
42+
cursor: pointer;
43+
text-align: center;
44+
text-decoration: none;
45+
display: inline-block;
46+
}
47+
.button:hover {
48+
background-color: #2980b9;
49+
}
50+
.slider-container {
51+
margin: 1rem 0;
52+
}
53+
.tip {
54+
margin: 1rem 0;
55+
font-weight: bold;
56+
text-align: center;
57+
}
58+
</style>
59+
<body class="bg-custom-green">
60+
<header class="bg-white shadow-md">
61+
<div class="container mx-auto px-4 py-2 flex justify-between items-center">
62+
<div class="flex items-center">
63+
<img src="images/Untitled 1.png" alt="StudiWell Logo" class="w-24 h-20">
64+
<h1 class="text-2xl font-bold text-gray-800 ml-4">StudiWell</h1>
65+
</div>
66+
<div class="flex items-center space-x-6">
67+
<nav>
68+
<ul class="flex space-x-4">
69+
<li><a href="index.html" class="text-gray-700 hover:text-gray-900">Home</a></li>
70+
<li><a href="aboutme.html" class="text-gray-700 hover:text-gray-900">About</a></li>
71+
<li><a href="students.html" class="text-gray-700 hover:text-gray-900">Student</a></li>
72+
<li><a href="features.html" class="text-gray-700 hover:text-gray-900">Feature</a></li>
73+
</ul>
74+
</nav>
75+
<div class="account-menu relative">
76+
<button id="accountBtn" class="account-button bg-blue-500 text-white px-4 py-2 rounded">My Account</button>
77+
<div id="accountSlideout" class="account-slideout fixed right-0 top-0 h-full w-64 bg-white shadow-lg transform translate-x-full transition-transform duration-300 ease-in-out">
78+
<div class="p-4">
79+
<h2 class="text-xl font-bold mb-4">Account</h2>
80+
<a href="login.html" id="signInBtn" class="block w-full text-center bg-blue-500 text-white px-4 py-2 rounded mb-2">Sign In</a>
81+
<a href="#" id="signOutBtn" class="block w-full text-center bg-red-500 text-white px-4 py-2 rounded mb-2 hidden">Sign Out</a>
82+
<button id="closeSlideout" class="mt-4 text-gray-600 hover:text-gray-800">Close</button>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
</div>
88+
</header>
89+
90+
<!-- Back Button -->
91+
<a href="/welcomePage.html" class="button">Back to Welcome</a>
92+
93+
<!-- Mood Tracker -->
94+
<div class="card">
95+
<h2>Daily Mood Check</h2>
96+
<div id="mood-options">
97+
<!-- Radio buttons will be added dynamically -->
98+
</div>
99+
</div>
100+
101+
<!-- Stress Level -->
102+
<div class="card">
103+
<h2>Stress Level</h2>
104+
<div class="slider-container">
105+
<input type="range" id="stress-slider" min="0" max="10" step="1" value="5">
106+
<p>Your stress level: <span id="stress-value">5</span> / 10</p>
107+
</div>
108+
</div>
109+
110+
<!-- Wellness Tip -->
111+
<div class="card">
112+
<h2>Wellness Tip</h2>
113+
<p id="wellness-tip">Click the button below to get a wellness tip!</p>
114+
</div>
115+
116+
<!-- Save Entry -->
117+
<div style="text-align: center;">
118+
<button class="button" id="save-entry">Save Today's Entry</button>
119+
</div>
120+
</div>
121+
122+
123+
</body>
124+
</html>

public/scripts/mental-health.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
document.addEventListener("DOMContentLoaded", () => {
2+
const moodOptions = ['very sad', 'sad', 'neutral', 'happy', 'very happy'];
3+
const wellnessTips = [
4+
"Take a few deep breaths to center yourself.",
5+
"Try to get at least 7-8 hours of sleep tonight.",
6+
"Take a short walk to clear your mind.",
7+
"Reach out to a friend or family member for support.",
8+
"Practice gratitude by listing three things you're thankful for."
9+
];
10+
11+
// References to DOM elements
12+
const moodOptionsContainer = document.getElementById("mood-options");
13+
const stressSlider = document.getElementById("stress-slider");
14+
const stressValueDisplay = document.getElementById("stress-value");
15+
const wellnessTipDisplay = document.getElementById("wellness-tip");
16+
const saveEntryButton = document.getElementById("save-entry");
17+
18+
// Initialize default state
19+
let selectedMood = 'neutral';
20+
let stressLevel = 5;
21+
22+
// Populate mood options
23+
moodOptions.forEach(option => {
24+
const wrapper = document.createElement("div");
25+
wrapper.style.marginBottom = "10px";
26+
27+
const radioButton = document.createElement("input");
28+
radioButton.type = "radio";
29+
radioButton.id = option;
30+
radioButton.name = "mood";
31+
radioButton.value = option;
32+
if (option === selectedMood) radioButton.checked = true;
33+
radioButton.addEventListener("change", () => {
34+
selectedMood = option;
35+
console.log(`Mood selected: ${selectedMood}`);
36+
});
37+
38+
const label = document.createElement("label");
39+
label.htmlFor = option;
40+
label.textContent = option.charAt(0).toUpperCase() + option.slice(1);
41+
42+
wrapper.appendChild(radioButton);
43+
wrapper.appendChild(label);
44+
moodOptionsContainer.appendChild(wrapper);
45+
});
46+
47+
// Handle stress slider change
48+
stressSlider.addEventListener("input", (event) => {
49+
stressLevel = event.target.value;
50+
stressValueDisplay.textContent = stressLevel;
51+
console.log(`Stress level: ${stressLevel}`);
52+
});
53+
54+
// Generate a random wellness tip
55+
const generateWellnessTip = () => {
56+
const randomTip = wellnessTips[Math.floor(Math.random() * wellnessTips.length)];
57+
wellnessTipDisplay.textContent = randomTip;
58+
console.log(`Wellness Tip: ${randomTip}`);
59+
};
60+
61+
// Add event listener to save entry
62+
saveEntryButton.addEventListener("click", () => {
63+
console.log("Saving Entry...");
64+
console.log(`Mood: ${selectedMood}, Stress Level: ${stressLevel}`);
65+
generateWellnessTip();
66+
alert("Your entry has been saved!");
67+
});
68+
69+
// Display an initial wellness tip
70+
generateWellnessTip();
71+
});
72+

0 commit comments

Comments
 (0)