Skip to content

London | 26-SDC-March | Zobeir Rigi | Sprint 2 | Chat app#101

Closed
Zobeir-Rigi wants to merge 30 commits into
CodeYourFuture:mainfrom
Zobeir-Rigi:chat-app
Closed

London | 26-SDC-March | Zobeir Rigi | Sprint 2 | Chat app#101
Zobeir-Rigi wants to merge 30 commits into
CodeYourFuture:mainfrom
Zobeir-Rigi:chat-app

Conversation

@Zobeir-Rigi

@Zobeir-Rigi Zobeir-Rigi commented Jun 24, 2026

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

Built a full-stack chat application using Express and WebSockets, supporting GET and POST APIs for messages, real-time updates, and input validation on both frontend and backend.

I added validation and timestamps as extra features. This is an MVP that meets the requirements for this PR, and I’ll improve it further when I get some time.

server
client

@github-actions

This comment has been minimized.

@Zobeir-Rigi Zobeir-Rigi added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Decomposition The name of the module. labels Jun 24, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@Zobeir-Rigi Zobeir-Rigi changed the title London | 26-SDC-March | Zobeir Rigi | Decomposition | Chat app London | 26-SDC-March | Zobeir Rigi | Sprint 2 | Chat app Jun 24, 2026
@Zobeir-Rigi Zobeir-Rigi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The README has this requirement:

It must also support at least one additional feature.

In the PR description, can you list the extra features you implemented?

Comment thread chat-app/backend/app.js Outdated
Comment on lines +9 to +20
const allMessages = []

const fetchAllMessages = () => {
return allMessages
}

app.get("/messages", (req, res) => {
const messages = fetchAllMessages()
res.json(messages)
})

const clients = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could consider moving these declaration before line 5 to keep all declarations before executable statements.

Comment thread chat-app/backend/app.js Outdated
Comment thread chat-app/backend/app.js Outdated
Comment thread chat-app/frontend/index.js Outdated
Comment thread chat-app/frontend/index.js Outdated
Comment thread chat-app/frontend/index.js
Comment thread chat-app/frontend/index.js Outdated
Comment thread chat-app/frontend/index.js Outdated
Comment thread chat-app/frontend/index.html Outdated
@cjyuan cjyuan 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. labels Jun 28, 2026
@Zobeir-Rigi

Copy link
Copy Markdown
Author

The README has this requirement:

It must also support at least one additional feature.

In the PR description, can you list the extra features you implemented?

Yes, I also added validation and a timestamp.

@cjyuan cjyuan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes look good.

I could not find these features listed in the PR description though.
Image

Comment thread chat-app/frontend/index.js Outdated
}
}

fetchMessages()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it is a better practice to place all the code to be executed when this script is loaded in one place. For example, in a function called init() or at the end of the file (after all declarations and function definitions). It would make locating them easier.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point, I added an init() function to group what runs when the app loads, and I put fetching messages there as part of the startup.

Comment on lines +84 to +89
const data = await res.json();

if (!res.ok) {
showError(data.error);
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the server return a response not generated by your service API, and as such return a response that is not a JSON encoded message? The error may not necessary be a "Network error".

It could be worth researching how to properly handle a response error in such a scenario.

No change needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I really appreciated the guidance – it was clear and helped me improve the code in a clean way.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 29, 2026
@illicitonion

Copy link
Copy Markdown
Member

Closing PR because the SDC run has finished. Feel free to re-open if you're still working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Decomposition The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants