<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged concept</title>
<link>https://coderlegion.com/tag/concept</link>
<description>Powered by Question2Answer</description>
<item>
<title>What is Web3?</title>
<link>https://coderlegion.com/3225/what-is-web3</link>
<description>&lt;p&gt;&lt;strong&gt;Web1 (1980’s - early 2000’s)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first phase of the Internet, Web1, was mainly about providing the everyday consumer with online content and information.&lt;/p&gt;
&lt;p&gt;As consumers could only read information or content online, and not yet interact with it, Web1 was incredibly static.&lt;/p&gt;
&lt;p&gt;When you think about Web1, think Internet Explorer, Yahoo, or Netscape. While web1 was read-only, the companies we associate with web1 were built on open protocols (meaning pretty much any person or organization could build on the internet and know they were subject to the same rules as the next person or organization).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is Web2?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Web2 is the version of the internet most of us know and use today. Where Web1 was static and “read-only,” Web2 is “read-write,” and interactive. Under Web2, the internet became more usable: Web2 was dynamic and users could consume, interact with, and create content on the internet themselves.&lt;/p&gt;
&lt;p&gt;Along the way, the internet became largely dominated by the four behemoths we know today as Apple, Amazon, Facebook, and Google. Web2 also saw an explosion in the use of smartphones, and most of internet use was through mobile apps and hardware built by these companies. While this meant more people could participate in the internet, it also meant the internet was becoming increasingly controlled by the leading digital platforms.&lt;/p&gt;
&lt;p&gt;Why is this a problem? In the centralized internet we know today, Apple can take a 30% cut on all paid-app downloads and in-app purchases, Twitter and Facebook can de-platform the President of the United States, and the everyday consumer has less privacy, security, and control over their online information than ever before.&lt;/p&gt;
&lt;p&gt;We also see a lot of data breaches happening all across Web2 leading to reduced security and privacy for one's personal data. When a user's data gets breached it's easy for them to become a victim of identity theft, personal attacks etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is Web3?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Web3, the future internet we’re moving towards, is a decentralized internet. Under Web3, the internet is shared online and governed by the collective “we,” rather than owned by centralized entities. The Web3 world is one that has open-source protocols at its foundation. Web3 is about rearchitecting internet services and products so that they benefit people rather than entities.&lt;/p&gt;
&lt;p&gt;Web3 enhances the web we know today by making it decentralized, distributed, open, trustless and permissionless.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is getting built such that everything would happen in a decentralized distributed way giving no central authority access to control the system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;‘&lt;em&gt;Open&lt;/em&gt;’ as it would be open sourced software built by an open and accessible community of developers and executed in full view of the world.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;‘&lt;em&gt;Trustless&lt;/em&gt;’ in that the network itself allows participants to interact publicly or privately without a trusted third party.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;‘&lt;em&gt;Permissionless&lt;/em&gt;’ in that anyone, both users and suppliers, can participate without authorization from a governing body.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Web1&lt;/em&gt;: Read &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Web2&lt;/em&gt;: Read-Write  ️&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Web3&lt;/em&gt;: Read-Write-Own  ️ &lt;/p&gt;
</description>
<category>Web Dev</category>
<guid isPermaLink="true">https://coderlegion.com/3225/what-is-web3</guid>
<pubDate>Wed, 18 Jun 2025 12:53:37 +0000</pubDate>
</item>
<item>
<title>REST API - A Refresher</title>
<link>https://coderlegion.com/3187/rest-api-a-refresher</link>
<description>&lt;h3 id=&quot;overview&quot;&gt;Overview&lt;/h3&gt;
&lt;p&gt;REST API is the HTTP interface following REST principles to manipulate resources. This quick refresher looks at some common concepts and its application in &lt;a rel=&quot;nofollow&quot; href=&quot;https://wiki.methodox.io/en/Divooka&quot;&gt;Divooka&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;1-why-you-should-care&quot;&gt;1. Why you should care&lt;/h3&gt;
&lt;p&gt;REST (REpresentational State Transfer) is the de-facto style for web services: roughly 8 out of 10 public APIs you’ll meet follow it, so mastering the basics lets you speak to almost any modern backend.(&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.integrate.io/blog/how-to-make-a-rest-api/?utm_source=chatgpt.com&quot; title=&quot;How to Make a REST API - Integrate.io&quot;&gt;Integrate.io&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id=&quot;2-rest-in-60-seconds&quot;&gt;2. REST in 60 seconds&lt;/h3&gt;
&lt;p&gt;A &lt;strong&gt;REST API&lt;/strong&gt; exposes &lt;em&gt;resources&lt;/em&gt; (nouns such as &lt;code&gt;/users/42&lt;/code&gt;) over plain HTTP. Clients use standard verbs to act on those resources:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Verb       &lt;/th&gt;&lt;th&gt;Typical intent       &lt;/th&gt;&lt;th&gt;Idempotent?&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;GET&lt;/strong&gt;    &lt;/td&gt;&lt;td&gt;Read                 &lt;/td&gt;&lt;td&gt;✔︎&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;POST&lt;/strong&gt;   &lt;/td&gt;&lt;td&gt;Create / adj. action &lt;/td&gt;&lt;td&gt;✖︎&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;PUT&lt;/strong&gt;    &lt;/td&gt;&lt;td&gt;Replace              &lt;/td&gt;&lt;td&gt;✔︎&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;PATCH&lt;/strong&gt;  &lt;/td&gt;&lt;td&gt;Partial update       &lt;/td&gt;&lt;td&gt;✖︎&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;DELETE&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;Remove               &lt;/td&gt;&lt;td&gt;✔︎&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;RESTful servers must also follow six architectural constraints (uniform interface, client-server, stateless, cacheable, layered, &lt;em&gt;code on demand&lt;/em&gt; optional).(&lt;a rel=&quot;nofollow&quot; href=&quot;https://restfulapi.net/?utm_source=chatgpt.com&quot; title=&quot;REST API Tutorial: What is REST?&quot;&gt;restfulapi.net&lt;/a&gt;, &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.integrate.io/blog/how-to-make-a-rest-api/?utm_source=chatgpt.com&quot; title=&quot;How to Make a REST API - Integrate.io&quot;&gt;Integrate.io&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id=&quot;3-common-response-codes&quot;&gt;3. Common response codes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;200 OK / 201 Created&lt;/strong&gt; – success&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;400 Bad Request&lt;/strong&gt; – client error (malformed JSON, missing fields)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;401/403 Unauthorized / Forbidden&lt;/strong&gt; – auth problems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;404 Not Found&lt;/strong&gt; – wrong URI or missing record&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;500+ Server errors&lt;/strong&gt; – bug, outage, etc.(&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.postman.com/rest-api-examples/?utm_source=chatgpt.com&quot; title=&quot;What Is a REST API? Examples, Uses &amp;amp; Challenges - Postman Blog&quot;&gt;Postman Blog&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;4-tiny-hello-world-example&quot;&gt;4. Tiny “Hello World” example&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-http&quot;&gt;GET https://api.example.com/items/123
Accept: application/json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Typical JSON reply:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;id&quot;: 123,
  &quot;name&quot;: &quot;Widget&quot;,
  &quot;price&quot;: 9.99
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;5-trying-rest-in-divooka&quot;&gt;5. Trying REST in &lt;strong&gt;Divooka&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Divooka lets you build the call as a &lt;strong&gt;node graph&lt;/strong&gt; instead of filling long forms:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Send (HTTP) Request&lt;/strong&gt; node – set &lt;strong&gt;GET&lt;/strong&gt; and URL &lt;code&gt;{{baseUrl}}/items/{{itemId}}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Headers&lt;/strong&gt; – drop a &lt;strong&gt;Custom Header&lt;/strong&gt; node for key:value pairs like &lt;code&gt;Accept: application/json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;(Optional) &lt;strong&gt;Auth node&lt;/strong&gt; – choose Basic, Bearer, or OAuth 2.0.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preview JSON&lt;/strong&gt; node to parse JSON payloads – pretty-prints and type-checks the body.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Everything is visual and reusable: connect the same response into further logic (save to DB, update UI, trigger another request) without writing glue code.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://publication.tor1.cdn.digitaloceanspaces.com/Websites/MethodoxWiki/Images/Divooka-AppDevelopment-APITesting_Usage.png&quot; alt=&quot;Usage screenshot&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can view more practical examples on the &lt;a rel=&quot;nofollow&quot; href=&quot;https://wiki.methodox.io/Divooka/AppDevelopment/APITesting&quot;&gt;Web API Testing&lt;/a&gt; page.&lt;/p&gt;
&lt;h4 id=&quot;environment-variables&quot;&gt;Environment variables&lt;/h4&gt;
&lt;p&gt;Define &lt;code&gt;baseUrl&lt;/code&gt;, &lt;code&gt;apiKey&lt;/code&gt;, or &lt;code&gt;authToken&lt;/code&gt; once in &lt;strong&gt;Environments&lt;/strong&gt; and reference them anywhere with &lt;strong&gt;Get Environment Variable&lt;/strong&gt; nodes. Switch environments (dev/staging/prod) using &lt;strong&gt;Switch&lt;/strong&gt; node.&lt;/p&gt;
&lt;h4 id=&quot;saving-amp-sharing&quot;&gt;Saving &amp;amp; Sharing&lt;/h4&gt;
&lt;p&gt;Save and group related requests into graphs as documents, so it can be easily reused and shared.&lt;/p&gt;
&lt;h3 id=&quot;6-best-practice-checklist&quot;&gt;6. Best-practice checklist&lt;/h3&gt;
&lt;p&gt;For designing your own REST APIs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keep URIs noun-based&lt;/strong&gt; (&lt;code&gt;/orders/17&lt;/code&gt;, not &lt;code&gt;/getOrder&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use correct verbs&lt;/strong&gt; (no &lt;code&gt;GET /deleteUser&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Surface pagination &amp;amp; filtering (&lt;code&gt;?page=2&amp;amp;limit=50&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Version in the path or header (&lt;code&gt;/v1/&lt;/code&gt;), never break existing clients.&lt;/li&gt;
&lt;li&gt;Secure with HTTPS, auth, and sensible rate limits.&lt;/li&gt;
&lt;li&gt;Document with &lt;strong&gt;OpenAPI&lt;/strong&gt;; Divooka can import the spec and scaffold nodes automatically.(&lt;a rel=&quot;nofollow&quot; href=&quot;https://idratherbewriting.com/learnapidoc/docapis_what_is_a_rest_api.html?utm_source=chatgpt.com&quot; title=&quot;What is a REST API? | I'd Rather Be Writing Blog and API doc course&quot;&gt;idratherbewriting.com&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;7-further-reading&quot;&gt;7. Further reading&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Usage documentation in &lt;a rel=&quot;nofollow&quot; href=&quot;https://wiki.methodox.io/Divooka/AppDevelopment/APITesting&quot;&gt;Divooka&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Roy Fielding’s &lt;a rel=&quot;nofollow&quot; href=&quot;https://ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf&quot;&gt;REST dissertation&lt;/a&gt; (the original source)&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.rfc-editor.org/rfc/rfc9110.html&quot;&gt;RFC 9110&lt;/a&gt; – HTTP Semantics&lt;/li&gt;
&lt;li&gt;Postman “REST API examples” blog for real-world patterns(&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.postman.com/rest-api-examples/?utm_source=chatgpt.com&quot; title=&quot;What Is a REST API? Examples, Uses &amp;amp; Challenges - Postman Blog&quot;&gt;Postman Blog&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Divooka Wiki → &lt;strong&gt;App Development &amp;gt; API Testing&lt;/strong&gt; (deep-dive on every node and feature)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;With these essentials you can explore any REST endpoint confidently - and wire it into your Divooka flows to suit your application needs.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Web Dev</category>
<guid isPermaLink="true">https://coderlegion.com/3187/rest-api-a-refresher</guid>
<pubDate>Mon, 02 Jun 2025 05:36:19 +0000</pubDate>
</item>
<item>
<title>What even is a blockchain?</title>
<link>https://coderlegion.com/3172/what-even-is-a-blockchain</link>
<description>&lt;p&gt;&lt;strong&gt;What even is a blockchain?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A blockchain is a distributed, digital, immutable ledger that is used to record transactions and store data in a secure and transparent manner. It is based on a decentralized network of nodes that collectively maintain a single source of truth, allowing participants to interact with the system without the need for intermediaries.&lt;/p&gt;
&lt;p&gt;A block is a container data structure that aggregates transactions for inclusion in the public ledger, the Blockchain. Each block in the chain contains a set of transactions that have been verified and recorded by the network of nodes through a process known as consensus. Once a block is added to the chain, it cannot be altered or deleted, creating an immutable record of all transactions on the network.&lt;/p&gt;
&lt;p&gt;Blockchains were popularized by the anonymous person (or group) Satoshi Nakamoto, when they released the Bitcoin Network in 2009. Bitcoin is a cryptocurrency network, and it handles primarily the transfer of the BTC asset across the network, without a trusted middleman or authority, while ensuring the network itself is secure and cannot be hacked. (P.S. The bitcoin network is also likely the biggest bug bounty in the world - if you can hack it, you're an instant trillionaire).&lt;/p&gt;
&lt;p&gt;Over time, this design of Bitcoin inspired other, more capable, blockchain networks to come out, like Ethereum. We will be learning a lot about Ethereum in the coming sessions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/VQySjQu.png&quot; alt=&quot;State Management&quot;&gt;&lt;/p&gt;
&lt;p&gt;Blockchains start off with a Genesis State when they launch. Bitcoin's genesis state happened in 2009 when the public network launched. Ethereum's Genesis State happened in 2015, when it launched.&lt;/p&gt;
&lt;p&gt;Every transaction on a blockchain modifies the global state that is replicated across all nodes.&lt;/p&gt;
&lt;p&gt;Since there are millions of transactions, transactions get grouped together in blocks, hence the name - Blockchain. These blocks are chained together in a cryptographically verifiable way so they are historically traceable. The current state of a network can be recalculated at any time by starting from the genesis block and transitioning the state according to each block's information up until now.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Nodes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A blockchain network is managed autonomously through a peer-to-peer distributed network of computer nodes. Without going into too much detail, you can simply think of each node in the network as keeping a copy of the global transaction ledger. Therefore, each node can individually verify and audit transactions happening on the network and ensure there was no illicit behavior.&lt;/p&gt;
&lt;p&gt;Another type of node, called a mining node, is responsible for grouping together new transactions being made on a network into a block, verifying them, and proposing the block to be included onto the global ledger by everyone else. Mining is computationally hard, and very important to do securely, so miners whose blocks get accepted are given a token reward for their hard work.&lt;/p&gt;
&lt;p&gt;The use of a blockchain confirms that each unit of value was transferred only once, and the ingenious mechanisms put forth by Satoshi Nakamoto solved the long-standing decentralized double-spending problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Decentralization&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By storing data in a peer to peer network of nodes, the blockchain is a decentralized network. This has significant benefits over the traditional approach of storing data in a centralized manner. There are significant examples of problems with centralization - a few of which we will list here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Data breaches in centralized systems expose a lot of data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Centralized authorities can censor and shut down speech.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reliance on a central authority means upstream problems affect downstream consumers (e.g. AWS going down means most of the internet goes down with it)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On the other hand, decentralization brings about the opposite benefits.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No censorship as there is no single authority or middleman that can censor you.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No downtime as the overall network is running across 1000's of nodes across the globe.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Highly attack resistant making it infeasible to manipulate or destroy data&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cryptocurrency&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smart Contracts&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decentralized Finance&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gaming&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supply Chain Tracking&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Counterfeiting Protection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Privacy&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decentralized Governance&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verifiable ownership of assets&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and many more...&lt;/p&gt;
</description>
<category>Web Dev</category>
<guid isPermaLink="true">https://coderlegion.com/3172/what-even-is-a-blockchain</guid>
<pubDate>Tue, 27 May 2025 21:12:58 +0000</pubDate>
</item>
</channel>
</rss>