Gatsby-source-hiveJS plugin Development #2

in #leofinance4 years ago

Well it looks like things are going smoothly so far. What have I done so far?

  1. Break the rules about posting just on a testnet before going live...

Nah man c'mon I was asking you about the plugin, which is the whole point we are doing this in order to start publishing and maintain our hive/leo finance blogs...right?

Yeah you are right Alter....btw alter is my alter "ego"..always making shine the best of me...

Gatsbyjs - what?

mmm, saturn are you talking about this? check this image:

img

what? no Alter I am talking about GatsbyJS a javascript framework to create web apps...

Gatsbyjs simple explained...as possible

At this point we all, or at least a vast majority should know what a web page looks like. Not only graphically speaking but also the skeleton, the parts, the soul...

This inspire some cheap poetry "Oh dear web page, inside of your heart made of simple text, there is a soul looking to be founded"...

OK. Let me continue and go play very deep in my brain with something else Alter. This is serious matters. As i was saying, the core handler of a website is the browser. Firefox, (hopefully) the dead internet explorer, opera, chrome, are just some examples of a program who handle the code of a website and shows you a nice image of a puppy. Just like this one...

img
Oh..So cute!

Basically a lot of things are happening behind scenes when we open a website.

I know I know...Alexa is listening, google is getting data and instagram is ******ing us all very hard while stealing our data :D

Yes Alter we could say those are some of the things happening in your brain...I mean behind the scenes.

Dynamic or Static, that's the question

A dynamic site will handle, process and show you data that can change. For example:

  • Netflix
  • Amazon

An many many more. On the other hand we have static sites. As this amazing blog right here which very soon will guide users on how to publish and make nice posts on hive & leofinance. This blog shows us data that is being held in a place as static data. A static site will use data from somewhere(a database, a CMS, a text file) and it will bring that data up, when the user aski for it, thanks to the web browser.

A think this is going to be a serie of posts

Yep, this is too long to talk about in just one post. So let's cut the chase and for now, no more web development talk. Just about the plugin.

Where Am I and where Am heading to?

I am alone in the dark, chasing shadows...chasing shadows. The sea is like...

Alter please stay....Good boy stay!

To make this story short. Gatsby as a framework to build static & dynamic sites, allows you to build plugins in order to achieve something. Let's say you need to bring some data from Hive/leofinance "database"(other devs are looking at me with some anger because I am reducing a splending piece of work called Blockchain/API to a simple database). Well you can create your own plugin to handle that while your website/app remains doing many other things. This is the whole idea of this plugin.

codingdefined work

Thanks to him I can continue the work. Basically he gave a nice place to start and also some challenges to keep up. So far the plugin can:

  • Connect your gatsby app to the hive API and request the amount of posts you want to show.
  • Implement grapqhql in order to handle the data in an easy way.
  • Create a node image to use as coverImage for each post.
  • Pagination as the user's plugin defines it. "Just 10 posts per page" and so on.

What's the benefit on that?

Basically by using graphql we can handle data from the api in a easy way and also create the posts locally so we can show them fast.

What your Gatsby app can do so far

  • Publish to the mainNet of hive, which I do not recommend to do. If you can, test first on a testnode.
  • Visualise all the posts per user's request.

Nice way to break the rules huh?

what's coming?

  • Implement the posting feature inside the plugin so the user besides see the posts locally, can publish them.
  • Insert the plugin + all this code inside my blog. Saturnoman.com
  • Keep having some crazy ideas in order to create a nice plugin that can be used by many people.
PS: i am done for today...to many hours at the PC.

A peaceful image just to relax your eyes after so much talking and writing and thinking...

img

Posted using my gatsby-source-hivejs wannabe plugin

Sort:  

My greatest replay ever.!