A full stack contact manager created using MongoDB, Express, React and Node.js. Part of the "Modern React Front To Back" Udemy course.
Install dependencies
npm install
cd client && npm install
Edit your /config/default.json file to include the correct MongoDB URI
npm run dev # Express & React :3000 & :5000
npm run server & npm run client # Express & React :3000 & :5000
npm run server # Express API Only :5000
npm run client # React Client Only :3000
A Node/Express REST API for contacts using JWT authentication.
Open the config/default.json file and add your mongoURI and your jwtSecret
-
Request: Add user and request JSON web token
-
Headers
Content-type: application/json
-
Body
{ "name": "", "email": "", "password": "" }
-
-
Response: 200 (application/json)
-
Body
{ "token": "" }
-
-
Request: Login with credentials to recieve a JSON web token
-
Headers
Content-type: application/json
-
Body
{ "email": "", "password": "" }
-
-
Response: 200 (application/json)
-
Body
{ "token": "" }
-
-
Request: Get all contacts of a specific user
-
Headers
x-auth-token: YOUR_JWT
-
-
Response: 200 (application/json)
-
Body
{ "contacts": [] }
-
-
Request: Add a new contact
-
Headers
x-auth-token: YOUR_JWT Content-type: application/json
-
Body
{ "name": "", "email": "", "phone": "", "type": "" [personal or professional] }
-
-
Response: 200 (application/json)
-
Body
{ "contact": {} }
-
-
Request: Update existing contact
-
Parameters
- id: (number) - An unique identifier of the contact.
-
Headers
x-auth-token: YOUR_JWT Content-type: application/json
-
Body
{ "name": "", "email": "", "phone": "", "type": "" [personal or professional] }
-
-
Response: 200 (application/json)
-
Body
{ "contact": {} }
-
-
Request: Delete existing contact
-
Parameters
- id: (number) - An unique identifier of the contact.
-
Headers
x-auth-token: YOUR_JWT
-
-
Response: 200 (application/json)
-
Body
{ "msg": "Contact deleted" }
-