Skip to content

A set of API's implementing Authentication functionality using JWT Tokens and uploading and saving the CSV file in mongoDb database.

Notifications You must be signed in to change notification settings

sakshi-dhamija/Contacts_API

Repository files navigation

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)

About

A set of API's implementing Authentication functionality using JWT Tokens and uploading and saving the CSV file in mongoDb database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published