Skip to content

Conversation

hasnaintypes
Copy link

Feature: Login Page and User Persistence

Overview

This branch implements a robust authentication for Code-Sync, enabling users to log in, manage multiple group projects (coding rooms), and enjoy a personalized experience with persistent sessions and chat functionality.

Features Implemented

  • Login Page & Authentication

    • Modern, user-friendly login page.
    • Integrated authentication with backend validation.
    • User session is persisted using localStorage for seamless experience across reloads.
  • MongoDB Integration

    • MongoDB for storing user and project data.
    • Mongoose models for User and ProjectRoom.
    • Connection and error handling in the backend.
  • Controllers & Routes

    • Express controllers and RESTful routes for:
      • User login and registration.
    • Proper validation and error handling for all endpoints.
  • Frontend Integration

    • On login, the user’s session is saved to localStorage and loaded automatically on app start.
    • The project join/create flow uses the MongoDB project ID for navigation and socket room management.
    • The UI allows users to enter a project description and join or create a coding room in one step.
  • Personalized Chatting

    • (Planned/Initial) Foundation for personalized chat between friends within coding rooms.

Technical Highlights

  • Backend: Node.js, Express, Mongoose, MongoDB.
  • Frontend: React, TypeScript, React Context for state management.
  • Persistence: User session stored in localStorage for automatic login.
  • Socket.io: Real-time collaboration and room management.

Screenshot

Login Page

Next Steps

  • Implement direct messaging (personalized chat) between users.
  • Enhance project room UI for easier switching and management.
  • Add more robust error and edge-case handling.

Copy link

vercel bot commented Jun 24, 2025

@hasnaintypes is attempting to deploy a commit to the Sahil Atahar's projects Team on Vercel.

A member of the Team first needs to authorize it.

@hasnaintypes
Copy link
Author

@sahilatahar This PR implements the login page, project room management, and user session persistence as described in issue #32.

Users can now log in, create and join multiple coding rooms (projects), and their session is persisted using localStorage.
The backend is fully integrated with MongoDB, and all relevant controllers and routes are in place.
The UI/UX is modern and user-friendly, and the groundwork for personalized chat is included.
Please review the implementation and let me know if you have any feedback or suggestions!

@sahilatahar
Copy link
Owner

@hasnaintypes Where is registration part? Without registration how login will work?

@hasnaintypes
Copy link
Author

@hasnaintypes Where is registration part? Without registration how login will work?

I initially understood that the issue referenced the login page, so I assumed they were only referring to the sign-in page. I implemented logic where the system first checks the database; if the user is not found, it will insert the user. Otherwise, it will verify the details and start the login session. This approach combines both functionalities into one process. If you'd prefer separate controllers and pages, I can certainly implement that as well.

@sahilatahar
Copy link
Owner

@hasnaintypes it's okay but this not how it things actually works if someone have acount and he tried to login and email is wrong it will create new account. So this is not a proper way, you need to seperate registration and login logic. Use zod for validation.

@sahilatahar
Copy link
Owner

@hasnaintypes Are you still working or not?

@hasnaintypes
Copy link
Author

I am not working now. I have exams so I am busy with them.

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.

2 participants