Skip to content

adarshupadhyay21/Contact_Manager_App

Repository files navigation

📇 Contact Manager App

A back-end contact management application built using Node.js, Express.js, MongoDB, and JWT authentication. This app allows users to register, log in, and securely manage their contacts with authentication and authorization.

🚀 Features

✅ User Authentication (Signup, Login) using JWT tokens

✅ Protected Routes with JWT middleware

✅ CRUD Operations for managing contacts (Create, Read, Update, Delete)

✅ MongoDB Integration using Mongoose

✅ Password Hashing with bcrypt.js for security

✅ Error Handling for better API responses

✅ RESTful API following best practices

🛠 Technologies Used

Node.js & Express.js – Backend framework

MongoDB & Mongoose – Database and ORM

JWT (JSON Web Token) – Authentication

bcrypt.js – Password hashing

dotenv – Environment variable management

Thunder Client– API testing

📌 Installation

Clone the repository:

git clone https://github.com/adarshupadhyay21/Contact_Manager_App.git

cd Contact_Manager_App

Install dependencies:

npm install
Set up the .env file:

Create a .env file in the root directory and add the following variables:

CONNECTION_STRING = your_mongodb_connection_string

ACCESS_TOKEN_SECRET = your_secret_key

PORT = 5001

Start the server:

npm start

The API will be running in your localhost at: http://localhost:5001

📡 API Endpoints

📡 API Endpoints

🔹 Auth Routes

  
    POST   /api/auth/register      // Register a new user
    POST   /api/auth/login         // User login
    GET    /api/auth/current       // Get the current logged-in user (Protected)
  

🔹 Contact Routes (Protected)

  
    GET    /api/contacts           // Get all contacts
    POST   /api/contacts           // Add 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
  

🤝 Contributing

Contributions are welcome! Feel free to fork this repository, make your changes, and open a pull request for any feature or bug fix.

About

A contact management application built using Node.js, Express.js, MongoDB, and JWT authentication. This app allows users to register, log in, and securely manage their contacts with authentication and authorization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors