Skip to content

Conversation

solen80a
Copy link

@solen80a solen80a commented Jun 15, 2025

solen80a added 30 commits May 28, 2025 12:39
…ke as required and minlength of 5 caracters.
Copy link

@ssofiejohansson ssofiejohansson left a comment

Choose a reason for hiding this comment

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

💛 Love the use of the in app pop up notifications!
🙂 The smileyface button to login is is cute but not super clear what it does, maybe add a Login-text too?
🌟 After creating a user, Im navigated to the homepage again, maybe this should be to login page instead so the user dont have to go back.
❌ Add a log out button for better user experience.
🌸 Would be nice to also see what user is currently logged in!
🔙 Add a back button at Login page to Home (pressed it by mistake and couldnt find my way back)
📝 When writing wrong password I still navigate to post a thought, but then get an error trying to post. Easy fix: add error msg when wrong password is submitted ✨
🔥 Show min/max password length for user

Well done Sofia, you've done a great job. Just a few things I would recommend to change/add to make the experience better for the user 🐝

Choose a reason for hiding this comment

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

maybe add user input validation so you dont risk empty fields in your database.

if (!email || !password) {
return res.status(400).json({ success: false, message: "Email and password are required." });
}

})

app.get("/users", async (req, res) => {
const { email } = req.params

Choose a reason for hiding this comment

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

Use req.query or change to /users/:email

Choose a reason for hiding this comment

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

Superclear structure on the models and its easy to follow your code

Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

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

Great job with this project! And nice implementation of the frontend too.

I'm missing some proper error message when trying to login with non-existing user. It just closes the popup and that's it. As a user I would like to see some message.

Same goes when trying to register as a user. I can't register and I don't get any message about what went wrong.

Take a look at this and ping me when you have worked it out.

Comment on lines +17 to +21
user: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
required: true
}

Choose a reason for hiding this comment

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

@@ -0,0 +1,67 @@
W1:

Choose a reason for hiding this comment

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

Clear todo list! Love it.

server.js Outdated
Comment on lines 31 to 41
//RESET_DB=true npm run dev. DElete when not needed anymore.
// if(process.env.RESET_DB){
// const seedDatabase = async () => {
// await Thought.deleteMany({})
// data.forEach(thought => {
// new Thought(thought).save()
// })
// }
// seedDatabase()
// }

Choose a reason for hiding this comment

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

IF you dont need this, maybe delete it? Since you have the if statement it is okay to have it "active" if you want to be able to use it with that env variable.

Comment on lines +54 to +56
//Endpoint to show all thoughts
//Filter liked thoughts, thoughts?liked,
//Filter thoughts from today thoughts?thoughtsfromtoday

Choose a reason for hiding this comment

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

good comments with explanation

server.js Outdated
const { newThoughtMessage } = req.body

try{
//const thought = await Thought.findByIdAndUpdate(id, { message: newThoughtMessage }, { new: true , runValidators: true })

Choose a reason for hiding this comment

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

REmove ?

@solen80a
Copy link
Author

solen80a commented Sep 4, 2025

Hi, ready for a new review!
I think I have everything working now with the sign in and sing up. Also added more clear messages to the user and added a logout button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants