Getting started with Hive app development

avatar
(Edited)

image.png

I've been asked quite a few times lately on how to get started developing on Hive. So here yo go, here's a brief intro to get your started.

First off, this guide is for people who want to build an application or game on Hive and not intentended to those who want to do blockchain level development.

The majority of apps and games built on Hive use Javascript or Python. I will briefly describe both of them and how to get started.


Javascript

Javascript is a very popular language and primarily the only language you will use in a browser. Even if you choose to go the Python route, you will likely need to know some Javascript if you want to build a user interface (UI) to your application or game.

There are primarily two directions you can go in with Javascript, NodeJS for backend development and scripting and Javascript for front end development, usually using a framework.

If you want to build an application that works in a browser you will likely want to use React or VueJS web frameworks.

Javascript is more difficult and verbose than Python but specializes in asyncronous code, code that runs while your main code continues running. Asyncronous coding is a lot more complicated to code and understand but potentially can create faster code.

Javascript traditionally executes a lot faster than Python but many Python libraries have been built in C to make up for this.

If you want to learn Javascript, I recommend checking out this 2 hour crash course. If you want a little slower pace, check out this 7 hour course.

You will most likely need NodeJS to start using Javascript even if you plan on only doing front end development. Instead of downloading NodeJS directly, I recommend you use node version manager to install the latest version of node nvm. This will allow you to easily switch versions and upgrade your install of NodeJS.

If you want to do front end development, I would recommend VueJS, but many older apps on Hive are done in React, most of the newer ones have moved to VueJS.

To work with the Hive blockchain in Javascript you will need to use HiveJS, there are other libraries for Hive in Javascript but HiveJS is the most supported and maintained.


Python

Python is considered the most popular language in the world and is considerably easier to work with than Javascript. If you are going to do front end development your choices are limited with Python, although there is Django, you will still need Javascript for some parts of your site.

Python is easy to learn and is what I would recommend to most people (especially children) to learn first. Python while easy to use is extremely powerful and has an amazing collection of packages that support it. In fact, nothing touches Python for working with data science and machine learning. While Python is considered "slow", speed rarely becomes a problem in most applications, and packages that require better performance likely have been written in C to greatly improve the performance to be even faster than NodeJS.

If you want to do anything with Machine Learning or Deep Learning, Python without a doubt is your first choice.

If you want to build a web application or game with Python, I recommend checking out Django. You will still need to learn Javascript for some interaction and layout development. Django is a very powerful framework for development applications but you still can use a web framework like VueJS while using Django.

If you want to build an API for the backend of your application, have a look at Flask which is similar to Django but much simplier and ideal for building API interfaces.

To learn Python, I recommend this 1 hour crash course or a slower paced course like this 5 hour Learn Python Course.

To work with Hive in Python, you will want to use Beem, it is the most supported and maintained Python Hive library. Beem while doesn't get maintained as much these days, is the best library on the Hive blockchain as it includes many helper functions that do a lot of the leg work.


It is not uncommon to use Javascript for your front end development and use Python for your backend development or even just for some scripts that work with your existing backend. There is no harm learning either of these languages and neither is the wrong choice.

With all new developers, I recommend learning the language you want to use and then do a few tutorials. I don't recommend spending too much time doing tutorials as you will end up in tutorial hell where you just do tutorials but have no idea how to build something. As soon as you possible can, think of a project to build and build it. If you need to, break it down into smaller pieces. All good developers will break larger problems down to smaller components.

If you have any questions on your journey, check out HiveDevs Discord where you will find other developers at various skill levels that may be able to help you. Also check out Stackoverflow if you have a question you cannot solve.

Always try to solve your own problems, that is the only way you will learn but if you find you are wasting a lot of your time, seek help. Just remember to phrase your question in a way that most directly relates to your problem and always try to minimize the code you provide as an example to the smallest amount of code to represent your problem. No one wants to dig through your application to find the problem you are running into.

