Skip to content

kavyarathod05/Contact-Manager-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contact Management App

This project is a Contact Management App built with Express.js and MongoDB., creating an Express server, handling routes, and performing CRUD operations for contacts and users.

Table of Contents

Introduction

Overview of the project and REST API conventions.

Project Setup

Setting up the project structure for the Contact Management App.

Creating an Express Server

Creating an Express server for handling requests.

Setting Up Thunder Client

Setting up Thunder Client for testing the API.

Express Router & Contacts CRUD Routes

Setting up Express Router and CRUD routes for contacts.

Contact Controller for CRUD Operations

Creating a Contact Controller to handle CRUD operations.

Handling HTTP Methods

Handling multiple HTTP methods per route.

Middleware for POST Requests

Using built-in middleware to handle POST request bodies.

Error Handling

Throwing and handling errors using middleware.

Async Handler

Using an async handler for asynchronous operations.

MongoDB Setup

Setting up MongoDB for the project.

Connecting Express to MongoDB

Connecting the Express app to the MongoDB database.

Mongoose Schema for Contacts

Creating a Mongoose schema for contacts.

CRUD Operations for Contacts

Get All Contacts

Implementing the GET all contacts operation.

Create New Contact

Implementing the POST create new contact operation.

Get Contact

Implementing the GET single contact operation.

Update Contact

Implementing the PUT update contact operation.

Delete Contact

Implementing the DELETE contact operation.

User Routes

Adding routes for user registration, login, and getting current user.

User Controller

Creating a User Controller for handling user-related operations.

Mongoose Schema for User

Creating a Mongoose schema for users.

User Registration and Password Hashing

Implementing user registration and hashing passwords.

JWT Access Token and User Login

Generating JWT access tokens and implementing user login.

Protecting Routes

Verify JWT Token Middleware

Creating middleware to verify JWT tokens and protect routes.

User and Contact Relationship

Handling the relationship between users and contacts.

Logged in User Get All Contacts

Implementing GET all contacts for the logged-in user.

Logged in User Create New Contact

Implementing POST create new contact for the logged-in user.

Logged in User Update and Delete Contact

Implementing PUT update and DELETE contact for the logged-in user.

About

This uses different Nodejs, Express, MongoDB & JWT Topics and implementation in one single project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors