This project is part of my frontend learning portfolio focused on React and Tailwind CSS.
A responsive store application built with React, Vite, and Tailwind CSS. This app allows users to log in, view a list of products, and access detailed views of each product. It demonstrates a complete login flow with form validation, protected routes, and toast notifications. The project integrates the API from dummyjson.com to simulate user authentication and manage product data. Built as a practice exercise, this app offers an example of how to implement a simple store with user authentication and product browsing functionality.
react-login/
āāā public/ # Public static files
āāā src/ # Main source code
ā āāā api.js # Mock API logic
ā āāā assets/ # Resource files (images)
ā āāā components/ # Reusable components
ā āāā hooks/ # Custom React hooks
ā āāā layouts/ # Layout structures
ā āāā pages/ # Main pages of the app
ā āāā index.css # Global styles for app
ā āāā main.jsx # React entry point
āāā index.html # Main HTML file
āāā package.json # Dependencies and scripts
āāā tailwind.config.js # Tailwind CSS configuration
āāā postcss.config.cjs # PostCSS configuration
āāā vite.config.js # Vite configuration
āāā README.md # Project documentation
react-hook-form
localStorage
sonner
Tailwind CSS
Clone the repository:
git clone https://github.com/LSCasas/react-login.git
cd react-login
Install dependencies:
npm install
Start the development server:
npm run dev
Then, open your browser and navigate to :
http://localhost:5173
To log in, use the credentials of a sample user from the API ā for example:
Username: emilys
Password: emilyspass
If the credentials are incorrect, the app will show the following:
User session data is stored in localStorage
for simplicity. In a production environment, this is not recommended due to security risks like XSS attacks
. For better security, use HttpOnly cookies
to store tokens. Since this is a portfolio project and not handling real sensitive data, these security measures are not fully implemented.
If you want to contribute to this project, follow the steps below:
Fork the repository.
Create a new branch for your feature:
git checkout -b feature/new-feature
Make your changes.
Commit your changes:
git commit -am 'Add new feature'
Push your changes to your fork:
git push origin feature/new-feature
Create a Pull Request for your changes to be reviewed and merged into the main project.
To learn more about the tools and libraries used in this project, check out the following resources:
Your feedback and contributions to this project are welcome!