Open
Conversation
|
@udaykiran243 is attempting to deploy a commit to the bdutta18's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
https://drive.google.com/file/d/1Fr_VAneWI3fpzxBvkiDWoV7_8xU4U559/view?usp=sharing |
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.
[FEATURE] Implement Backend with MongoDB and Authentication
closes #148
Description
This PR addresses issue #148 by introducing a dedicated Node.js/Express backend connected to a MongoDB database. It implements secure user authentication (JWT-based) and fully integrates it with the frontend React application, providing a robust foundation for user management and future scalability.
Changes Made
server/index.jswith MongoDB connection via Mongoose..envfile.Usermodel (server/models/User.js) with comprehensive schema validation.bcryptjs./api/auth/register,/api/auth/login,/api/auth/me).server/middleware/authMiddleware.js) to protect routes.AuthContext.jsxto communicate with the new backend API endpoints.Auth.jsx(Sign Up/Login page) with modern UI feedback (success messages, automatic redirection).Profile.jsxto include a functional Logout button that redirects to the home page.ProtectedRouteto prevent unauthorized access.README.mdwith clear instructions on how to set up and run the backend server alongside the frontend.Getting Started (How to Run)
To run this PR locally, please follow these steps:
1. Install Dependencies
Make sure you are in the root directory and install all required packages:
2. Environment Configuration
Create a
.envfile in the root directory and add your MongoDB connection string and a secret key for JWT:3. Run the Application