I highly recommend using VS Code as your editor. It is the only thing Microsoft has done right in the last 10 years and is an amazing free editor which will save you hundreds if not thousands of hours of work in your development career.

Posted with STEMGeeks



0
0
0.000
53 comments
avatar

Nice. I'm improving my noejs Skills and who know a hive bs new game pops out

0
0
0.000
avatar

a lot of knowledge thanks mate

0
0
0.000
avatar

When you begin exploring Hive, the first thing that comes to mind is how to build an application with it. After all, there are a lot of things for you to consider before you get started on creating a product. In this article, we'll go over what it takes to get up and running quickly with Hive app development. You can get PureWL help to solve your vpn issue easily. Hive is a web app framework built on top of Django. It provides simple tools to build and run HTML5 apps using Python and Django, making it easy to get started with developing your first app in minutes without having to write any code.

0
0
0.000
avatar
(Edited)

A lil' heads up for others ( like me ) who are really bad with backend stuff ... you don't really need nodejs for make a front-end/website for hive ... client-side works perfectly fine !

0
0
0.000
avatar

If one chooses Javascript, I highly recommend to use Typescript.

0
0
0.000
avatar

I tried to give it a go, and it still feels a bit weird as compared to a native statically typed language(plus I can mix JS in between whenever I want?), any advice advice on how to make the typescript experience a bit better?

0
0
0.000
avatar

Typescript is Javascript + types, so the code itself is Javascript and you have an additional syntax for declaring types. It's also recommended to add ESLint into the mix.

For example this JS code:
https://gist.github.com/quochuy/01d9e0f7cd56797b85e531ee984975ef

Would be come this in Typescript:
https://gist.github.com/quochuy/328a0e93005dabf0d015819bc9c13840


Or this in JS:
https://gist.github.com/quochuy/42c980e74e5c80a6a94548f282688560

Becomes this in TS:
https://gist.github.com/quochuy/5b95ba862fb6dc5d534b0c8a1c0658af

0
0
0.000
avatar

You will spend more time at the beginning but the learning curve is worth it.
Typescript + Eslint makes you a better developer I reckon. Forces you to code cleanly following standards so it's easier for someone else to join in later on or even for you to revisit old codes. As for Typescripts it will help reducing silly bugs such as passing the wrong parameter to a function or sending incomplete object to a method.

Everything becomes stricter, which can be annoying but in the long run you'll discover their usefulness.

0
0
0.000
avatar

thanks for sharing. I'm planning to develop more games on Hive blockchain

0
0
0.000
avatar

I've been contemplating developing some things on Hive mainly for educational purposes so this is a great starting point. Thanks for sharing

0
0
0.000
avatar

I like it.

That is the content we need. Build our own devs on hive.

Would be really awesome if you build an dapp step by step. With the basic shit that needs to be done.

0
0
0.000
avatar

Thank you! I’ve been looking for more and more info on this stuff.

0
0
0.000
avatar

The amount of work put into hive’s eco system is really impressive. Proud to be here

0
0
0.000
avatar

I've very recently finally managed to contribute a little bit of code to hive, or at least one of the tools used by witnesses anyways. :D

I really need to refresh my skills with Javascript, But I'm also thinking I should get in on python as they both have their uses.


Communities I run: Gridcoin (GRC)(PeakD) / Gridcoin (GRC) (hive.blog)| Fish Keepers (PeakD) / Fish Keepers (hive.blog)
Check out my gaming stream on VIMM.TV | Vote for me as a Hive witness! and Hive-engine witness!

0
0
0.000
avatar

excellent post friend actually touched informative points that is within the reach of the knowledge of many and good necessary to start thanks

0
0
0.000
avatar

Python is really easy to learn and understand compared to JavaScript, cz c++ etc.

I'm when it comes to web design it not so easy, tho I'm just started learning Django tho. Because HTML and CSS is better for web site front end.

0
0
0.000
avatar
(Edited)

Good point on keeping node and npm updated. When I started messing with java script apps I mistakenly installed an old version of node. And it caused all kinds of problems. Once I updated to the current stable version all of the problems were gone. So always check your node version and use nvm to update if needed.

