---
# System prepended metadata

title: Adanic backend interview assignment

---

# Adanic backend interview assignment


### Required features
* Use **Express** or **Koa** for serving APIs     
* You can use any DB that you want(we prefer mongo or mysql)    
</br>
* You should have a User entity 
    </br>
    
    ```
    {
        firstName    
        lastName
        email(use email for basic auth)
        password
        role: admin || operator
    }
    ```

    * Create user
        * For creating a user we need to verify that the email belongs to user and basic authentication for the future login.
        * No one allwoed to create admin user with this API.
    * Get user info:
        * Basic authentication. 
    * Update user data:
        * Every user can update himself/herself data.
        * Admin can update other users. 
        * All fields except role and email can be edited by user.
        * Even role could be updated by admin. 
        * Basic authentication.
    * List all users
        * Only by admin users.
        * Basic authentication.
    * Delete a user
        * Every user can only delete himeself/herself.
        * Admin can delete operator users.
        * Basic authentication.
    * For initializing the system you need a admin user for this purpose you should write a migration or script or any other option you think is the best. 
    * For sending email you can use any free mail service of your choice. 
</br>    
* You should implement above APIs (Better to use REST conventions)
* Writing swagger for your project
* Your project should be on Gitlab or Github and send us the repository link.
</br>
</br>
### Optional features
If you had time and you were interested you can implement some of these optional features
* Write the project with typescript.
* Write dockerfile for your project.
* Write docker-compose
    * For bringing up application
    * For bringing up databse
* Add CI/CD with any tool that you are ok with that (Github Actions, Gitlab CI , ...)
* Add eslint
* Add prettier
* Writing Tests
    * Unit tests
    * Integration tests




**PS**
* If you have a cool feature in your mind that is not listed above but you want to do that, feel free to implement.
* If you have no time and you can't do it completely, no worries, you can send your incomlete version for us.
* It's good if you can deliver it before your dead line, but if you think you need more time, no rush, quality matters most.
* If you had any questions/feedbacks you can DM us in Discord or by email.
    * Siamak Nikfar `siamak#2247`
    * siamak.nikefar@gmail.com