This repository contains a full-stack implementation of user authentication features, including user registration (signup) and login. The frontend is built with React, and the backend API is developed using Spring Boot.
This repository contains a full-stack web application demonstrating user authentication (login and signup) using a React frontend and a Spring Boot backend.
This project showcases a basic implementation of user authentication features, allowing users to:
- Sign Up (Register): Create new accounts by providing a username, password, email, and phone number.
- Log In: Authenticate existing users using their username and password.
The frontend is built with React, providing the user interface and handling user interactions. The backend API, developed using Spring Boot, handles user data management, authentication logic, and responds to requests from the frontend.
Frontend:
- React
- MUI
Backend:
- Spring Boot
- Java
- Spring Data JPA (for database interaction)
- PostgreSQL (as the database)
- Spring Web
To run this project locally, you'll need to have Node.js and Java (JDK) installed on your system.
Backend Setup (Spring Boot):
- Navigate to the
backenddirectory:cd backend - Ensure you have Maven or Gradle installed.
- Run the Spring Boot application:
The backend server will typically start on
# Using Maven ./mvnw spring-boot:run # Using Gradle ./gradlew bootRun
http://localhost:8080.
Frontend Setup (React):
- Navigate to the
frontenddirectory:cd frontend - Install the dependencies:
npm install # or yarn install - Start the React development server:
The frontend application will typically open in your browser at
npm start # or yarn starthttp://localhost:3000.
Backend (Spring Boot):
POST /api/users/login: Authenticates a user and returns user details upon successful login.POST /api/users/signup: Registers a new user.
Frontend (React):
/signup: Route for the user registration page./login: Route for the user login page.
- Implement secure password hashing on the backend (using BCrypt).
- Add input validation on both the frontend and backend.
- Implement user session management and authentication tokens (e.g., JWT).
- Add error handling and informative error messages for the user.
- Implement user profile management.