Adding and Retrieving Data Into/From Blockchain via Web Interfaces - blockchain

I am starting to learn developing web interfaces that can add and retrieve data via blockchain. The data is not in the form of cryptocurrency but rather in something like name and ID number.
I have also learnt about metamask, ganache, web3, truffle, javascript, html, css, node.js, solidity, smart contract and json...but I am not sure how to link all of them for adding and retrieving data via blockchain. I have done some googles and youtube, but unfortunately, I could only understand a few of them. Can you help me in explaining the interactions between blockchain and web interfaces to adding and retrieving data, and how to achieve it?

Web3 is used for all the purposes you've described above. Once you've retrieved the data, you can store it in a variable and use it in your frontend applications as well.
Here's a reference diagram : Link

If you are too lazy to read documentation, here are a series of good examples. They were very helpful tutorials for me.

Related

I've been trying to implement a DApp browser, but can't understand how the Mobile application is able to communicate with the browser

I'm currently learning different building blocks of blockchain and the different services, applications that currently exist. In a lot of wallet applications, I've seen them implement a DApp Browser, which lets their mobile app directly communicate with the DApp without the need to leave their application.
I understand how they show DApps on their homepage, but the main doubts I have are surrounding how the application communicates with the browser.
I've been going through Metamask's mobile application github repository to understand the flow. They included a diagram too on how the architecture but it has been overwhelming to jump into for the most part. Although I've got a bit of an idea of the flow, the main question of how the browser and application interacts is still not clear.
If there's any article, or if you have an idea I'd appreciate the help.
The Metamask documentation can be found here: https://docs.metamask.io/
Frequently, a wrapper is used, such as onboard.js (https://docs.blocknative.com/onboard) or web3modal (https://web3modal.com/), which allows for non-injected wallets to be connected. Personally, I prefer the UI of onboard.js, but plenty of people use both. I highly recommend you use one of them.
Finally, typically one doesn't interact with the window.ethereum provider directly. A library such as ethers.js (https://docs.ethers.io/v5/) or web3.js (https://web3js.readthedocs.io/en/v1.7.4/) makes writing DApps a lot easier. I personally prefer ethers.js as it is more strongly typed, but again, both are very commonly used.

good use case of HATEOAS

may I have some example/typical use case of HATEOAS? I agree it can be a very powerful concept provide great flexibility but I am not sure how to properly get benefit from HATEOAS. would be great if you can share your experience/use case.
A good answer from #dreamer above, but HATEOAS is not present in most REST-based services. It is a constraint on the REST architecture style that allows clients to interact with a service entirely via the hypermedia contained in the resources.
If you look at the Twitter or Facebook REST APIs, you won't find hypermedia. Look at the Facebook friendlist resource. There are no hypertext links in that resource that you can use to transition the state of the resource - to delete, update, etc. Instead, you need to read the out-of-band documentation to understand what you need to do to delete that resource.
One of the claimed advantages of using hypermedia in your APIs is that you can manage change within the resources themselves. For example, what if Facebook wanted to add additional functionality to the frendlist? If it were built with HATEOAS in mind, the resource would be updated to add the hyperlinks provides those additional state transitions.
If this sounds difficult, you're right. But as a developer of client applications, however, once you understand how the hypermedia is presented, you can build applications that will evolve along with the API itself.
So how do you build APIs using HATEOAS? A number of options are out there, but I like the Hypertext Application Language (HAL) the best.
UPDATE: Since you asked for an example, here's a link to a demo using HAL.
Good public HATEOAS use cases are hard to find, because there are a lot of misconceptions around REST, and HATEOAS can be hard to implement. You really need to have a good understanding of its benefits, before you're willing to put yourself through the trouble of getting it to work, and if the clients don't follow it correctly, all work will be in vain.
From my experience, implementing proper REST in a company is a culture change as important as moving to version control systems or agile development. Unless everyone adopts it and understands it, it causes more trouble than it solves.
Having that in mind, I think the best example one will find is the foxycart.com HAL API, on the link below:
https://api-sandbox.foxycart.com/hal-browser/hal_browser.html#/
It's very powerful concept used in RESTful presentation of the application to the client. There are many many projects which are adopting this interface now. A typical use case for this is Web Services APIs using RESTful APIs. A RESTful APIs typically consists of the following elements:
base URI, such as http://example.com/resources/
an Internet media type for the data. This is often JSON but can be any other valid Internet media type (e.g. XML, Atom, microformats, images, etc.)
standard HTTP methods (e.g., GET, PUT, POST, or DELETE)
hypertext links to reference state
hypertext links to reference related resources
The application state can be modified using above HTTP methods for example, to get a particular resource, A client can issue a REST query using curl like:
curl -X GET --url "http://example.com/resource/" -X "Content-Type:application/json"
you could go through the man pages for curl and its usage. More on RESTful interface concepts can be looked upon at wiki

Retrieving data from Facebook graph API using F#

I have been using C# with the Newtonsoft.Json library to collect data from Facebook. This is working reasonably well for me, but now I would like to see if I can do something similar with F# instead of C#.
I note that F# 3.0 (now in beta) has support for type providers, which have the potential to make access to loosely structured data like Facebook much easier.
Does anyone know of an F# sample showing how to get Facebook data?
Since you mentioned type providers: FSharpx has a JSON type provider, but I think it currently works with local files only, not with a JSON fetched from a HTTP request. You're welcome to join the project and help us with this!

Can I use restful as website data service?

90% information in website are static and updated by daily batch job. I am wondering I could use restful services for multi websites? If only 10% information is static, should I use it as well? Dose any body has used restful as data services for public website? My main website 's page view is round 10k/hour.
Thanks
Can you provide a little bit more information? I'm finding it hard to understand what you're asking here.
If you have any kind of structured data that you want to provide to external websites, REST is certainly a quick and easy way to do this.
If you know that the information changes only once a day, you could be caching the results of the REST GET requests on the external websites.

How to extend a website?

This is quite a concept idea. I would like to create a website that can be extend by different programmer a bit "a la facebook"
Let's me explain i want to develop a very simple core application that for example would store images and i want to develop or allow external developer to develop web app that would be able to act on the image i can take this example of an OS that would store files and you can "install" different program for example to view the files or edit.
How can i reproduce the model in the Web / cloud plateform using API ?
I hope this question make sense to any body.
Thank you by advance
Web Services. Try looking up REST and SOAP.
The Semantic Web is trying to solve this by publishing structured data with common ontologies.
See this example, describing the user's photos as RDF, using the FOAF ontology:
http://www.semanticoverflow.com/questions/201/describing-in-a-foaf-file-assets-of-a-user-photo-album-video-album-etc
The Semantic Overflow website is an excelent resource to find out more about the semantic web in general, and how creating webservices that use a common set of interfaces can allow a greater reach, because tools don't have to be specific to a website.