Skip to content

mariosobhy/user-contacts-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Total time spent was approximately 30 min

Things you may want to setup the project:

  • Install Node.js, mongoDb and npm

  • Start mongoDb server by running mongod --dbpath {your db data path}

  • After that you will run npm i to install the dependencies needed for this project

  • Then you will run npm start dev or node src/app.js to run your server

API Documentation:

  • Here's a link of postman doucumentation here

Notes

  • The last API (GET /contacts/getSharedList) was unclear for me for different reasons and I didn't find any data flow compatibable to get shared contacts without taking any previous action but I made an assumption
    1. So I created an array of objects called sharedUsers in Contact model
    2. then you can pass the IDs of users you want to share the contact with in (POST /contatcs/addContact) as I mentioned in postman docs
    3. then finally you can call /contacts/getSharedList API with secondUserId to get the shared contacts between them

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published