# 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://readme.directual.com/directual-step-by-step/open-development-pipeline/step-3-upvoting-the-features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
