Thank you for taking the time to work on our assignment.
The goal of this assignment is for us to get a better idea of your ability while not taking too much of your time.
We like programmers who are curious and comfortable with new technology. We'd love for you to use the new Next.js app directory. But if you feel more comfortable with the traditional pages structure then go for it! In case you do not have enough time feel free to skip parts of the assignment.
The criteria on which you are judged:
- The simplicity and structure of your state
- How well you use the Next.js features such as SSR
- Readability of your code
- Performance for the user
- How well you use components
- Selection of your libraries and frameworks
Bonus points
- beautiful application.
- And kind and detail commit logs.
- TDD (e,g. jest.js)
- Offer to improve the function or optimization.
Use the /api/auth
endpoint to authenticate and show us how you keep the authentication state throughout the frontend. The correct username and password is admin/admin.
Parameters
Name | Required | Type |
---|---|---|
username | Required | String |
password | Required | String |
Response
{
"auth": true || false
}
Create a page with a form that is only accessible by authenticated users. Use the /api/create
endpoint to create a new object with the following validated attributes:
- Name, should have at least 2 characters and no more than 1000.
- Password, should have at least a number, a special character, and be more than 8 characters long.
- A valid vietnamese phone number
- An email address
Parameters
Name | Required | Type |
---|---|---|
name | Required | String |
password | Required | String |
phone | Required | String |
Required | String |
Response
{
"success": true || false
}
Create a page where only authenticated users can see a paginated table with the return data. Get the data from /api/view
Parameters
Name | Required | Type |
---|---|---|
offset | Required | String |
limit | Required | String |
Response
{
"total": 205,
"limit": 2,
"offset": 10,
"data": [
{
"id": "63f2f7f75a9c799b30c04ce0",
"name": "Lena Woodward",
"email": "lenawoodward@earthwax.com",
"phone": "+84 (968) 510-2748"
},
{
"id": "63f2f7f77fc65f4eae54cbd0",
"name": "Petersen Jacobson",
"email": "petersenjacobson@earthwax.com",
"phone": "+84 (812) 589-2242"
}
]
}