This project is a login and registration form built with React and Vite. It uses Firebase for authentication (email/password and Google Sign-In) and Firestore to store user information. The form is styled using Tailwind CSS.
- User registration with email, password, and additional user information (username).
- User login with email and password.
- Google Sign-In pop-out for quick authentication.
- Form validation using React state hooks and regex.
- Secure storage of user information in Firestore.
- Responsive design using Tailwind CSS.
To get started with this project, clone the repository and install the necessary dependencies.
git clone https://github.com/yourusername/your-repo.git
cd your-repo
npm install
- Go to the Firebase Console and create a new project.
- Enable Authentication:
- Go to the Authentication section and enable Email/Password and Google Sign-In methods.
- Set up Firestore:
- Go to Firestore Database, create a new database, and start in test mode.
- Add your Firebase configuration to the project:
- Create a .env file in the root of your project and add your Firebase configuration:
VITE_FIREBASE_API_KEY=your-api-key VITE_FIREBASE_AUTH_DOMAIN=your-auth-domain VITE_FIREBASE_PROJECT_ID=your-project-id VITE_FIREBASE_STORAGE_BUCKET=your-storage-bucket VITE_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id VITE_FIREBASE_APP_ID=your-app-id
npm run dev
-
Navigate to the Registration page by clicking on the signup button on the homepage.
-
Enter Your correct details in the input fields. Make sure you pass the validations by checking if the red times change to a green tick.
-
Click on submit, and you should see a toast message that says 'registration successful'.
-
Alternatively, you can use the Google Sign-In button to log in with your Google account, it automatically signs you up as well.
-
After a successful registration, you will be redirected automatically to the Login page.
-
Enter your email and password used during registration and it should log you in.
-
You will be redirected to a welcome page upon successful login, where you will also see the logout button that logs you out of the application.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (git checkout -b feature/your-feature).
- Commit your changes (git commit -m 'Add your feature').
- Push to the branch (git push origin feature/your-feature).
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.