This is a simple user authentication application built using React and Next.js. It demonstrates a basic authentication flow, including login functionality with a focus on modern web application practices.
- User Login: Secure login functionality.
- Authentication State Management: Session management using cookies.
- Modern UI: Utilizing Radix UI for a sleek and responsive design.
- React: A JavaScript library for building user interfaces.
- Next.js: A React framework that enables functionality such as server-side rendering and generating static websites.
- Axios: A promise-based HTTP client for making HTTP requests.
- SWR: A React Hooks library for data fetching.
- js-cookie: A simple, lightweight JavaScript API for handling cookies.
- Radix UI: Unstyled UI primitives to build your own design system.
- Jest: A delightful JavaScript Testing Framework with a focus on simplicity.
Make sure you have Node.js installed on your system (the latest version is recommended).
-
Clone the repository:
git clone https://github.com/your-username/simple-user-auth.git
-
Copy the envs:
cp .env.sample .env.local
-
Install packages:
npm install
or
yarn install
-
Development Mode: Run
npm run dev
oryarn dev
. This will start the development server onhttp://localhost:3000
. -
Production Build: Run
npm run build
oryarn build
to build the application for production. -
Start Production Server: After building, you can start the production server by running
npm start
oryarn start
.
To run tests, execute npm test
or yarn test
. This will run Jest tests in watch mode.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
Distributed under the MIT License. See LICENSE
for more information.