Project-Stage-Academy / UA_1155_alpha

UA-1155.Python Project Stage alpha group
3 stars 0 forks source link

Implementing investor startup direct contact functionality #19 #110

Closed NovitskaMariia closed 1 month ago

NovitskaMariia commented 1 month ago

to test this PR: 1) pip install -r requirements.txt 2) python manage.py makemigrations 3) python manage.py migrate 4) python manage.py runserver

You need 2 users in your DB. Go to Postman and Log In by first user, copy your "access" token and go to api/livechat/ endpoint. Paste your token to authorization. Use POST method, add body with second user id like that {"receiver_id": 4}, and send request. You will see response like that:

image

Open "chat_url" in your browser. You will see livechat UI :) Repeat those steps with second user, and open second url in another tab in your browser. Now you can send and receive messages between two users.

Desired behavior of livechat: 1) Messages sended by you must be green, received messages must be blue. All messages must have sender name, date and time like that: "John Doe 05/18/2024, 18:09:25" 2) All messages must be saved in mongo DB 3) You should see online/offline statuses near chach members names. (To check this close one tab with livechat. After that, this user must be offline in another tab.) 4) If your tab with livechat is inactive now, you should see how many unread messages you have.

If you have questions, feel free to ask Mariia, Alexander or Olesia.

Thoughtseize1 commented 1 month ago

image All works correctly