-
Notifications
You must be signed in to change notification settings - Fork 30
API Project - Jonny HIcks #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…oughts endpoints for async handling
… update Thought model definition and seed logic
…ion and fix user reference in post route
@@ -1,22 +1,38 @@ | |||
import cors from "cors" | |||
import express from "express" | |||
import cors from "cors"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jonny!
I've done a code review on your project. I was going to do it on Varia's work, but she hasn't finished yet.
Awesome work putting this API together! I do not have any suggestions for improvements or questions. I think you've done a really great job with the overall structure, and it looks super clean and organized.
Here's what I really liked and what makes this code easy to understand:
One Job, One File: You've got server.js doing the main setup, which is perfect – it just gets everything started.
Then, you have separate folders for models/ (your Mongoose schemas are super clear there!), routes/ (where all the API endpoints live, organized by users and thoughts), and middlewares/ (for reusable stuff like authentication).
It means if I want to check how users are handled, I know exactly where to look. It makes the code way less overwhelming.
Easy to Follow: Because you've split things up so well, tracing how a request comes in (from server.js), goes through a middleware (authenticationUser.js), and then hits a specific route (routes/thoughts.js), is much clearer. This makes debugging (which we're probably doing a lot of right now, haha) a lot easier.
You've really done a great job with the project structure, it's not just functional, but also super readable and ready for future growth!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow!
I'm impressed with your work. Everything is clean and well structured in the backend and you have managed to implement all new features in a really nice way in the frontend too!
I like the extra things that you've put in, such as the cute error messages
Great work with your documentations as well as you commits. It's clear and easy to follow your progress with this project.
Looking forward to see you final project!
🚀
type: String, | ||
required: true, | ||
unique: true, | ||
index: true, // Add index for optimization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
BACKEND - https://js-project-api-k17p.onrender.com
FRONTEND - https://wehappy.netlify.app/
Happy Thoughts API
This is a RESTful API for a "Happy Thoughts" social app, built with Node.js, Express, and MongoDB (Mongoose). The API allows users to register, log in, and share positive thoughts. Authenticated users can create, update, delete, and like thoughts. Passwords are securely hashed with bcrypt. The API includes robust validation and error handling.
Features
Endpoints Overview
Tech Stack