πŸ‘‹Want to learn some NoCode today?

You can follow along as I build my Sunday Project:

A Reddit style Post Voting Page πŸ‘½

created entirely without code #buildinpublic 🧰

Follow this thread to learn how πŸ§΅πŸ‘‡ Image
Reddit is great because it lets the users decide what gets to the top of each page

So why not make your own voting page for your favorite links?

I'm going to do exactly that using @bubble
The first thing to I do is create a new app

I'll give it a name and fill in some details Image
Reddit has grown over the years but the basic features I'll use are:

-Submission Title
-Submission URL
-Upvote
-Downvote
-Total Votes Image
I'm going to make some database fields to hold this information

Real easy since @bubble includes a database

Data Type: Submission
-Title(text)
-URL(text)
-Votes(Number)
-Upvoters(List of Users)
-Downvoters(List of Users) Image
Now I want to make a Submission "mine" when I add it

To do this I'm going to add a field in the User data type:

-Field Name is "My Submissions"
-Field Type is "Submissions" which refers to the data type I already made

and I'm checking the box for multiple entries Image
I can get to work on the front end design now

My page width will be 1200px

and I'll start with a simple header

-Group, Flat color BG #FFFFFF 1200x50
-Image Element (Astronaut Icon)
-Text Element( linkkit name) Image
The main section only requires a few elements

Base elements:

-Group container
-Popular Posts heading (text)
-Submit (Button w/text + icon) Image
Now the core elements for the voting submissions:

-Repeating group to display the list of submissions
-Data Source: Search for Submissions (sorted by Votes)
-Icons (Up/Down Arrows)
-Text (Submission Title)
-Text, box checked to recognize link (Submission URL) Image
Last thing I need is the current vote score for each submission

This will be a text element with a simple calculation:

Current Cell's Submission's Upvotes:count - Current Cells' Submission's Downvoters:count

Now I'll be left with the vote count I'm looking for Image
To add new submissions I'll add a popup form

-New Submission (text element)
-Add a title (input element)
-Add URL (input element)
-X (icon)
-Submit (Button w/text + icon) Image
That should do it for UI elements

Time to build the workflows to make everything run

To start I'll just do a simple Show Popup workflow to get the submit screen to show

-When Group Button Add is clicked β†’ Show Popup Submission Image
The workflow to add a new submission is simple

-When Group Button Add is clicked β†’ Create a new Submission

Title = Input Add title value
URL = Input Add URL value

Then I'll reset inputs to clear the boxes
and hide the Popup box Image
To test it out I added one of my previous Sunday Projects

I put in a title and the URL for Landing Hype and it showed right up Image
With the submissions working I just need to add a way to vote

I'll focus on upvoting first

There are two conditions I need to account for:

-Current user hasn't upvoted yet
-Current user has upvoted

I can have it check using the Only when... Image
When the current user hasn't upvoted

-Make a change to a thing... Submission
-Thing to change... Current cell's Submission
-Upvoters add Current User Image
I can also calculate the total votes

This could be useful if I want the number without doing a calculation

Step 2
-make change to a thing... Submission
-Thing to change... Current cell's Submission
-Votes = The Submission's Upvotes: count - Submission's Downvoters: count Image
The second condition allows a user to remove their vote

When...contains Current User

-make a change to a thing... Current cell's Submission
-Upvotes remove Current User

Step 2 recalculate the vote
-Votes = The Submission's Upvotes: count - Submission's Downvoters: count Image
For downvote I'm just repeating the same steps

this time I'm changing the Downvoters field Image
For a better user experience I'm going to add some conditions to the icons

When a Current User adds Upvotes I'll make the icon orange

I'll also make it so the icon isn't clickable if it was already downvoted

Later I could add more workflows to allow instant switching of votes Image
Repeat it again for the downvote Image
That should do it for all the logic necessary

Now I'll try and upvote my post...
It worked!! πŸŽ‰πŸ₯³πŸΎ Image
Now I have a fully functioning post vote page like Reddit

Hopefully you learned something new

-Please RT the first post and tag someone that might find this useful!

-Follow me if you want to see more updates and projects like this
If you liked this check out some of my other Sunday projects:

Tweet Wall of Love:

Link-in-Bio Page:

Landing Page Gallery:

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Jarrett πŸ‘

Jarrett πŸ‘ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(