Skip to content

Latest commit

 

History

History
66 lines (52 loc) · 1.44 KB

Readme.md

File metadata and controls

66 lines (52 loc) · 1.44 KB

Contacts API

A set of APIs built using Node(Express) + MongoDB(mongoose) with the following features:

  • Authentication module using jwt
  • Upload and save contact (csv file) through api in db using service workers.

Structure


├── config
│   └── database.js       // Database configuration
├── middleware
│   └── auth.js           // User Authentication using token
├── model
│   └── user.js           // User schema
├── uploads               // Directory where Multer saves uploaded csv files 
├── app.js                // API implementation
└── index.js              //Server setup

API

/register:

  • POST : Register a user
  • Input fields: name, phone, email, linkedin_url, password
  • All input fields are required

/login:

  • GET : Login a registered user.
  • Unique Identifier: email

/display-users

  • GET : Displays the list of registered users

/home

  • POST: Route that requires a user JWT token in the header.

/upload-csv

  • POST : Uploads and saves contact information from csv file to mongo db database
  • Single CSV file upload
  • CSV file can contain multiple entries

Future Scope:

  • Add test with a precise error when one or more contacts in the csv file are already registered.
  • Input linkedIn Url as type: url rather then type: string (when required)