Entrance Events! Chat Gallery Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
May 24, 2025 - @708.14 (what is this?)
Activity rating: Four Stars Posts & Arts: 65/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: :4u: ~~~~~~~~~~~  :4u: Super News: Upload a banner!

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  making website store things


« previous next »
Pages: [1] Print
Author Topic: making website store things  (Read 247 times)
brightbluebug
Casual Poster
*

⛺︎ My Room

View Profile

Joined 2024!
« on: February 22, 2025 @185.58 »

hello. i want to make a website where people can essentially vote on various images, and the website stores this and displays the average stuff whatever. wondering how to do this? much thanks.
Logged
futurearcana
Casual Poster ⚓︎
*


he/him

⛺︎ My Room
XMPP: Chat!

View Profile WWWArt

Joined 2025!
« Reply #1 on: February 22, 2025 @403.48 »

You need a backend, a piece of software that runs on a server and communicates with your website (the piece that runs in the browser is called a frontend).

I don't know how much of this will go over your head, but the general idea is: your backend is an http server, that exposes API calls: basically functions you can run by invoking them from the frontend. They would usually return json data that you can then parse in js in your frontend and display it.

A partial simple example for a polls backend API structure would be something like this:

  • GET /polls: returns a list of all polls
  • GET /polls?status={active|inactive}: returns a list of all active/inactive polls
  • GET /polls/123: returns the poll with id 123
  • PUT /polls/123?vote=2: vote on poll 123, with choice number 2

And then other authenticated API calls that only an admin can run to create, delete and close polls.

You could also want to limit access to these APIs by IP for example, so that the same person cannot vote twice. Of course using the IP has limitations, but there are alternatives, including requiring user registration.

The data would need to be stored in a database that your backend will need to communicate with to persist all of this data.

You would also need to think about security since this would need to be hosted on the public internet you want to make sure it's secure.

For user security you would also likely need to add an SSL certificate to enable https. Usually you do this by serving your backend through a reverse proxy like nginx.



To summarize, this sounds like an easy thing to do, particularly considering how easy it is to create a static backend-less frontend, but in reality it involves creating a full on application.

It's definitely not hard per se, and honestly if you're interested I'd encourage you to learn how to do this cause it's a lot of fun, but it's absolutely not on the same level of difficulty as creating your first neocities website.
Logged

Come sweet slumber, enshroud me in thine purple cloak
brightbluebug
Casual Poster
*

⛺︎ My Room

View Profile

Joined 2024!
« Reply #2 on: February 22, 2025 @842.95 »

@futurearcana sweet thanks for the help! is hosting (hosting?) a backend doable on neocities, or would i have to figure something else out? where would you recommend i start with this?
Logged
futurearcana
Casual Poster ⚓︎
*


he/him

⛺︎ My Room
XMPP: Chat!

View Profile WWWArt

Joined 2025!
« Reply #3 on: February 22, 2025 @924.49 »

You cannot host a backend on neocities, you need a full on server, likely with ssh access.

You can host it in your home if your ISP allows it. If so a raspberry pi is perfectly capable. The downside is that you'd expose your home IP.

You can also rent Virtual Private Servers (VPS's for short) for fairly cheap, some providers like ovh can get you started with less than 5$/month.

This said, start by learning how to write the actual software. You can use whatever language you prefer, my personal suggestions are node (javascript) with fastify; or python with fastapi, flask or django.

For the database sqlite should be perfectly fine for your needs and avoids a lot of extra fanaggling.

You can write the software and try it locally on your computer, while making the frontend still running on your local machine talk with it.

Also, I highly suggest developing and running all of this on linux, so get familiar with that as well. This is because 99.999% of servers out there run linux, and if you want to rent a windows server/vps it costs a lot more without any benefit (it is in fact highly undesirable to have a server running windows).

Once you got everything set up and working well, you can rent a vps or buy a raspberry pi and host it publicly, with a domain name and an ssl key from let's encrypt and all that.
Logged

Come sweet slumber, enshroud me in thine purple cloak
brightbluebug
Casual Poster
*

⛺︎ My Room

View Profile

Joined 2024!
« Reply #4 on: February 25, 2025 @185.14 »

@futurearcana thanks so much for such a detailed response, i appreciate it greatly! i will do so :^)
Logged
vance
Newbie ⚓︎
*


make bad art

⛺︎ My Room
Matrix: Chat!
Itch.io: My Games
RSS: RSS

View Profile WWW

Joined 2025!
« Reply #5 on: March 05, 2025 @78.43 »

I have an additional suggestion! Like @futurearcana said, you do need a backend, BUT there's a shortcut! There's a service called Appwrite, which describes itself as "backend as a service". You can use this service in place of having your own server. They have a pretty generous free plan, which should be plenty for you if you're just tracking some votes. I recently used it for a project and really liked it! You do need to know JavaScript at an intermediate level, but once you do, Appwrite is very easy to use!

You might be able to use Appwrite with a Neocities site, I'm not sure, but you shouldn't--you want to use a hosting provider that provides what's called "environment variables" in order to connect to Appwrite securely. You can still get this hosting for free though! Some good providers are Netlify and Vercel.

You may be able to find even more alternatives besides Appwrite if you do a search for the phrase "backend as a service".

I absolutely don't want to discourage you from exploring and learning, but I do want to give you a warning that if you aren't already familiar with JavaScript, it will take a good amount of work to become proficient enough to use Appwrite. And if you wanted to host your own backend, that would likely be even more work to learn, plus you would have to worry about things like server security. It's awesome stuff that's worth learning if you have an interest in it--but if all you really want is a way for people to vote on your website, then it might not be worth all the effort and time. If you just want your visitors to be able to vote on stuff and don't really care about the "how", it might be wiser to just collect responses through something like Google Forms or Tally (and store the responses in a Google Sheet or whatever) instead of trying to build it directly into your website. Though admittedly, I can't think of any way to automatically display the results on your site, so it's not a full solution...

EDIT: Okay I've been told that apparently you CAN use the Google Sheets API with client-side JavaScript to read data from a Google Sheet! Therefore, yeah, I think you should be able to make this work just using Google Sheets as your "database" and Tally or Google Forms to collect the votes.
« Last Edit: March 05, 2025 @500.83 by vance » Logged

Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

Website size

Started by RolyBoard ✁ ∙ Web Crafting

Replies: 72
Views: 12435
Last post April 20, 2025 @579.14
by chipyowo
Things you've overheard?

Started by DoctorScreechBoard ⚚ ∙ Life on Earth!

Replies: 17
Views: 4243
Last post November 12, 2024 @237.99
by pixiez
I am new to making sites and I want some tips to improve.

Started by MemoryBoard ☔︎ ∙ I need Help!

Replies: 4
Views: 2780
Last post December 14, 2021 @853.48
by Memory

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi