0% found this document useful (0 votes)
3 views2 pages

Coding Problem 1-1

Uploaded by

karthik1925yadav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Coding Problem 1-1

Uploaded by

karthik1925yadav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Project Description: “Add, Search User”

Functionalities:

Backend:

• Add User API


o Create a REST API to add a new User. User fields – Username, First name,
last name, Email, and password.
o The API should use bearer token using JWT. If you are not aware of JWT,
please use basic authentication.
o If you are using Basic auth, encrypt the username and password with
reasonably good encryption algorithm.
o The auth string should be the encrypted value of {username}:{password}
o The auth string should be verified before serving the request. If credentials
are invalid, send back an UNAUTHORISED response.
o Validate the first name, last name, username and password. (The username
should be unique. Meaning, the username of one user should not be allowed
to be used for another user.)
o Save the user in database (PostgreSQL)
o The response should be JSON with following field - ‘Status’, ‘userId’. The
status is a string field where the success response is given. The userId field is
an integer field which is the unique ID of the user added in the database.
• Query the User API
o Create an API for querying the users created using the ADD user API.
o The query parameter should be passed as JSON in the request body. You
should be able to search user by any or all the following parameters: User id,
First name, last name, Email and username
o The API should use bearer token using JWT. If you are not aware of JWT,
please use basic authentication.
o If you are using Basic auth, encrypt the username and password with
reasonably good encryption algorithm.
o The auth string should be the encrypted value of {username}:{password}
o The auth string should be verified before serving the request. If credentials
are invalid, send back an UNAUTHORISED response.
o The response should be JSON. You should return a JSON array of users
matching the search criteria.
o If no users are found, return an empty array
User interface:

• Add user page:


o Create a UI for adding the user.
o The page should have the form for adding the fields required for adding the
user.
o The field validation should be done before submitting the form.
o Once the form is submitted, you should display the response if it was
success or failure.
o Please use either jQuery or ReactJS or any Javascript library for doing the
client side validation
o The validation message should be displayed inline with the respective form
field elements
• List user page:
o Create a page to display the users added in to the database. The table
should contain the following columns: First name, last name, Email and
username.
o Add a search field where you can filter the users listed in the table.

NOTE:

• Project to be completed within 2 days after receiving the problem.


• Create a new private repo in your GitHub account.
• Add ReadMe to the repo with content on what the project is about.
• Submit your code to the GitHub repo.
• Add appropriate comments to the code for readability.
• Once you complete the work, send us an email with the repo link for review.
• We will review the code and get back to you within 2 days after your submission of
the code.
• If you have any questions reach out to us via email.

You might also like