Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/galibmia/contact-management-server
https://github.com/galibmia/contact-management-server
cors dotenv jwt mongodb
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/galibmia/contact-management-server
- Owner: galibmia
- Created: 2024-10-27T10:55:59.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-27T15:53:06.000Z (3 months ago)
- Last Synced: 2024-11-10T17:21:00.730Z (2 months ago)
- Topics: cors, dotenv, jwt, mongodb
- Language: JavaScript
- Homepage: https://contact-management-app-server.vercel.app/
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contact Management App - Backend
This is the backend for the Contact Management App, built using Node.js and Express. It provides RESTful APIs for managing contacts, including creating, reading, updating, and deleting contacts.
## Table of Contents
- [Technologies Used](#technologies-used)
- [Setup](#setup)
- [API Endpoints](#api-endpoints)
- [Running the Application](#running-the-application)
- [Testing the API](#testing-the-api)## Technologies Used
- Node.js
- Express
- MongoDB (with Mongoose)
- JWT (JSON Web Tokens) for authentication
- Dotenv for environment variables## Setup
1. **Clone the Repository**:
```bash
git clone https://github.com/galibmia/contact-management-server
cd contact-management-app-backend
```2. **Install Dependencies**:
Make sure you have [Node.js](https://nodejs.org/) installed. Then, run:
```bash
npm install
```3. **Environment Variables**:
Create a `.env` file in the root directory and set the following variables:
```plaintext
PORT=5000
MONGO_URI=
JWT_SECRET=
```## API Endpoints
### Authentication
- **POST** `/api/auth/register`: Register a new user
- **POST** `/api/auth/login`: Login an existing user### Contacts
- **GET** `/api/contacts`: Get all contacts (requires authentication)
- **POST** `/api/contacts`: Create a new contact (requires authentication)
- **GET** `/api/contacts/:id`: Get a specific contact by ID (requires authentication)
- **PUT** `/api/contacts/:id`: Update a specific contact by ID (requires authentication)
- **DELETE** `/api/contacts/:id`: Delete a specific contact by ID (requires authentication)## Running the Application
1. **Start the Server**:
```bash
npm start
```2. **Access the API**:
The backend will run on `http://localhost:5000` by default.3. **Testing the API**:
You can use tools like Postman or cURL to test the API endpoints.## Contributing
Contributions are welcome! If you have suggestions for improvements or new features, feel free to create a pull request or open an issue.## License
This project is licensed under the MIT License.