0
0
0.000
avatar

Sometimes upgrading to latest version causes problems as well. This is why many apps freeze versions of packages and test upgrading them as a single commit.

0
0
0.000
avatar

Ah yeah, I tend to follow whatever version the dev says their app runs on when I can.

0
0
0.000
avatar

Great overview and recommendations! Thanks for the links.

0
0
0.000
avatar

A few questions for you @themarkymark...

  1. What do you think of LightHive? For some reason, when I have used Beem for posting, I have experienced issues. LightHive, I have had no issues with it. LightHive is a Python module/library.

  2. If I wanted to build a non-blogging platform with exclusivity and an associated side-chain token (like a forum) would I be able to do so?

  3. I'm blacklisted by a certain someone who has given themselves too much authority and opened the door for abuse, would their harassment bots follow me into this more exclusive non-blogging app I'm creating?

  4. Just so it is 100% clear to me, I would self-host the app and connect to the Hive Blockchain API? I can literally have it hosted wherever I want, correct?

0
0
0.000
avatar
  1. I am familiar, I believe it was forked off beem. I have no issues posting from beem. It is likely user error.

  2. I would think so, others have (minus the token part).

  3. if it uses rewards on the base layer (hive) then yes, potentially

  4. yes

0
0
0.000
avatar

Excellent, that's good to know. I wanted to know about these things before I planned the build and started coding this thing.

Very possible the Beem issues are on me!

0
0
0.000
avatar

I highly recommend Codium over VS Code. It is the same application, except with all of the telemetry (report home to Micro$oft) removed.

0
0
0.000
avatar

There was a reason I don't use this, I think certain modules don't work with this version. I can't remember off hand.

0
0
0.000
avatar

There shouldn't be any reason that modules / addons don't work with it as it is exactly the same code base minus telemetry.

Every addon I've used so far works just fine.

0
0
0.000
avatar

You can disable telemetry in the settings, just comfirmed mine is off. Although I am not too concerned with what is sent (it's all open source so you can confirm what is sent) and in fact it maybe good to run it as it helps them know what modules are most popular and where problems lie.

0
0
0.000
avatar

Naaa... I'll stick to Codium. I like it, works very well for me. 😀

0
0
0.000
avatar
(Edited)

Are there any Node.js / Javascript libraries available for Hive development?

Edit: I might have answered my own question.

https://gitlab.syncad.com/hive/hive-js

0
0
0.000
avatar

There is HiveJS and DHive. Dhive was better, but isn't maintained so most people use HiveJS.

0
0
0.000
avatar

Cheers, I was looking at those, but neither seem to make much or any reference to the internal market. Or have I overlooked something?

Is there perhaps any documentation for API endpoints for the market?

0
0
0.000
avatar

Hive internal market or Hive Engine?

0
0
0.000
avatar
(Edited)

I've only used the internal market, so I was referring to that one.

Hive Engine is for all of the other tokens built on Hive correct?

0
0
0.000
avatar

Hive Engine is for all of the other tokens built on Hive correct?

yes

0
0
0.000
avatar

What made DHive better than HiveJS?

0
0
0.000
avatar

It had more functionality and was structured more professionally. I would recommend comparing the documentation and you will clearly see what I mean.

0
0
0.000
avatar

OK it hasn't been updated in a while, how has it fallen behind Hive.js or is out of date?
Has there been much change to the Hive API?

0
0
0.000
avatar

Almost all the Hive libraries are not really maintained much, except when there is a hard fork and there is an emergency update, someone will usually dig in and figure out what needs to be fixed.

0
0
0.000
avatar

Thanks for the clarification.

0
0
0.000
avatar

Excelent post. I am exploring this new ecosystem and I want to contribute code. This post is a great place to start.

0
0
0.000
avatar

Best piece of advice I see here and can give myself, don't get into tutorial hell. You will learn more with one real project that with 100 tutorials

0
0
0.000