EasyPollVote [Dev Log #1]

Published: (April 10, 2026 at 04:23 PM EDT)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for EasyPollVote [Dev Log #1]

Welcome to the First DEV LOG!

Welcome to my first Dev Log of my full‑stack application called EasyPollVote (EasyPV)!

What is EasyPollVote (EasyPV)?

EasyPollVote is a lightweight polling app that lets you create a custom poll and share a private link so anyone can vote—no account required.

Example:
A poll could ask “Do you like Cats or Dogs?” with the options “Cats” or “Dogs.” After creating the poll, you share the link and voters can submit their choice instantly.

Note: The feature set may evolve over time.
Current focus: Learning how to use Supabase.

The Current Stack

The project started from the Next.js + Supabase Template.

Current Progress

Screenshot of current UI

At the moment the app is a bare‑bones prototype with hard‑coded values. The main functionality is integrating GET and POST requests with Supabase.

Database Table

ColumnType
NameString
EmailString
VoteString

The submission form currently asks for name, email, and a choice between Pikachu or Blastoise. Validation is minimal, so users can vote multiple times.

POST Request (Submitting a Vote)

if (formData.vote == "") { // All values need to be submitted
   setMessage("Error: Please select a Pokémon to vote for.");
} else { // Upload the data to the database via POST request
   const res = await fetch("/vote", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(formData),
   });

   if (!res.ok) {
      setMessage("Error: Form submission failed. Please try again.");
   } else { // Form has been submitted and reset the form
      setMessage("Form submitted successfully! Thank you for voting.");
      setFormData({ name: "", email: "", vote: "" });
   }
}

GET Request (Displaying Vote Totals)

useEffect(() => {
   async function fetchVotes() {
      const res = await fetch('/vote'); // your GET route
      const data = await res.json();

      // Count votes
      let pika = 0;
      let blast = 0;
      let totalVotes = 0;

      data.TotalVotes.forEach((row) => {
        if (row.Vote === 'Pikachu') pika++;
        if (row.Vote === 'Blastoise') blast++;
      });
      totalVotes = pika + blast;

      // Set the scores after calculation
      setTotalVotes(totalVotes);
      setPikachuVotes(pika);
      setBlastoiseVotes(blast);
      setLoading(false);
   }

   fetchVotes();
}, []);

All database interactions are located in the /api/vote folder (e.g., route.ts).

Official Website

Explore the live project here:

Feel free to use a fake email and name for testing. Everything works as intended, and any feedback is greatly appreciated!

Any questions/comments/feedback? I would love to hear from you!

Note: This post is monitored by the University, so the repository is currently private until early summer.

0 views
Back to Blog

Related posts

Read more »