This is a simple, full-stack web application demonstrating the fundamental CRUD (Create, Read, Update, Delete) operations. The backend is built with Node.js and Express, providing a RESTful API, while the frontend is a single-page application built with React.
- Create: Add new users to the list.
- Read: View the complete list of users.
- Update: Edit the name of an existing user inline.
- Delete: Remove a user from the list.
- Backend: Node.js, Express.js
- Frontend: React.js, Axios
- Database: In-memory JSON array (for simplicity)
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
You need to have Node.js and npm
installed on your computer.
-
Clone the repository:
# Replace the URL with your own repository's URL git clone [https://github.com/YourUsername/Your-Repo-Name.git](https://github.com/YourUsername/Your-Repo-Name.git) cd Your-Repo-Name
-
Setup the Backend:
cd backend npm install
-
Setup the Frontend:
cd ../frontend npm install
You will need two separate terminals to run both the backend server and the frontend development server.
-
Start the Backend Server: (In your first terminal, from the
backend
directory)node server.js # The server will be running on http://localhost:5000
-
Start the Frontend Application: (In your second terminal, from the
frontend
directory)npm start # The React application will open automatically in your browser at http://localhost:3000
Now you can interact with the application in your browser!
The backend server provides the following RESTful API endpoints:
Method | Endpoint | Description |
---|---|---|
GET |
/api/users |
Get all users. |
POST |
/api/users |
Create a new user. |
PUT |
/api/users/:id |
Update an existing user. |
DELETE |
/api/users/:id |
Delete a user. |