129 Replies
that question is the same as asking "how do i create the universe from scratch so i can amke an omelette?"
how
idk what to ask
i need help having results
so when u search a certain artist it comes up with a page with their songs on
i want it to show results a bit like this
but only certain results not everything
so if u say like r
ren would show underneath
are you building it from scratch?
yes ive only got the html and css of the search bar
well, the easiest option is to have a list that shows with results from the server
or you have to have a list of results to show there already
it depends on what you want
how you want it to work, how you expect the results to function ...
idk how to explain
a bit like searching on spotify
i just want to search: r and there be a bunch of search suggestions under like ren ect
and if i search J juice world
wrld
i know what you mean
implementing search is hard
where are the suggestions coming from?
what are you trying to search for?
you can do it two ways:
- have code on a server handle the search and display the result you get from the server
- have the entire list in javascript and HTML, and implement the search in the frontend
a file
both are honestly a bit too broad to answer sensibly here
specially making everything from scratch
I just want like a list of artists
song artists
html pages
and u search them
you can't put "just" in front of something and make it easy...
habit sorry
what's the purpose of the search?
and then it takes u to that page
okay, do you have a list of pages?
with the artists
yes
now i need to have a search suggestion thing so when u search re then ren shows up and when u click it it takes u to rens apge
page*
am i being confusing?
sorry
for what you want, you're going to be bitting more than you can chew
unless you have an api
what does that even mean
i dont
I have a folder called artists with a bunch of html files for the artists
the generic steps:
1- receive user input - debounce it or you burn the server/api
2- wait for the server to answer
3- show a list under the input
that this is a hard problem that's not easily solved
you have to have the information somewhere
oh I know and I hate search bars i always just end up scrapping making them
but i need to
for this project
how many artists will you have?
what information?
im going to add quite alot
Do you have somewhere to run code serverside, or does this have to be client side only?
i think for now only a few
is "a lot" just 50? or 50 million?
ive only got vscode
just 50
gonna start off small though
with like 10
then build it up
that's not really an answer. Where are you deploying your code when this is done?
just to develop, you can have an array with the names of the artists, and show suggestions based on that array
probably some free hosting website for now like netlify
then eventually pay
i wouldn't touch netlify
why not?
ive used it for all my stuff
yeah idek how to do that
i was thinking it was something like that
didn't you hear the dude that was charged $104k because someone made bots that downloaded an mp3 on his site?
then you'll probably be best off putting the whole list of artists in javascript in an array, and searching through that when someone enters text in the search bar. You can use an event listener to listen for people typing in the text box
no?
could i possibly have help with doing that?
it was all over the place
not from scratch probably, no
short of writting it for you, not really
im not saying that
i just havent used javascript so idk how arrays work
then you'll have to learn javascript
^
teaching you javascript is out of scope for a question here
and search is VERY VERY VERY VERY hard to implement
you can go to https://javascript.info and learn about event handlers, forms, and data structures like arrays, then go from there
"a test" <-- just this search has to many different interpretations and expectations that will explode my mind just explaining it all
but yes, learn basic js first
i would say that search is an intermediate difficulty challenge
like this?
that is a start, yes
cool
shall i just keep listing artists for now lol
I'd park this project for a few days and focus on learning the basics of javascript
damn
ima give it a go
i would say a month, so you get familiar with everything you need
this tbh yeah
and even then, YOU WILL STRUGGLE
im not joking, you will struggle
im telling you, search is hard
a simple string search isn't too bad, it's hard if you start splitting terms and doing fuzzy matching
but if you're okay with 'uicew' returning juiceworld and 'juceworld' not, it's not too complicated
don't forget to normalize the strings, to remove all accents
so if you search for 'üíce" it returns the same as "uice"
no one is going to search for uicë though, but whatever
and when you split terms, you have to decide how the terms are interpreted
no, but an artist called "andré chaves" has to show when you search for "andre"
learn JS basics, this is too broad of a question. If you have questions about Javascript concepts, please make a post in the help forum without first posting in general, and without announcing that you made a post in general, and be as descriptive as you can be
will fetch what the user is inputing?
yes, but depends on the exact context, that may or may not be sub-optimal
and it'll do it once, not for each keystroke
oh right
uh
im sorry, but you're not at the level (yet) to implement this
we're not going to handhold you through you googling/chatgpt'ing this entire thing together. Spend some time to learn the basics
im way better at python tbh
yeah, but you're trying to do something completely different from python
and instead of taking baby steps, you're trying to eat the cake before you even have an oven to bake it
yeah i wanna get this done lol
i needa slow down
but then i get bored
it's not a slowdown
you just don't have tthe basics
im tryna code a music website
but yk
you cannot do that without knowing JavaScript
if you're good at python like you say, it should be easy enough to learn
and honestly, if i were you, i would start with something simpler
i have coded other websites
but they were purely html and css
then go to those websites and improve them with javascript
or just make a new one
like, just on that little menu there, there's several features that require a backend, and you'll need a lot of interactivity that will need frontend javascript
you cannot build this website without javascript knowledge. It is impossible.
what the music websites menu?
yeah ik like the loging out and in
and the settings
logging in and out can be done without js
as well as settings
and charts and liked songs (re: needing backend)
but making the menu work
was thinking on making a light mode and dark mode option in the settings
the search
oh ik
this project is too much for you, at this point
I absolutely hate how it needs me to have search for the music website
you can implement the search purely on the server side
ik theres a guy meant to be helping me with it but he hasnt replied to me since i told him were gonna worm on it
but you won't have search suggestions
wait fr?
yeah, but needs a backend
a server
oh yeah ik
a database isnt it called?
not just a database
but yes, it requires a database
that's like me saying that we need a car, and you saying "oh, yeah, tyres and rims"
it's an integral part that you will need, but isn't all
oh sorry
i didnt realise
i thought thats all a server was
the database
you need to do some reading on how webdevelopment works, dude
i change my mind, you will need 3-4 months
asking us to rehash something there's a thousand excellent youtube videos and articles on isn't cool
😂
you said you know python, so, i though you were familiar with backend development
find a roadmap, read the site I linked you, google "how to build a full stack web application", read up on the difference between frontend and backend development, then go from there
Yeah idk whats up with me i do like a few days of web dev then disapear for months then come bak
i cant commit to anything
because you're trying to do too much
you will not be able to learn this without more commitment than that
baby steps, learn the basics, do something simple
my bad
do what jochem said, and learn javascript first
backend will be a whole can of worms ...
i hate backend
but i gotta learn it
you know python, don't you?
not everything but yk
i was meant to be doing all the front end on this website
and the other dude was meant to do the backend
but hes not replying to me
and its been a day
so yk
a day?
but you need javascript, unless you skip all the interactivity and just do everything server-side
yeah
you realize people have lives, right?
also, a day isn't that long
yeah
my bad
i might just work on the settings
and have a light and dark mode
i bet that requires a server aswell
you will need javascript for that
lmao
and depends on how the settings work, you need backend as well
so, just learn javascript until "the dude" answers
ok then
cheers
you can try this again when you have a proper grasp on javascript's basic concepts
ok