Certainly! Below is a GitHub README for your project, including usage instructions and relevant information based on the provided code:
This project is a User Management System built using React.js for the frontend and Express.js for the backend. It allows users to sign up, log in, view profiles, and perform administrative tasks such as managing user accounts.
- User Authentication: Users can sign up for new accounts and log in securely using their credentials.
- Role-based Access Control: Differentiates between regular users and administrators, granting special privileges to admins, such as managing user accounts.
- Admin Panel: Administrators have access to an admin panel where they can view all users, delete user accounts, and perform other administrative tasks.
- Profile Management: Logged-in users can view and manage their profiles.
- Google Login: Users can log in using their Google accounts for added convenience.
- Node.js installed on your machine (Download Node.js)
- MongoDB installed and running (Download MongoDB)
-
Clone the repository to your local machine:
git clone git@github.com:umrmahmood/userAuthSystem.git
-
Navigate to the project directory:
cd userAuthSystem
-
Install dependencies for both the frontend and backend:
cd frontend npm install cd ../backend npm install
-
Set up environment variables:
- Create a
.env
file in thebackend
directory. - Add the following variables to the
.env
file:PORT=5000 MONGODB_URI=mongodb://localhost:27017/user-management SECRET_KEY=your_secret_key_here
- Create a
-
Start the backend server:
cd backend npm start
-
Start the frontend server:
cd frontend npm start
-
Access the application in your browser at
http://localhost:3000
.
- Sign Up: Navigate to the sign-up page (
/create-user
) and fill out the required information to create a new account. - Log In: Use the login form on the homepage to log in with your credentials.
- View Profile: Once logged in, you can view your profile information on the profile page (
/
). - Admin Panel: If you are an admin, navigate to the admin panel (
/admin-area
) to view and manage user accounts. - Google Login: Click on the "Google Login" button to log in using your Google account.