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.
├── 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
/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
- 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)