DEV Community

Atharv Redij
Atharv Redij

Posted on

How to add blogs to react website?

Hello everyone. My friend recently asked me if I can develop a website for her. She is a doctor. So she wanted a website with her details, qualification, contact info, etc. I have built this website using react and hosted it on netlify.

She has requested me to add blogging functionality to this site. I don't know much about adding blogs to react.

Do you guys know how can I add blogging to her website? Is there any external API or npm package I can use to add blogging support. My goal here is to add blogging with minimal effort and not build a blogging platform from scratch. Any help would be appreciated.

Top comments (10)

Collapse
 
andrewbaisden profile image
Andrew Baisden • Edited

You could try Hashnode or Ghost.

freecodecamp.org/news/devblog-laun...

ghost.org/

Collapse
 
tris909 profile image
Tran Minh Tri

It really depends on what websites she uses to create blogs. Let's say I have created my blogs on these websites. This websites has an API where I can call and fetch blogs under JSON type. But If she wants you to build a custom one. You have to connect it to a server / databases where you can store the blog and at the same time build a page where she can add a blog manually.

The best solutions should be tell here to create blogs on a platform that allow you to fetch her blogs under JSON types and render it rather than create that whole new features because believe me. It's really hard to do it properly from end to end.

Collapse
 
atharvredij profile image
Atharv Redij

Earlier she used write on Facebook (I know it is not a blogging platform). She requested if there was a way that she can write blogs directly on this website I created.

Collapse
 
tris909 profile image
Tran Minh Tri • Edited

If you used the word "directly". Then there are things you need :

  • Server / Databases use to call API related to blogs section and store your blogs as well as images. This server needs to store a list of images for each blog so I suggest you thinking before hand the architecture of your blogs in your databases.

  • Adding ckeditor.com/ (text editor) to allow her to create different kind of text (bold/size/...) in a single blog

  • Giving her ability to add images to a blog by storing each image she add into the blogs (data-type) and save the image into a folder stored in your server

  • Render blogs / Edit Blogs using the same text-editor above and delete blogs.

  • When you delete blogs, remember to delete all the images related to it in the images folder if you have one.

Thread Thread
 
atharvredij profile image
Atharv Redij

Yeah. I know there will be a lot of work to directly integrate blogging into the website, that is why I was asking if there is a easy way to do this. But thanks anyway

Collapse
 
karthik2265 profile image
Karhik Suryadevara

You could try mongoose for storing the data i.e blog title and blog body and use ejs(mom package) to store images, videos etc in the blog body of the data and render it to the html

Collapse
 
andrewbaisden profile image
Andrew Baisden

Yes essentially he would need to create a CRUD back-end. Check out my guide it can be adapted and turned into a blog. You would just need to add dates, a way to filter and sort etc... Creating MERN Stack Applications (2020)

Collapse
 
karthik2265 profile image
Karhik Suryadevara

yes, nice post

Collapse
 
afrndofu profile image
abโ‚•แตขโ‚›โ‚•โ‚‘โ‚–

Try Sanity IO, you will find many suggestions. All holds good and valid. But I used sanity in some of my projects. It's simple and Reliable and has easy to use interface.

Collapse
 
andikarekatias profile image
Andika Rekatias

Try netlify cms