Repository navigation
Conversation
- Added backend with Express server and message handling routes - Implemented message sending, fetching, and reacting functionalities - Created frontend HTML structure for chat interface - Developed JavaScript for message rendering and user interactions - Styled chat application with CSS for better user experience
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Added package.json for backend with necessary dependencies (express, cors, crypto). - Implemented server.js for handling message retrieval, sending, and reactions with long-polling support. - Created index.html for the frontend chat interface with a message input area and display for chat messages. - Developed script.js to manage message fetching, sending, and user interactions (like, dislike, reply). - Styled the chat application with style.css for a user-friendly interface.
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, but I encountered some issues during testing. I also have some questions about your code.
Part of the task is to deploy the app. Is the chat app deployed anwhere we can test it? It's usually a good idea to include this in the PR text.
| <script src="script.js" defer></script> | ||
| </head> | ||
|
|
||
| <body> |
There was a problem hiding this comment.
Did you try running the lighthouse tool? Does it offer any suggestions for accessibility fixes?
There was a problem hiding this comment.
When trying to self-deploy the frontend, I get a couple of errors. A CORS policy error, and a error with long polling. Do you also see these? Is there something I need to configure?
| const messagesById = new Map(messages.map((msg) => [String(msg.id), msg])); | ||
| const waitingClients = []; | ||
|
|
||
| // Date.now() aynı milisaniyede çakışabilir, timestamp'leri tekilleştiriyoruz |
There was a problem hiding this comment.
As a general suggestion, if you are developing code that will be read by other english speakers it's a good idea to make your comments english as well.
| return lastTimestamp; | ||
| } | ||
|
|
||
| function releaseWaitingClients() { |
There was a problem hiding this comment.
Can you explain what releaseWaitingClients is for?
| return; | ||
| } | ||
|
|
||
| if (!longPoll) { |
There was a problem hiding this comment.
How are you using the longPoll query parameter here? What's the difference of if it is true or false?
| ); | ||
|
|
||
| if (likeButton) { | ||
| likeButton.textContent = `👍 ${message.likes || 0}`; |
There was a problem hiding this comment.
Generating the like text is re-used multiple times in the app, is that a maintainable approach?
Learners, PR Template
Self checklist
Task code
Task ID : CYF-1162
Features:
Send chat messages
View existing message history
Reply message
Like and dislike messages