#i need help in resources

1 messages · Page 1 of 1 (latest)

lunar stump
#

i am a reall beginner and im making a website using html javascript and mongodb

i made the html pages and made the database but i don’t know how to connect them together

i searched and saw that maybe i have to use node.js and maybe also something called JSON? i tried some articles but its so ambiguous and confusing

i would appreciate it if anyone have a website example with comments or youtube resources or any advice🙏

thin roostBOT
#

<@&987246883653156906> please have a look, thanks.

thin roostBOT
#

@lunar stump

Java and JavaScript are two completely unrelated programming languages.
https://i.imgur.com/yYFdXet.png

willow sail
# lunar stump i am a reall beginner and im making a website using html javascript and mongodb ...

Learn to build full-stack web applications using MongoDB, Express.js, React, and Node.js, AKA the MERN stack. This course will guide you through setting up your development environment and creating dynamic, responsive applications from scratch. You'll gain hands-on experience in building RESTful APIs, managing databases, and developing interacti...

▶ Play video
#

But as a beginner I'd perhaps recommend learning the elementary concepts first ^^

lunar stump
lunar stump
thin tangle
#

its just creating an inevitable nightmare for them and us

#

i can basically set a timer for the CORS issues

willow sail
#

If you have another suggestion or reply to OP then you should add that uwu

thin tangle
thin tangle
#

can you share what you have so far?

steel hollow
lunar stump
#

i am done with html css and the database

thin tangle
#

i assume at this point they are just html files

#

but i also want to caution you: that is a lot of html, including form tags and other stuff that I'm surprised you know about

#

so surprised, in fact, I question whether you are the one who wrote that html

#

if it is the case that you used an AI to make it, you need to stop now

#

using AI during learning will lead to some horrible outcomes

#

its like a voluntary lobotomy

#

if you didn't and this is just bootstrap + a tutorial, alright

lunar stump
lunar stump
thin tangle
thin tangle
#

essentially you didn't have much opportunity for reinforcement - you just monkey see monkey do for an hour and then....

#

well then you have exactly what the video produced

#

but mostly not the practical skills you'd hope for that would let you do something similar

#

we get some people who go real slow, take notes, and do a lot of practice

#

but thats the exception rather than the rule

lunar stump
#

not true he explained basics and have some small projects i only used what i needed and skipped a lot

#

you should check him out he is very helpful

thin tangle
#

so you understand what the <form> tag does?

thin tangle
#

this is a Java server, so we don't often get people who are trying to learn JavaScript from him (or html, whatever the guide was)

#

(Java and JavaScript are different beasts)

#

but its very common for people to go through his Java course and not understand much

#

if its working for you thats fine

#

just my standard warnings

lunar stump
#

i learned java sql html and mongodb from him now im learning javascript now

thin tangle
#

so lets just stick on one thing for a moment

#

here

#

you wrote <form

#

why, what does this do

lunar stump
#

cuz im collecting input from the user and i wanted to force all data input

thin tangle
#

that is not what it does

#

<form> makes it so that you can group these inputs and send them to a server when someone submits the form

#

so when someone clicks the submit button - usually made with <input type="submit" - your web browser will make a request to the url under action=

#

so in this case it will fetch analytics.html with a GET request

#

and it will pass the form data as "query params" in that request

#

so it will make a request like GET analytics.html?email=...&password=...

#

which a server could then interpret to do things

#

like log someone in'

#

now it is an issue that &password=... is going to be in your users' history

#

actually a pretty big issue

#

which is why people usually use method="POST" on a form

#

since that will put the data in the "body" of the http request the browser sends

#

i've referenced http requests a few times, basically

#

a request looks like this

#

literally a block of text/bytes that reads

#
POST /whatever ...
<headers>

<data>
#

that top line is saved in your browser's history

#

the rest is not

#

http servers do nothing but handle http requests and produce http responses

#

http responses are similar...

#

(and do you see why i get frustrated with the brocode approach?)

#

now what <form> does, how it does it, etc. should give you a good hint as to how to handle form submits

#

you need an http server of your own running

#

and you need to be able to inspect the incoming request, see the data submitted, and send html back to your client based on what you do

#

there is a lot more to get into w.r.t. authentication, but lets save that

#

in this whole scheme databases are just "persistent storage"

#

i.e. they let you remember stuff even if the computer turns off and on again

#

you kinda don't need to do that yet

#

and once you do we need to talk more holistically about persistence

#

because most of the world runs on SQL databases and you kinda need to understand that model

#

not just because "thats what jobs are in" but because the relational model - storing data in a "normalized" form - is at the core of how to think about persistence

#

mongodb is an especially bad place to start with that

#

part of the reason you even know about it is that in the 2010s the company behind mongodb got a lot of money. enough money to market their database as if it was the best thing ever, where it is useful in maybe 1% of situations

#

now you will be told things that are just straight up not true like "its flexible. something something json" and its frustrating

#

because you don't have any antibodies. you don't understand this stuff yet, nobody has taught you

#

i made the html pages and made the database but i don’t know how to connect them together

i searched and saw that maybe i have to use node.js and maybe also something called JSON? i tried some articles but its so ambiguous and confusing
So the answer to this question - the easiest one - is that you need to make an http server than handles form submits and renders your html

#

during the handling of the form submits or rendering of html you can make queries of or writes to your database

#

explaining JSON isn't hard, but explaining the context in which it is used requires some prerequisites

#

you can make that http server in basically any language

#

including javascript

lunar stump