This document describes a login template in React that connects to a custom API to authenticate users.
https://react.manugonzalez.com/
The project is structured as follows:
src/
components/
- Loader.tsx: This component handles loaders
- Router.tsx: This component handles routers
layout/
- Index.tsx: Contains the layout structure.
helpers/
- transformers.tsx: Transform data from axios.
hooks/
- useAuth.tsx: Hook for authenticate or logout the user
- useLocalStorage.tsx: Hook for manage localStorage
- useUser.tsx: Hook for manage User
- useRegister.tsx: Hook create users
context/
- AuthContext.tsx: This module provides the authentication context for the application.
compiler/
- types.tsx: This TypeScript file defines all interfaces
- App.tsx: This is the main component of the application.
To use this template, simply clone the repository, install the dependencies with npm install
or yarn install
, and then start the application with npm start
or yarn start
. Be sure to configure the URL of your custom API in .env
file.
- React 18.2
- Vite 5.2
- Vite react swc 3.5
We welcome contributions to this project! Here are the steps to get started:
-
Fork the Repository: Click the 'Fork' button at the top right of this page and clone your forked repository to your local machine.
-
Create a Branch: Create a new branch on your local repository. The branch name should be descriptive of the changes you'll be making.
git checkout -b your-branch-name
-
Make Your Changes: Make the changes you want to contribute. These could be adding new features, fixing bugs, or improving documentation.
-
Commit Your Changes: Commit your changes with a descriptive commit message.
git commit -m "Your descriptive commit message"
-
Push to Your Fork: Push your changes to your forked repository.
git push origin your-branch-name
-
Create a Pull Request: Go to your forked repository on GitHub and click the 'New pull request' button. Fill out the form and then submit the pull request.
Before submitting your pull request, please make sure your changes do not break the project. You can do this by running the project and checking if everything works as expected.
Thank you for your contribution!