This project is a Next.js application showcasing client-side authentication and user profile management. It includes routes for login, signup, viewing user profiles, and logging out.
- Login: Authenticates users and grants access to the application.
- Signup: Allows users to create a new account.
- Profile: Displays user profile information such as username and email.
- Logout: Logs the user out and clears their session.
- Next.js - React framework for server-side rendering.
- Axios - Promise-based HTTP client for making API requests.
- React Hot Toast - Simple and customizable toasts for notifications.
- Node.js (>= 14.x)
- npm or Yarn
-
Clone the repository:
git clone https://github.com/ShadowSlayer03/https://github.com/ShadowSlayer03/NextJS-Authentication.git
-
Navigate to the Project Directory:
cd NextJS-Authentication -
Install Dependencies
npm install # or yarn install
-
Start the Development Server:
npm run dev # or yarn dev -
Open Your Browser and Visit
http://localhost:3000
- Login: Navigate to /login to authenticate.
- Signup: Go to /signup to create a new account.
- Profile: Access /profile to view user details and log out.
- POST /api/auth/login - Handles user login.
- POST /api/auth/signup - Registers a new user.
- GET /api/users/profile - Retrieves user profile information.
- GET /api/users/logout - Logs out the user.
Feel free to open issues or submit pull requests. Contributions are welcome!