This is a simple test to evaluate your skills in JavaScript and Nuxt.js/Next.js.
- Fork this repository
- Create a new branch with your name
- Complete the test
- Push your changes to your forked repository
- Send us the link to your forked repository
P.S. dot not forget to commit your changes.
- 2 hours and 30 minutes
- Node.js (v14 LTS or higher)
cd server
npm install
npm run start
Output:
Server listening on port http://localhost:4000
Postman Collection (⬇️Download)
Method | Auth | Endpoint | Body | Description |
---|---|---|---|---|
GET | No | /users | Get all users | |
GET | Yes | /todos | Get user todos | |
POST | Yes | /todos | task string |
Create a new todo |
PUT | Yes | /todos/:id | Toggle todo completion | |
DELETE | Yes | /todos/:id | Delete a todo |
Body type: application/json
Example body:
{
"task": "Buy milk"
}
The API sometimes requires authentication. the authentication type is Basic Auth
You can find the credentials in the server/data/users.json
file.
Example curl:
curl --location --request GET 'http://localhost:4000/todos' \
--header 'Authorization: Basic enVja2VyOjEyMzQ1Ng=='
Example axios:
await axios.post(endpoint, {}, {
auth: {
username: 'zucker',
password: '123456'
}
});
Avatar | Username | Password |
---|---|---|
zucker | 123456 | |
felon | 123123 | |
robon | secret |
- User should be able to select a user from the list of users.
- User should be able to see user details (name, avatar).
- User required to enter only password to login after selecting his account from the list.
- User should be able to see the list of todos for the selected user.
- User should be able to create a new todo.
- User should be able to toggle todo completion.
- User should be able to delete a todo.
- User should be able to view his name and avatar in the app header.
- User should be able to logout.
Good luck!👍