A full-stack contact management application built with Node.js, Express, MongoDB, and React.
- User registration and login with JWT-based authentication and authorization.
- Create, read, update, and delete (CRUD) operations for managing contacts.
- Responsive user interface with seamless navigation using React and React Router.
- Robust error handling and asynchronous operations management.
- Backend: Node.js, Express, MongoDB, Mongoose
- Frontend: React, React Router, Axios
- Authentication: JSON Web Tokens (JWT)
- Styling: CSS
- Node.js and npm installed on your machine.
- MongoDB installed and running.
-
Clone the repository:
git clone https://github.com/yourusername/contact-manager.git cd contact-manager/backend -
Install backend dependencies:
npm install
-
Create a
.envfile in the backend directory and add the following environment variables:MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
-
Start the backend server:
npm start
-
Navigate to the frontend directory:
cd ../frontend -
Install frontend dependencies:
npm install
-
Start the frontend development server:
npm start
- Open your browser and navigate to http://localhost:5000.
- Register a new user or login with existing credentials.
- Add, view, update, and delete contacts.
POST /api/users/register- Register a new user.POST /api/users/login- Login a user.GET /api/contacts- Get all contacts.POST /api/contacts- Create a new contact.GET /api/contacts/:id- Get a contact by ID.PUT /api/contacts/:id- Update a contact by ID.DELETE /api/contacts/:id- Delete a contact by ID.
This project is licensed under the MIT License.