Skip to content

wlb-tycoon/AuthCRUD_client

Repository files navigation

AuthCRUD_client

AuthCRUD_client is a web application built with Next.js, Ant Design, Fastify that provides user registration and login functionality. It allows users to create an account, log in, and access a protected dashboard.

Features

  • User registration with name, email, and password
  • User login with email and password
  • Protected dashboard accessible only to authenticated users
  • Error handling for invalid form inputs and authentication failures
  • JWT-based authentication with session management
  • API Management with Server Response and status codes.
  • API to handle signin, signup, edit, delete requests on the server with protected page check.

Technologies Used

  • Next.js: A React framework for building static websites
  • Ant Design: A template for building awesome UI
  • Fastify: A Backend framework for building fast rendering
  • Node.js: A JavaScript runtime for server-side development
  • MySQL: A relational database management system for storing user information
  • bcrypt: A library for hashing and comparing passwords securely
  • jsonwebtoken: A library for generating and verifying JSON Web Tokens (JWTs)

Getting Started

Prerequisites

  • Node.js and npm installed on your machine
  • MySQL database set up and running

Installation

  1. Clone the repository:

    git clone https://github.com/wlb-tycoon/AuthCRUD_client.git
  2. Install dependencies:

cd AuthCRUD_client
npm install
  1. Set up environment variables:
  • Create a .env file in the project root directory.
  • Add the following variables to the .env file:
DB_HOST=your-mysql-host
DB_PORT=your-mysql-port
DB_USER=your-mysql-username
DB_PASSWORD=your-mysql-password
DB_NAME=your-mysql-database-name
JWT_SECRET=your-secret-key
  1. Start the development server:
npm run dev
  1. Open your browser and navigate to http://localhost:3000 to access the application

Usage

  • Sign up: Fill out the registration form with your name, email, and password. Click the "Sign Up" button to create an account.
  • Log in: Enter your email and password in the login form. Click the "Login" button to authenticate.
  • Profile: After successful login, you will be redirected to the protected profile page.

License

  • This project is licensed under the MIT License.

Contributing

  • Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.
  • If you have questions about the project, you can reach out to me at @bandit_of_justice in Telegram