Skip to content

Repository files navigation

Next.js Authentication and Profile Management

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.

Features

  • 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.

Technologies Used

  • 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.

Getting Started

Prerequisites

  • Node.js (>= 14.x)
  • npm or Yarn

Installation

  1. Clone the repository:

    git clone https://github.com/ShadowSlayer03/https://github.com/ShadowSlayer03/NextJS-Authentication.git
    
  2. Navigate to the Project Directory:

    cd NextJS-Authentication
    
  3. Install Dependencies

    npm install
    # or
    yarn install
    
    

Running the Application

  1. Start the Development Server:

    npm run dev
    # or
    yarn dev
    
  2. Open Your Browser and Visit

    http://localhost:3000
    
    

Usage

  • 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.

API Endpoints

  • 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.

Contributing

Feel free to open issues or submit pull requests. Contributions are welcome!

About

A Next.js application demonstrating client-side authentication and user profile management.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages