This project is designed to allow user registration and display registered users in a table format. It includes the following components:
- Backend: Handles API endpoints for user registration and retrieval.
- React Frontend: User interaction using React and Vite.
- HTML Frontend: A simple HTML-based interface for quick testing or demonstration.
backend-project
|-- backend
| |-- (Backend server files)
|
|-- react_frontend
| |-- (React + Vite frontend files)
|
|-- html_frontend
|-- (Simple HTML frontend files)
Follow the steps below to clone the project, install dependencies, and run the application.
Ensure you have the following installed:
Execute this command in your terminal to clone the project:
git clone https://github.com/kunalbhatia2601/backend-project.gitNavigate to the project directory:
cd backend-projectNavigate to the backend folder:
cd backendInstall dependencies:
npm installRun the backend server:
node index.jsThe server will run on http://localhost:3000 (default port).
Navigate to the react_frontend folder:
cd ../react_frontendInstall dependencies:
npm installRun the React frontend:
npm run devThe application will be available at http://localhost:5173 (or the port specified by Vite).
You can enhance the styling of the React pages using the App.css file located in the src folder.
Navigate to the html_frontend folder:
cd ../html_frontendOpen the index.html file directly in your browser.
You can enhance the styling of the HTML pages using the style.css file located in the same folder.
- User Registration:
- Register users by providing their name, username, and password.
- Display Users:
- View all registered users in a table format on the frontend.
-
POST /send-data: Register a new user
{ "name": "string", "username": "string", "password": "string" } -
GET /get-data: Retrieve the list of all registered users