Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c43eef6
yes
Xitlaly-P May 11, 2025
1d9b712
pictures get downloaded to the bucket hooray also vinita get comments…
clanjwal May 12, 2025
9207791
pictures should post with front end changes hopefully
clanjwal May 12, 2025
c727438
image_key added
clanjwal May 12, 2025
c211d1d
oops made changes to this file too
clanjwal May 12, 2025
2719dc0
pictures for doc
clanjwal May 12, 2025
f294908
added swagger to chat routes
clanjwal May 12, 2025
461a550
updated swagger and updated try/except blocks
clanjwal May 12, 2025
4d73aad
fixed doctor unit tests
clanjwal May 12, 2025
2f5b823
"fix yaml"
clanjwal May 12, 2025
c0b6b6c
edit swagger for doctor and patient routes
clanjwal May 12, 2025
95c8bd0
swagger changes to community, doctor, patient, and testing files
clanjwal May 13, 2025
faa8f97
adding/changing endpoints that would change if meal plan was assigned…
clanjwal May 13, 2025
139e94e
lots of changes, mainly to add meal plans during appointments.
clanjwal May 13, 2025
25f563f
Merge pull request #56 from mike8385/assigning-meal-plans
clanjwal May 13, 2025
3fbf5a4
clear meals added
clanjwal May 13, 2025
6103075
Made a delete mealplan button
mike8385 May 13, 2025
cbc705b
Merge branch 'main' of https://github.com/mike8385/490Group_BackEnd
clanjwal May 13, 2025
a931f8d
credit card payment to credit fix
clanjwal May 13, 2025
391905e
get doctor meal plans added
clanjwal May 13, 2025
4ff6c05
undid neg credit
clanjwal May 13, 2025
675b0e1
commented out max balance
clanjwal May 13, 2025
b65d560
updated get_doctor_meal_plans
clanjwal May 13, 2025
7f57fe7
Merge branch 'deploy' into main
Xitlaly-P May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .coverage
Binary file not shown.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_DB: ${{ secrets.MYSQL_DB }}
RABBITMQ_URL: ${{ secrets.RABBITMQ_URL }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}

steps:
- name: Check out code
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Then, install the needed libraries through the requirements.txt file:
pip install -r requirements.txt

Run the File:
python server.py
edit
python server.py
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
swagger = Swagger(app)
socketio = SocketIO(app, cors_allowed_origins="*")

# loading google_application credentials from env variable
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")

# MySQL config
app.config['MYSQL_HOST'] = config.MYSQL_HOST
app.config['MYSQL_USER'] = config.MYSQL_USER
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
MYSQL_HOST = os.environ.get('MYSQL_HOST')
MYSQL_USER = os.environ.get('MYSQL_USER')
MYSQL_PASSWORD = os.environ.get('MYSQL_PASSWORD')
MYSQL_DB = os.environ.get('MYSQL_DB')
MYSQL_DB = os.environ.get('MYSQL_DB')
13 changes: 13 additions & 0 deletions image_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "meta-territory-459219-r0",
"private_key_id": "d4b6009a2cf211d1ce5e9286103e87671443f165",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDqW8GqKdZMLO6M\nXR5sYo/v7FTGGWbrXDBO0YsSixKiCyDMlP3wYFL0N6iZMNZaoDY5KRLYNLidipf7\n7fFRcOSiKFEy1iH4IpunFc2MuSIJdpxO3k77R1aVX6yomdfBxsDvFuKnUHqwodC6\nzP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ZUhVRjSsAi9EEYzJpDPiaXAhk5q+aXsy5AoGBAI7f\nFl1ubnp3CezgVepdW/sNow7H2iJIwwQ4GNV6TjZKXTIk6ZeAfDVN1G5e3ikYUaUZ\nAhVc4mrsaBiLeEay77wwSMnIcON6fuDn0ySfVvalUSIrf30kdg5MCyv0p5UN/SbN\n5Jep/wCdqhTJSl1M/Om5goelj4Q7T978eog3SND1AoGAPxhsHlEZZVk1yLYT/6BU\nBhRgQ5UAqvVESPo/3y/wlKHbEBsUo3KpmDT1Psf075s+Go8cAndkDhzMXn+5wzSP\n1jqeMS/yAFKxBK59VBD8TznM7aelS19b+9dNSz7pz8ey87O0GPFBogfx17BoW6hK\n8zM/zIAMA95a+KN5BnrS/5E=\n-----END PRIVATE KEY-----\n",
"client_email": "cassie-490@meta-territory-459219-r0.iam.gserviceaccount.com",
"client_id": "105188056042474012280",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/cassie-490%40meta-territory-459219-r0.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
Binary file modified requirements.txt
Binary file not shown.
98 changes: 98 additions & 0 deletions routes/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,39 @@

@chat_bp.route('/chat/send', methods=['POST'])
def send_chat_message():
"""
Send a chat message between patient and doctor
---
tags:
- Chat
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- appointment_id
- sender
- text
properties:
appointment_id:
type: integer
sender:
type: string
enum: [patient, doctor]
text:
type: string
responses:
200:
description: Message saved successfully
400:
description: Invalid input
404:
description: Appointment or user not found
500:
description: Internal server error
"""
data = request.get_json()
appointment_id = data.get('appointment_id') # maps to appt_id
sender_type = data.get('sender') # "patient" or "doctor"
Expand Down Expand Up @@ -62,6 +95,41 @@ def send_chat_message():

@chat_bp.route('/chat/<int:appointment_id>', methods=['GET'])
def get_chat_messages(appointment_id):
"""
Retrieve chat messages for a specific appointment
---
tags:
- Chat
parameters:
- name: appointment_id
in: path
required: true
schema:
type: integer
responses:
200:
description: List of chat messages
content:
application/json:
schema:
type: array
items:
type: object
properties:
sender_id:
type: integer
receiver_id:
type: integer
message:
type: string
sent_at:
type: string
format: date-time
404:
description: No messages found
500:
description: Internal server error
"""
cursor = mysql.connection.cursor()
try:
cursor.execute("""
Expand All @@ -86,6 +154,36 @@ def get_chat_messages(appointment_id):

@chat_bp.route('/user', methods=['GET'])
def get_user_by_role_id():
"""
Get user info by patient_id or doctor_id
---
tags:
- Chat
parameters:
- name: patient_id
in: query
required: false
schema:
type: string
- name: doctor_id
in: query
required: false
schema:
type: string
responses:
200:
description: User object
content:
application/json:
schema:
type: object
400:
description: Missing required parameter
404:
description: User not found
500:
description: Internal server error
"""
patient_id = request.args.get('patient_id')
doctor_id = request.args.get('doctor_id')

Expand Down
Loading
Loading