DEV Community

Cover image for FullStack - How to create a working blogging website with pure HTML, CSS and JS in 2021.

FullStack - How to create a working blogging website with pure HTML, CSS and JS in 2021.

Modern Web on August 13, 2021

Hello, Today we'll see, how we can easily create a blogging website using HTML, CSS and JS only. No other library. We'll also use Firebase firestor...
Collapse
 
ats1999 profile image
Rahul kumar

it would be more declarative if you change res.json("404"); with res.status(404).send("...");

github.com/kunaal438/blogging-site...

Collapse
 
themodernweb profile image
Modern Web

Yes actually we can change the status but this tutorial was not about "404" error that's why I left it.

Collapse
 
ats1999 profile image
Rahul kumar

It's a basics coding practice, which every developer should follow either for teaching or development.

Thread Thread
 
themodernweb profile image
Modern Web

Yes, I agree. I'll make sure to return status code also from the next time☺️

Collapse
 
booz profile image
bo-oz

Could you elaborate on how you would use such a set-up + firebase connection on a production blog? How would you control who can/can't publish blogs?

I like the simplicity of this set-up, but feel there's more to it before you can get an actual secure backend up and running.

Collapse
 
themodernweb profile image
Modern Web • Edited

Actually yes, it is a very basic blogging site I made this because on internet i couldn't find a working blogging website tutorial. And for the security I am working on some advance feature including login/logout, dashboard, edit post. If you don't want to miss that make sure to follow me☺️☺️

Collapse
 
booz profile image
bo-oz

Thanks! I already do, enjoy reading your articles.

Collapse
 
ats1999 profile image
Rahul kumar

Why are you doing date.getDate() + date.getTime() + file.name;

github.com/kunaal438/blogging-site...

Collapse
 
themodernweb profile image
Modern Web

Well, I am doing this to give a unique name to uploaded image for example if, user uploads an image "img.png" then the uploaded image on server side will have current date and time to make that image specific. Than the uploaded image maybe look like this. "1657381749img.png"

Collapse
 
ats1999 profile image
Rahul kumar • Edited

getTime() would be sufficient to give unique id, date.getDate() is unnecessary.

Because for any instance of time, both will be same.

Thread Thread
 
themodernweb profile image
Modern Web

I think getDate can give more uniqueness. And if we want to see specific date published images we can also filter it.

Thread Thread
 
ats1999 profile image
Rahul kumar • Edited

getTime() is same as getDate(), getTime() will return unix epoch time in milli seconds.

You can also see date from getTime ().

Advantage of getTime()":

  • sort by date because getTime () is just a number

  • sort by date range

  • smaller image name

  • etc...

Thread Thread
 
themodernweb profile image
Modern Web

Oh! My bad😅😅, I didn't knew about it. Thanks for telling 😄😄

Collapse
 
sondo13399 profile image
sondo13399

Hi,
I really like this tutorial.
However, I have some thoughts regarding the presentation and content of it.

First of all, I feel your video is straightforward and easy to follow. However, it would be better for you to thoroughly explain all the step you do, rather than just having loud electronic music.

Also, if you notice, the content of this article is not in the same flow with the video, so it is pretty hard to understand further what you do in the video by reading this article. I think one should sticks to either of these.

And unfortunately, the version of Firestore I use during development is 9.0.0 (which is different than the one here) and it does not work. So I had to manually edit the version number to the one of yours, and it magically works. If you know why that is, I hope you can help.

Anyway, the tutorial is amazing and easy to understand. Will take a look at your advanced features video soon.

Keep it up!

Collapse
 
themodernweb profile image
Modern Web

Hi, I am glad you followed the tutorial. Thanks for your feedback. I am improving my tutorial quality and always will. As you said it is hard to follow the tutorial because of no explanation. That's why I am making all tutorials with voice now. And I just uploaded the advance feature tutorial. If you want you can checkout it

Thanks

Collapse
 
arvindpdmn profile image
Arvind Padmanabhan

Video tutorial doesn't add any value. You should explain the steps rather than playing random background music. This blog article is more useful, although the entire project on GitHub even more useful. Thanks.
For those who wish to understand fullstack, see devopedia.org/full-stack-developer

Collapse
 
themodernweb profile image
Modern Web

I am sorry for this. I'll try my best to explain everything from next time☺️

Collapse
 
cblte profile image
cblte

Thank you very much for this long introduction. What I do like is the step by step procedure. Well written and maybe easy to setup. Hav not tested it but fully read because I am writing my own small blog engine in golang currently. What I do not like is the use of Google. It’s a good project but does not respect privacy and totally misses the GDPR consent while using third party products.

Collapse
 
midouwebdev profile image
MidouWebDev

I was looking for this, thank you

Collapse
 
themodernweb profile image
Modern Web

Glad to here that☺️☺️

Collapse
 
charkinsdevelopment profile image
Cory Harkins

Super cool.

This was my first experience using firebase and it is surprisingly easy.
Thanks for the tut.

Collapse
 
themodernweb profile image
Modern Web

Glad to here that.☺️☺️

Collapse
 
ashutosh_singh_a8020f7371 profile image
Ashutosh Singh

This blog post was interesting. Additionally what I felt is as we try to code it helps better to understand as well. We can try coding thecodeground.io and try it live which is much more fun that saving in file and refreshing the browser each time.

Collapse
 
daleakinpelu profile image
Boladale Akinpelu

Thank you for the tutorial, it was very helpful, however I was wondering how I could incoporate TailwindCSS instead of Vanilla CSS. I tried it, however it was not working. any help I could get would be greatly appreciated

Collapse
 
jefersoncf profile image
Jeferson Ferreira

Muito bom cara 👏👏

Collapse
 
themodernweb profile image
Modern Web

Thanks ☺️

Collapse
 
martincomito profile image
Martín Comito

AWESOME work, thanks for sharing!

Collapse
 
themodernweb profile image
Modern Web

Glad you liked it

Collapse
 
ayushkush1 profile image
Webby Ayush • Edited

bro your publish button is not working through some error . I couldn't find please tell what to do.
Please
Image description

Collapse
 
elitesky profile image
Adrian Borja

i like the topic of the tutorial. just curious though how you handled the SEO side of this, can you help to share it as well?

Collapse
 
francesco_mollica_5c61d27 profile image
Francesco Mollica

PUBLISH button doesnt work!

Collapse
 
taofeekajibade profile image
Taofeek Ajibade

Thank you so much. It came just in time.

Collapse
 
kokaneka profile image
kapeel kokane

Hey, if I understood that correctly, the images are getting stored in local directory and the blogs on firebase, correct?

Collapse
 
themodernweb profile image
Modern Web

Yeah images are getting stored in local directory but when you host this site on server, images will be store on server and their path will be store on firebase ☺️

Collapse
 
themodernweb profile image
Modern Web

Did you changed "/editor" route or the folder structure. Kindly message me on my instagram

Collapse
 
ats1999 profile image
Rahul kumar

It would be batter, if you can deploye this somewhere and share the link.

Collapse
 
themodernweb profile image
Modern Web • Edited

Thanks for the suggestion, I'll try next time☺️☺️

Some comments have been hidden by the post's author - find out more