The Contact Management App is a full-stack web application that allows users to manage contacts. It enables users to perform CRUD (Create, Read, Update, Delete) operations on contacts, with information such as first name, last name, email, phone number, company, and job title. The backend is built using Node.js/Express and the frontend is developed with React. The application uses MongoDB as the database to store contact data.
- Add, Edit, and Delete Contacts: Users can add, edit, and remove contacts from their contact list.
- Responsive UI: The user interface is built using Material-UI components for a clean and modern design.
- Sortable and Paginated Contacts Table: Contacts are displayed in a table with sorting and pagination.
- Backend API: A RESTful API built with Express.js allows communication with the MongoDB database.
- Frontend: ReactJS, Material-UI, Axios
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: None (can be added later)
git clone https://github.com/your-username/contact-management-app.git
cd contact-management-app
Navigate to the server
directory and install the required dependencies:
cd server
npm install
The application uses MongoDB for data storage. You can either use a local MongoDB instance or MongoDB Atlas (cloud-based MongoDB).
- (a) Open
backend/config/db.js
. - (b) Update the MongoDB URI with your connection string:
- For a local MongoDB instance, use:
const dbURI = 'mongodb://localhost:27017/yourdbname';
- For MongoDB Atlas, use the connection string provided by MongoDB Atlas:
const dbURI = 'mongodb+srv://<username>:<password>@cluster0.mongodb.net/yourdbname';
- For a local MongoDB instance, use:
Make sure to replace <username>
, <password>
, and yourdbname
with your MongoDB credentials and database name.
Run the following command to start the backend server:
npm run dev
Navigate to the client
directory and install the required dependencies:
cd client
npm install
Run the following command to start the React frontend server:
npm run dev
Fetch all contacts from the database.
Create a new contact.
Fetch a contact by ID.
Update an existing contact by ID.
Delete a contact by ID.
The contact schema is defined in backend/models/contact.js:
// contactSchema
const contactSchema = new mongoose.Schema({
firstName: {
type: String,
required: true
},
lastName: {
type: String,
required: true
},
email: {
type: String,
required: true,
unique: true
},
phone: {
type: String,
required: true
},
company: {
type: String,
required: true
},
jobTitle: {
type: String ,
required: true
},
});
- Add New Contacts : The "Create a Contact" form allows users to add new contacts to the database.
- View Contacts : All contacts are displayed in a table format on the homepage, with options to edit or delete each contact.
- Edit Contact : Users can edit existing contacts and update their information.
- Delete Contact : Users can delete contacts from the database.
Hi! I'm a passionate software developer specializing in full-stack development. I have experience with React, Node.js, MongoDB, and building modern, user-friendly applications. I enjoy solving real-world problems through clean, efficient code and constantly learning new technologies to enhance my skills. 😊