Step 3. Upvoting Features

Step duration ~18 min

Step 3.1: User Management

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.

Step 3.2: Configure Upvoting

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

  1. Upvotes ("Number")

  2. Users Upvoted IDs ("ArrayLink β†’ WebUser").

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

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).

Finally, we are sorting the cards by upvotes.

Last updated