> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/directual-step-by-step/open-development-pipeline/step-3-upvoting-the-features.md).

# Step 3. Upvoting Features

## Step 3.1: User Management

{% embed url="<https://youtu.be/KelGl58bUjg>" %}
3:44
{% endembed %}

To set up user management, follow these steps:

1. Create an API endpoint on the "App users" (WebUser) data structure with a condition like "role like admin" on the user's session
2. Create a new web page with a security condition where "role == admin"
3. Add a Table component to that page.

![](/files/-MazNGrkklHavbbxny6l)

## Step 3.2: Configure Upvoting

{% embed url="<https://youtu.be/fBpqzR_IqVI>" %}
15:08
{% endembed %}

Let's add two new fields to `Features` data structure:

1. **Upvotes ("**&#x4E;umber")
2. **Users Upvoted IDs ("**&#x41;rrayLink → WebUser").

Next, create a new page for upvoting, which should be accessible to all authorized users:

![](/files/-Mb2C60Wpny5VbEwoTo3)

Note that we've added the "Upvotes" field as a counter on the cards.

Now, we configure actions:

* Add a new data structure `upvotes` with the following fields:
  * `user_id`, type of `link→WebUser`
  * `feature_id`, type of `link→Features`
* Create an API endpoint for adding objects to `upvotes`
* Design a scenario for counting votes (avoiding duplication).

![](/files/-Mb2E7L_RAGwqjw-dXQQ)

![Add an element to users\_upvoted\_ids ](/files/-Mb2ECY_akqbI4kbgUic)

![Counting the length of users\_upvoted\_ids](/files/-Mb2EOIZLafQucIs3wrq)

Finally, we are sorting the cards by `upvotes`.
