BARCELONA | Oct2025-1 | June Monton| Decomposition | Sprint 2 | Chat App - #112
Closed
juneMonton wants to merge 9 commits into
Closed
BARCELONA | Oct2025-1 | June Monton| Decomposition | Sprint 2 | Chat App#112juneMonton wants to merge 9 commits into
juneMonton wants to merge 9 commits into
Conversation
Express + Socket.IO backend with an in-memory message history, and a vanilla JS frontend. Supports the three required behaviours plus an online-user count and join announcements. Notable choices: - Message history and individual messages are both capped so a small free-tier host cannot be pushed out of memory. - The client re-sends its username on every connect, not just the first, because hosts drop idle sockets and the server keys users by socket id. - The chat box is cleared before replaying history, so a reconnect does not render the backlog twice.
Netlify serves the static frontend; the Socket.IO backend needs a long-lived process with WebSocket support, which Netlify does not provide, so it goes to Render instead.
Render assigns the backend URL when the service is created, so it cannot be committed ahead of the first deploy. A Netlify build step now writes front-end/config.js from the BACKEND_URL environment variable, which keeps the deployed URL in Netlify's UI and out of source. The script strips a trailing slash and fails the build on a value with no scheme, so a typo surfaces as a red build rather than a site that loads but never connects. With no variable set it emits an empty value, which is exactly what local development needs, and reproduces the committed config.js byte for byte.
The URL moved to a build-time environment variable, so the old message sent anyone debugging a dead chat to the wrong place.
A build that cannot see the BACKEND_URL variable was blanking the address, which is indistinguishable from a build that never ran. The committed value now stands unless the variable overrides it.
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Wrong number of parts separated by |s If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Built and deployed a real-time chat application using Express and Socket.IO. Users can send messages, view chat history, and receive new messages instantly without refreshing the page. The frontend and backend are deployed separately and communicate over a WebSocket connection.
Changelist
Deployed Links
Deployed FrontEnd - https://june-chat-app.netlify.app
Deployed BackEnd - https://world-chat-backend-zlha.onrender.com
Notes