Skip to content

Manchester | 26-Jun-SDC | Fithi Teklom | Sprint 2 | Chat App - #125

Open
Fithi-Teklom wants to merge 7 commits into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/chat-app
Open

Fithi-Teklom wants to merge 7 commits into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/chat-app

Conversation

@Fithi-Teklom

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1162

Chat App

Features implemented

  • Send and receive chat messages
  • Messages appear without refreshing the page
  • Long-polling for new messages
  • Username for each message
  • Message colour selection
  • Frontend and backend validation
  • Backend deployed using Docker

Deployed application

Frontend:
https://fithi-chat-app-frontend.trainees.hosting.cyf.academy/

Backend:
https://fithi-chat-app-backend.trainees.hosting.cyf.academy/

@Fithi-Teklom Fithi-Teklom added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 1, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Oct 7, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on this task, your deployed app works pretty well.

I've got some comments for the submitted code for you to look at.

</head>

<body>
<h1>Chat App</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you run the lighthouse tool to check your HTML? Does it offer any suggestions for accessibility fixes?

Comment thread chat-app/.gitignore
@@ -0,0 +1 @@
node_modules

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .gitignore has the same content as the top level .gitignore, do you need both of them?

messageElement.textContent = `${message.username}: ${message.text}`;
messageElement.style.color = message.color;

// const likeButton = document.createElement("button");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to avoid commented out code like this in PRs. Is there a reason you left the old code here?

id: messages.length,
username: username.trim(),
text: text.trim(),
color: color,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to be careful of here is you are accepting potentially arbitrary content. In your HTML, there are only a few specific colours you offer, but it's possible to "hack" the page to send any colour. If you intended there to be only a set selection of colours, you probably want to validate it at the backend. What do you think?

messages.push(message);

while (callbacksForNewMessages.length > 0) {
const callback = callbacksForNewMessages.pop();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think are the advantages / disadvantages of the approach you've taken here for updating clients?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants