<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arran Fletcher</title>
    <description>The latest articles on DEV Community by Arran Fletcher (@mfcodeworks).</description>
    <link>https://dev.to/mfcodeworks</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F385319%2F4e02df14-fa3d-4d3a-ab88-ef2b7b474a07.jpg</url>
      <title>DEV Community: Arran Fletcher</title>
      <link>https://dev.to/mfcodeworks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mfcodeworks"/>
    <language>en</language>
    <item>
      <title>Wrapped ETH, wETH - What's the Point?</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Wed, 26 Jan 2022 12:12:17 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/wrapped-eth-weth-whats-the-point-5fd2</link>
      <guid>https://dev.to/mfcodeworks/wrapped-eth-weth-whats-the-point-5fd2</guid>
      <description>&lt;p&gt;If you're familiar with cryptocurrency you've probably heard of some of the native crypto coins; Bitcoin, Ethereum, maybe Dogecoin. Once you begin exploring things like DeFi, dApps, and &lt;a href="https://dev.to/mfcodeworks/web3-what-does-it-mean-and-what-does-it-do-38ca"&gt;web3&lt;/a&gt; you might begin seeing a new token referenced a lot; wrapped ETH or wETH.&lt;/p&gt;

&lt;p&gt;What is the difference between ETH and wETH, and what's the point in "wrapping" ETH to use it?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Wrapped Token
&lt;/h2&gt;

&lt;p&gt;A wrapped token, like wETH, is a token that represents the currency that it's wrapping. If you hold 1 wETH, you can exchange that for 1 ETH, it will always have the same value.&lt;/p&gt;

&lt;p&gt;In technical terms, wETH is a token represented by a smart contract on the Ethereum blockchain, but in simple terms, you can think of it like a cheque. Instead of having a $10 note (ETH), you have a piece of paper that's worth $10 (wETH) which you can exchange at the bank to get your regular old $10 back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why are we Wrapping Tokens
&lt;/h2&gt;

&lt;p&gt;Okay, so we've gone through &lt;em&gt;what&lt;/em&gt; a wrapped token is, but another important question is &lt;em&gt;why&lt;/em&gt; wrap them?&lt;/p&gt;

&lt;p&gt;At its creation, Ethereum was a new blockchain network and cryptocurrency similar to Bitcoin. For every transaction you want to send, you need to sign it before sending it, similar to entering your PIN code or CVV when you use your credit card.&lt;/p&gt;

&lt;p&gt;Soon after the ETH currency was working, its creators introduced "smart contracts" which allowed for managing data on the blockchain beyond just ETH transactions. &lt;/p&gt;

&lt;p&gt;This led to the creation of a few other things; tokens that &lt;em&gt;also&lt;/em&gt; get exchanged on the same blockchain as ETH such as USDT or SHIB, and dApps such as currency exchange's that allow users to trade tokens, or platforms to buy and sell goods, all managed entirely on the blockchain.&lt;/p&gt;

&lt;p&gt;dApps were slowly standardized to use a particular kind of token, called the ERC20 token standard. This allowed new features for tokens like giving permission to a dApp to use them on your behalf, which meant that dApp's could start having advanced features like auctions and scheduled transactions.&lt;/p&gt;

&lt;p&gt;So why does ETH need to be wrapped? Well, it can't do the same things ERC20 tokens can. &lt;/p&gt;

&lt;p&gt;If you wanted to use ETH to make a bid on an NFT or schedule a transaction to someone a week from today, you would need to wait until it happens and sign off on the transaction. It would be like scheduling a bank transfer to pay your bills, then having to open your bank app and enter your PIN code exactly when you want the scheduled transfer to happen.&lt;/p&gt;

&lt;p&gt;To solve this issue, rather than trading ETH for another token with a different value, the wETH token was created to have a token exactly equal to ETH.&lt;/p&gt;

&lt;p&gt;When you use your wETH on any dApp, it has the same value as ETH; it's akin to passing a cheque to someone; it can be passed on ten more times without your knowledge before the final recipient redeems it back for regular money, or in this case ETH. &lt;/p&gt;

&lt;p&gt;The main difference between an actual cheque and wETH is that you need to trade your ETH for wETH, so it can never bounce due to a lack of funds like a real-world cheque.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do You get this Wrapped ETH
&lt;/h2&gt;

&lt;p&gt;The most common way to get wETH today is to trade your ETH for wETH on an exchange like &lt;a href="https://app.uniswap.org/#/swap?chain=mainnet"&gt;Uniswap&lt;/a&gt; or &lt;a href="https://app.sushi.com/swap"&gt;SushiSwap&lt;/a&gt;, which can be sold back for regular ETH again on any exchange.&lt;/p&gt;

&lt;p&gt;The technical details behind the scenes involve interacting with the smart contract.&lt;/p&gt;

&lt;p&gt;To "wrap ETH" users would send ETH to the wETH smart contract and receive an equal amount of wETH. To "unwrap wETH", users send wETH to the wETH smart contract which would return regular ETH. The contract then "burns" the wETH to ensure that no wETH is used that isn’t backed by an equal amount of ETH locked in the smart contract.&lt;/p&gt;

&lt;p&gt;The average user will never need to worry about the behind-the-scenes portion of this; there's so much wETH being traded today that an exchange is the only way most users will know of to get wETH.&lt;/p&gt;

&lt;p&gt;Now you understand what wrapped tokens are, why they're needed, and how to get them, you can go forth and play around in the world of dApps and web3 and enjoy using your cryptocurrency wherever you go! Remember to be careful when granting any platform access to your money, make sure any platform you interact with is safe and well-reviewed before granting any access to anything you own.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to support more unbiased discussions and deep dives in crypto? I accept tips!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ko-fi: &lt;a href="https://ko-fi.com/mfcodeworks"&gt;https://ko-fi.com/mfcodeworks&lt;/a&gt;&lt;br&gt;
ETH/MATIC: 0xaBC5cb8AFB4EeC892b90019c54D9a3A6a38f3B0c&lt;br&gt;
BTC: bc1qunls7qykn23u6f2z0vtgv0gmn2kgw8l4s6qtz9&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>What Would a Useful NFT Look Like?</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Fri, 21 Jan 2022 16:50:30 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/what-would-a-useful-nft-look-like-4k1</link>
      <guid>https://dev.to/mfcodeworks/what-would-a-useful-nft-look-like-4k1</guid>
      <description>&lt;p&gt;NFTs are a hot button issue in the spheres of crypto, investors, corporations, and primarily gaming. Many people are hesitant that gaming companies will only use this as an exploitive cash-grab, and rightly so. Ubisoft's recent &lt;a href="https://www.engadget.com/ubisoft-nft-quartz-ghost-recon-blockchain-140720063.html"&gt;Ghost Recon NFTs&lt;/a&gt; have failed miserably to sell, most likely for the fact they don't have any appeal to anyone.&lt;/p&gt;

&lt;p&gt;A common discussion point in favour of NFTs is having utility, providing something beyond a simple picture attachment, so what do people mean when they talk about "utility NFTs" and what could that look like?&lt;/p&gt;

&lt;h2&gt;
  
  
  Giving NFTs a Purpose
&lt;/h2&gt;

&lt;p&gt;A common suggestion by NFT fans is to &lt;a href="https://twitter.com/mikeshinoda/status/1479865779822551040"&gt;"Imagine taking your favourite skin from Valorant, and using it Fortnite"&lt;/a&gt;. This is laughably impossible for many reasons; conflicting art styles, different game engines, incompatible asset file formats, among many other things. &lt;/p&gt;

&lt;p&gt;A better explanation for the idea of a utility NFT would be; imagine using a gun from Fallout 3 in Fallout New Vegas. The reason this explanation works is that it's already possible. With the &lt;a href="https://www.nexusmods.com/newvegas/mods/40007"&gt;use of mods&lt;/a&gt; and with over 100,000 downloads on that mod alone, it seems like a popular idea and something companies might want to invest in.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1479865779822551040-290" src="https://platform.twitter.com/embed/Tweet.html?id=1479865779822551040"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1479865779822551040-290');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1479865779822551040&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;More and more games are exploring the idea of having some form of cross-compatibility and cross-progression, and this isn't anything new. Mass Effect already has a long-running system of &lt;a href="https://www.rpgsite.net/feature/11112-mass-effect-choices-consequences-decisions-that-matter-across-the-trilogy"&gt;decisions and in-game credits transferring to each new game&lt;/a&gt; with your save file. &lt;/p&gt;

&lt;p&gt;Assassin's Creed recently introduced cross-progression that allows you to &lt;a href="https://www.ubisoft.com/en-us/help/assassins-creed-valhalla/article/cross-platform-progression-in-assassins-creed-valhalla/000079360"&gt;continue your game from PC to Playstation&lt;/a&gt;. With games shifting to cross-platform and cross-game progression, it makes sense to utilize NFTs as a platform-independent way for users to hold items and progress. All compatible games can access a collection of weapons, amour, pets, achievements, and other things. Not something you have to buy that sits in your laptop doing nothing, something you earned in-game that can be brought forward through years more of gaming. &lt;/p&gt;

&lt;p&gt;Think along the lines of your favourite gun in Borderlands being available in Borderlands 2, your favourite pet in Elder Scrolls Online being available on PlayStation and Xbox, or a collectible achievement that unlocks dialogue in future games. It isn't magic and requires game companies to &lt;em&gt;do&lt;/em&gt; something to utilize it, but they're already doing this in more complicated ways.&lt;/p&gt;

&lt;p&gt;The above outlines the use of a utility NFT and what it could provide users but there's another vital question to address; why?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Bother with Utility NFTs
&lt;/h2&gt;

&lt;p&gt;The current system of cross-platform and cross-game data is messy. Some rely on your save file, some rely on the cloud, and some need a DRM check-in to company servers and breaks the moment there's a network issue. &lt;/p&gt;

&lt;p&gt;This becomes even worse when games introduce "integrations" like allowing a connection with Steam or Twitch, or trying to build their own platform like Borderlands Shift. This is because it needs new code, a new API, a new way of "integrating" and linking users and accounts specific to the company and the game. &lt;/p&gt;

&lt;p&gt;NFTs can help in addressing these issues, not by providing a fast plug-and-go solution, but by providing a standard way to make data available and verify users' ownership.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you hold and manage your own data, there would be no more company firewall removing your access when you go offline (or they &lt;a href="https://gamerant.com/denuvo-drm-outage-major-games-unplayable/"&gt;have another outage&lt;/a&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If your laptop dies and you don't have a backup, you tend to lose everything you worked for. There is an obvious solution for this local save problem; the cloud. What that means is having your data saved on a company server, Ubisoft or EA, or another company holding and managing all of your data. &lt;/p&gt;

&lt;p&gt;This works fine as a solution to losing local data, but dedicated company servers are still prone to &lt;a href="https://www.google.com/amp/s/gamerant.com/various-bethesda-games-are-facing-outages/amp/"&gt;outages&lt;/a&gt;, bandwidth issues, &lt;a href="https://www.ubisoft.com/en-us/game/rainbow-six/siege/news-updates/11Lg5ZRMqEOpi7Kzkk1RiN/ddos-dos-and-our-next-steps"&gt;DDoS attacks&lt;/a&gt;, and &lt;a href="https://forums.ubisoft.com/showthread.php/823440-How-bad-is-the-AC4-save-corrupting-losing-thing"&gt;even data loss&lt;/a&gt;. By storing data on the blockchain the servers are public and distributed; even if half the servers go offline you have half the servers left to download from. If the entire network of the blockchain goes offline there's probably a more significant issue occurring with the internet or the world.&lt;/p&gt;

&lt;p&gt;Another issue NFTs can potentially help to reduce is DRM. If you hold and manage your own data, there would be no more company firewall removing your access when you go offline (or they &lt;a href="https://gamerant.com/denuvo-drm-outage-major-games-unplayable/"&gt;have another outage&lt;/a&gt;). Obviously, companies can still implement any code they want in-game to try and enforce DRM and limit your access to items, but with an NFT even if the entire company went bankrupt you would be able to access all your items on the blockchain. Potentially making use of them with the help of game-DRM removal mods or even community games built using the same game engine, and they'll always be available on any platform built to simply show them off and list what you've earned, assuming they don't build a &lt;a href="https://twitter.com/wongmjane/status/1484191510455533569"&gt;reliance on another centralized platform&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1484191510455533569-139" src="https://platform.twitter.com/embed/Tweet.html?id=1484191510455533569"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1484191510455533569-139');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1484191510455533569&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;The most complex frontier of modern games; integrations. When you have an NFT, there's a single way to access the data; this was by design to make NFTs a flexible data structure with a simple retrieval method. Current game integrations make use of complex sets of APIs and company-owned code, with each company doing things their own way. By utilizing NFTs as a standardized data source, every platform can use one single API to access your game item NFTs. Whether Twitch wants to integrate a way to access or reward viewers with an in-game item, Steam building a showcase to show off your collection of years of work, or any third-party collection and marketplace portals building a simple way to access and utilize your game data, there would be a straightforward way of getting this data regardless of which game it came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  The drawbacks of an NFT
&lt;/h2&gt;

&lt;p&gt;NFTs, like anything, come with their own drawbacks, not always on the user side but mainly on the corporate side.&lt;/p&gt;

&lt;p&gt;NFTs are publicly available data, the purpose of an NFT is a publicly verifiable piece of data, but with an NFT, this wouldn't be owned by the corporation. Ubisoft would no longer be the king of your domain; you wouldn't need to rely on Ubisoft platforms and give your personal data to access and utilize your items, which means less ownership and less data collection for corporations, not something companies necessarily want to forfeit.&lt;/p&gt;

&lt;p&gt;Another widespread discussion surrounding NFTs is energy consumption; this point depends on which blockchain is used. Every blockchain functions differently; the difference is how a blockchain chooses to verify things. While every blockchain offers a similar way to record, store, and access data, the code they use to agree on this can be extremely different. Ethereum and Bitcoin use code that makes a server expend as much of its CPU power as possible, leading to high energy usage. The solution to this? Use a different blockchain. &lt;/p&gt;

&lt;p&gt;Much like any piece of technology companies need to carefully examine what's available and what they &lt;em&gt;should&lt;/em&gt; be using. Several well-tested and highly used blockchains like &lt;a href="https://tezos.com/"&gt;Tezos&lt;/a&gt; and &lt;a href="https://solana.com/"&gt;Solana&lt;/a&gt; exist with &lt;a href="https://solana.com/news/solana-energy-usage-report-november-2021"&gt;extremely low energy consumption&lt;/a&gt;, less than you would typically use by storing the data in a common multi-region server setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TiHLZ4TT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gro19tq0mvx0zcnaqq90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TiHLZ4TT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gro19tq0mvx0zcnaqq90.png" alt="Solana transaction energy usage at 1,837 J comes in less than 1 hour of an LED lightbulb" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://solana.com/news/solana-energy-usage-report-november-2021"&gt;source: Solana’s Energy Use Report: November 2021&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  NFTs in the Future
&lt;/h2&gt;

&lt;p&gt;Not everyone likes NFTs, not everyone believes they have a purpose, and that's okay. NFTs are a new technology with evolving discussions, and like anything new, they'll be abused and exploited by anyone looking to make a dollar. &lt;/p&gt;

&lt;p&gt;The purpose of this article isn't to tout NFTs as a global solution to everything, or to try and sell anything to anyone, only to inform the possibilities of a useful NFT and what that could look like in the near future if companies make an honest and innovative commitment, and not a simple cash-grab or marketing gimmick.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to support more unbiased discussions and deep dives in crypto? I accept tips!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ko-fi: &lt;a href="https://ko-fi.com/mfcodeworks"&gt;https://ko-fi.com/mfcodeworks&lt;/a&gt;&lt;br&gt;
ETH/MATIC: 0xaBC5cb8AFB4EeC892b90019c54D9a3A6a38f3B0c&lt;br&gt;
BTC: bc1qunls7qykn23u6f2z0vtgv0gmn2kgw8l4s6qtz9&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>discuss</category>
    </item>
    <item>
      <title>DAOs - the good, the bad and the unknown</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Fri, 14 Jan 2022 15:11:34 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/daos-the-good-the-bad-and-the-unknown-l1e</link>
      <guid>https://dev.to/mfcodeworks/daos-the-good-the-bad-and-the-unknown-l1e</guid>
      <description>&lt;p&gt;Decentralized Autonomous Organization (DAO). A DAO is an organization of people, without a leader or governing body. Instead, governed (usually) by the rules of a "smart contract" on the blockchain which determines how proposals are created and votes on them are cast, often with the aid of a crypto token or NFT.&lt;/p&gt;

&lt;p&gt;A second part of the DAO is the treasury, most DAOs have a singular &lt;em&gt;wallet&lt;/em&gt; or a place to pool resources, that are further used based on decisions voted on by the DAO. However the management and who really has access to the treasury to commit transactions and use funds depends on how the DAO is set up.&lt;/p&gt;

&lt;p&gt;DAOs are a new take on a well known system; democracy. DAOs envision a new way for large groups of thousands, potentially millions of people, to propose ideas and dedicate resources to a cause through mass voting. However, not all DAOs are equal, not all DAOs may be considered a "real" DAO, and there are a lot of questions to be faced with new large collectives like this.&lt;/p&gt;

&lt;p&gt;So what do DAOs streamline, what problems do they address, and what are the pitfalls and unknowns that they suffer from?&lt;/p&gt;

&lt;h2&gt;
  
  
  The benefits of a DAO
&lt;/h2&gt;

&lt;p&gt;Most countries across the world have a government of some kind. Whether chosen by elections, a ruling party, or by birthright, a small group of people is proposing and deciding which ideas a country enacts. Although citizens may have some influence over these decisions, citizens do not have a vote on every decision that's made. A DAO changes this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pure Democracy
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;In a larger DAO without a member limit, this could be scaled up to hundreds of thousands and provide an easy accessible way to cast votes on important decisions without barriers or intimidation interfering.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The purpose of a DAO is to remove this layer of representatives. To remove central figures, group representatives, and treat every decision with an open ballot. Using a crypto wallet to cast votes, this makes collecting and counting ballots instant and completely traceable. There's no chance of forgotten or uncounted ballots, no confusion on which option was chosen, every vote is openly available for every other person to see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/developer_dao"&gt;Developer DAO&lt;/a&gt;, a DAO with a limit of just under 8,000 members launched less than 4 months ago, put out its &lt;a href="https://snapshot.org/#/devdao.eth/proposal/0x6c141b9efbfad6b370581eebf505408ba7f8619264b7e8ca03118fdf89975c97"&gt;proposal to switch from using an NFT to using tokens to vote&lt;/a&gt;. In 5 days the proposal has over 1,300 individual votes. In a larger DAO without a member limit, this could be scaled up to hundreds of thousands and provide an easy accessible way to cast votes on important decisions without barriers or intimidation interfering.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mass Adoption and Growth
&lt;/h3&gt;

&lt;p&gt;When people want to form a collective; whether its a political group, a mass-investment, or an art movement, DAOs can make creating a large organization faster and easier than ever before. With no entry process, no pre-requirements, and no invite needed, a DAO can grow to incredible size and strength very quickly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By the end of their mission on November 19th (One week after the first post) the DAO had raised roughly $47 million dollars from over 17,000 contributors&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://twitter.com/ConstitutionDAO"&gt;ConstitutionDAO&lt;/a&gt; was a DAO formed to purchase an original copy of the constitution of the USA. With its &lt;a href="https://twitter.com/ConstitutionDAO/status/1458990413625315354"&gt;first post&lt;/a&gt; being on November 12th, 2021, it took less than a week, November 18th, for the DAO to &lt;a href="https://twitter.com/ConstitutionDAO/status/1461205307158372352"&gt;raise over $40 million dollars&lt;/a&gt;. Although their mission fell through, by the end of everything on November 19th (One week after the first post) the DAO had raised roughly &lt;a href="https://twitter.com/ConstitutionDAO/status/1461527514485035009"&gt;$47 million dollars from over 17,000 contributors&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1461205307158372352-480" src="https://platform.twitter.com/embed/Tweet.html?id=1461205307158372352"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1461205307158372352-480');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1461205307158372352&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;DAOs can create an almost limitless democratic system. With just a phone, an internet connection, and a way to communicate ideas, a mass-movement of people can be created and organized without physical boundaries or issues of corruption and intimidation in the voting system. Nonetheless, like any group initiative DAOs struggle in certain areas and are yet to find a way forward in some common issues. &lt;/p&gt;

&lt;h2&gt;
  
  
  The struggles DAOs face
&lt;/h2&gt;

&lt;p&gt;As with any group of people, there are struggles DAOs face. Many of the biggest issues relating to governance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leadership
&lt;/h3&gt;

&lt;p&gt;When a group is decentralized and autonomous, who really proposes anything? In a group of 200,000 people, does every person have an equal right to simply create a proposal that's voted on? In most DAOs as of writing this; they don't. This means in most DAOs there's a &lt;em&gt;core team&lt;/em&gt;, or more often the &lt;em&gt;founding members&lt;/em&gt; and occasionally additional members who may have been active and contributing in the group for a long time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Are all votes considered equal? Are all members considered equal? This depends on how votes are issued within a DAO&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When a decentralized autonomous group has a central team of people leading discussions and proposing ideas, can it &lt;em&gt;truly&lt;/em&gt; be considered a DAO? Wouldn't this make it the same as any other governmental system, just with a different voting method? Herein lies a big issue of DAOs and their future, removing central bodies eliminates the risk of corruption and dictatorship, but it creates an unmanageable process of organizing the path forward.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vote Equality
&lt;/h3&gt;

&lt;p&gt;Another issue stemming from DAOs being a massive decentralized organization is votes. Are all votes considered equal? Are all members considered equal? This depends on how votes are issued within a DAO, and this is done in one of two methods: NFTs, or tokens.&lt;/p&gt;

&lt;p&gt;NFT voting is based on holding an NFT, with each NFT being unique and representative of one vote. But what about people who hold 2 NFTs? If the NFTs were distributed by sale, doesn't the majority of voting power fall to the richest members? In some cases, yes. Some DAOs such as &lt;a href="https://twitter.com/developer_dao?t=3fK665_N1Rov2p6Ez3rVxA&amp;amp;s=09"&gt;Developer DAO&lt;/a&gt; have a system in which an address holding NFTs gets one vote, regardless of how many NFTs they have. But with the ease of crypto addresses, any person could simply make a new address and hold one NFT on each, massively multiplying their voting power.&lt;/p&gt;

&lt;p&gt;The alternative to NFTs is a token. Tokens are not unique. Tokens simply set their supply limit, potentially millions of tokens, and require a certain amount to vote, in the &lt;a href="https://snapshot.org/#/devdao.eth/proposal/0x6c141b9efbfad6b370581eebf505408ba7f8619264b7e8ca03118fdf89975c97"&gt;Developer DAO token proposal&lt;/a&gt; that means 400 tokens gives someone access to one vote.&lt;/p&gt;

&lt;p&gt;This again raises questions of distribution and equality. Crypto is known for being sold, and if governance is sold then the richest members quickly become the most powerful. When token distribution happens, who has a right to it? Do all members receive equal power? Does the founding team receive a bigger allocation and if so, what makes their vote more important? These are questions fundamental to the democratic process DAOs are trying to implement, and in the end the decision falls back to the same people creating the DAO.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/Grady_Booch"&gt;Grady Booch&lt;/a&gt;, a well respected software engineer, posted a &lt;a href="https://twitter.com/Grady_Booch/status/1462624151869411330"&gt;thread&lt;/a&gt; detailing many of the governance issues that DAOs will inevitably face.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1462624151869411330-59" src="https://platform.twitter.com/embed/Tweet.html?id=1462624151869411330"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1462624151869411330-59');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1462624151869411330&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h3&gt;
  
  
  How will DAOs mature
&lt;/h3&gt;

&lt;p&gt;A consequence that hasn't been seen yet but will no doubt need clarification in time; what happens to a DAO as time passed? As votes are based on tokens or NFTs and these are distributed to a massive group of people, where will these people be in 10 years if the DAO is expected to last that long?&lt;/p&gt;

&lt;p&gt;Some studies have shown in the decade since its inception, around &lt;a href="https://www.investopedia.com/news/20-all-btc-lost-unrecoverable-study-shows/#:~:text=Bitcoin%20users%20have%20misplaced%20about,the%20Wall%20Street%20Journal%20suggests."&gt;20% of all Bitcoin has been lost in circulation&lt;/a&gt;, so what happens to voting power over time? Some will inevitably be lost, some will be consolidated by users who want to have higher influence, people will become inactive or busy or pass away, wallets will be compromised and the voting power overall will dwindle to smaller and smaller amounts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code of Conduct
&lt;/h3&gt;

&lt;p&gt;Another issue that concerns both voting rights and the freedom of ideas DAOs promote, what happens when a member betrays the mission of the DAO? DAOs are touted as a proponent of free ideas and open internet under &lt;a href="https://mfcodeworks.com/blog/article/web3-what-does-it-mean-and-what-does-it-do"&gt;web3&lt;/a&gt;, so what happens when a member, especially a core team member, goes against the tenants that a DAO stands for? If a DAO has a mission of protection of the environment, what do you do with members that support replacing forests with parking lots? If your DAO promotes inclusivity and diversity, what do you do with a member that promotes racism and genocide? When voting is open and accessible to all members, do you blacklist their wallet? Do you attempt to forfeit &lt;em&gt;their&lt;/em&gt; tokens and NFTs? Can you prevent a subset of radical ideas become the majority, which has happened time and time again throughout history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keys to the Kingdom
&lt;/h3&gt;

&lt;p&gt;One of the largest and sometimes least discussed issues that DAOs face; if a DAO has a treasury, who has access? Many DAOs solve this with a "multi-sig wallet", that is a crypto wallet that requires a certain amount of keys. Similar to a lockbox with 4 different keys to open it, many DAOs operate their treasury in a similar way handing digital keys to a trusted set of members. This raises the same question that's been the core of every issue discussed, &lt;em&gt;is this a DAO&lt;/em&gt;? Can this structure really be considered &lt;em&gt;decentralized&lt;/em&gt;? What's to stop this trusted group of members growing the DAO, gathering resources and assets in the treasury under the promise of a mission, and swiftly taking it all for themselves?&lt;/p&gt;

&lt;p&gt;A treasury wallet can be created that responds only to smart contract code, and if done well this means that only a successful majority proposal vote can ever initiate a transaction from the wallet, as seen &lt;a href="https://blog.makerdao.com/what-are-smart-contract-wallets-and-how-can-they-benefit-defi-users/"&gt;in this MakerDAO blog post&lt;/a&gt;. As always, it's up to the creators of a DAO how they structure things and if they are willing to take the effort to make their DAO as decentralized as possible and protect what the members entrust the DAO with.&lt;/p&gt;

&lt;h2&gt;
  
  
  The future of DAOs
&lt;/h2&gt;

&lt;p&gt;Under issues of governance, trust, centralization, and limits of ideas and conduct, DAOs today continue to grow more and more numerous with each gathering larger audiences.&lt;/p&gt;

&lt;p&gt;The purpose of DAOs are becoming more diverse with each DAO launched; &lt;a href="https://www.olympusdao.finance/"&gt;OlympusDAO&lt;/a&gt; creating a decentralized reserve currency which has amassed $1.5 billion dollars in locked value, &lt;a href="https://pleasr.org/#"&gt;PleasrDAO&lt;/a&gt; funding the collection of rare physical and digital pieces of art including the &lt;a href="https://www.nytimes.com/2021/10/20/arts/music/wu-tang-clan-once-upon-a-time-in-shaolin.html"&gt;only copy of Once Upon a Time in Shaolin by Wu-Tang Clan&lt;/a&gt;, &lt;a href="https://www.klimadao.finance/"&gt;KlimaDAO&lt;/a&gt; creating a treasury of locked carbon credits to use the market to increase the cost of carbon for businesses with over 14 million tones of carbon locked, there's no limit to what DAOs can grow to achieve.&lt;/p&gt;

&lt;p&gt;The future of DAOs will see DAOs face new complex challenges, old challenges that have been faced by every governing system, and the challenge of time and how to handle a DAO that matures over decades of members. Only when we look back will we see if DAOs helped create a new wave of decentralized democratic co-operatives, or if the system is simply too decentralized to govern without the DAO collapsing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to support more unbiased discussions and deep dives in crypto? I accept tips!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ko-fi: &lt;a href="https://ko-fi.com/mfcodeworks"&gt;https://ko-fi.com/mfcodeworks&lt;/a&gt;&lt;br&gt;
ETH/MATIC: 0xaBC5cb8AFB4EeC892b90019c54D9a3A6a38f3B0c&lt;br&gt;
BTC: bc1qunls7qykn23u6f2z0vtgv0gmn2kgw8l4s6qtz9&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>discuss</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Web3 - what does it mean and what does it do?</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Mon, 10 Jan 2022 16:02:23 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/web3-what-does-it-mean-and-what-does-it-do-38ca</link>
      <guid>https://dev.to/mfcodeworks/web3-what-does-it-mean-and-what-does-it-do-38ca</guid>
      <description>&lt;p&gt;The term &lt;em&gt;web3&lt;/em&gt; is a contentious word depending on who you ask. Essentially, web3 is an attempt to create a new business model for the internet, mainly using blockchain technology.&lt;/p&gt;

&lt;p&gt;The goals in most web3 proposals are to create a decentralized platform where users own their content outside the borders of the platform and can earn directly from others without a middleman. Why?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When &lt;em&gt;web2.0&lt;/em&gt; was popularized it was a model based on user-generated content; YouTube videos, WordPress blogs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The current internet relies on ads, tips, or subscriptions. People buying newspapers and cable subscriptions dropped dramatically over the past 2 decades, so most media has pivoted to making money from targeted ads or subscription models. When &lt;em&gt;web2.0&lt;/em&gt; was popularized it was a model based on user-generated content; YouTube videos, WordPress blogs, and other sites that allow users to create and potentially monetize their own content. Most of these sites have the same basic model to make money, with the hosting company taking a percentage fee, or all profit, to provide the service.&lt;/p&gt;

&lt;p&gt;The new web3 model is based on making things decentralized and eliminating targeted advertising, reducing large profit cuts taken by hosting providers and allowing users to "own" their content on a new, less intrusive internet ecosystem.&lt;/p&gt;

&lt;p&gt;Using a "smart contract" that acts as the service provider (Like YouTube), content is managed via the blockchain without a central company, so you can tip your favourite creator or set up a monthly subscription with all the profit going to them. Some web3 apps take this further with models that also share a percentage with &lt;em&gt;everyone&lt;/em&gt; on the site, so no matter how popular a creator is, everyone will get something for making content.&lt;/p&gt;

&lt;h2&gt;
  
  
  What web3 can do well
&lt;/h2&gt;

&lt;p&gt;When set up properly, web3 apps can achieve their goal of passing on higher profits to users. Newly launched apps like &lt;a href="https://looksrare.org/"&gt;LooksRare&lt;/a&gt; allow users to create and sell NFT art, with a 2% platform fee. This 2% fee also goes back to the community with a token that can be bought and held to earn from these fees.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1480208072694185988-401" src="https://platform.twitter.com/embed/Tweet.html?id=1480208072694185988"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1480208072694185988-401');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1480208072694185988&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;The user who created and sold the art will still net 98% of the profit, which is higher than most other digital art marketplaces or content platforms like YouTube. For comparison with YouTube, even when users are setting up a monthly membership to a channel to support specific users, YouTube takes a 30% fee.&lt;/p&gt;

&lt;p&gt;web3 that does utilize the blockchain to store content, also allows users to bring their content with them. As a user you can publish your art on &lt;a href="https://opensea.io"&gt;OpenSea&lt;/a&gt;, then you'll instantly have it show up on other platforms like &lt;a href="https://rarible.com"&gt;Rarible&lt;/a&gt; and &lt;a href="https://niftygateway.com/"&gt;Nifty Gateway&lt;/a&gt; without having to do anything to make them appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  What web3 doesn't do well
&lt;/h2&gt;

&lt;p&gt;web3 doesn't always manage to hit its goals of a decentralized economy where you own all your content and get paid without the middleman.&lt;/p&gt;

&lt;p&gt;One of the biggest issues with web3 is the fact that almost everything relies on fees, which is the nature of blockchain.&lt;/p&gt;

&lt;p&gt;Submitting something new, purchasing something; most interactions with data require a "gas fee" to be able to do something on the blockchain. Depending on which blockchain a web3 app uses, this gas fee could be anywhere from $0.10 to $120.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How does a struggling artist without much money approach this? How does someone young, broke, or with no access to crypto start using these apps?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Acquiring the crypto to pay the gas fee usually requires registering with an exchange, purchasing crypto for a fee, then transferring it to your personal wallet for a fee, not to mention the tax that some countries charge on this. So how does a struggling artist without much money approach this? How does someone young, broke, or with no access to crypto start using these apps? Well... generally they can't. Pricing users out of being able to use the app is an issue. Some apps like &lt;a href="https://opensea.io"&gt;OpenSea&lt;/a&gt; absorb some of the fees when creating or transferring content, but oftentimes to be able to interact and do anything you need some amount of money to start with.&lt;/p&gt;

&lt;p&gt;Another key issue that web3 sometimes fails to deliver on; being decentralized. Whether it's hosting the site or the user content; the blockchain isn't good at storing large data, especially data larger than a small jpeg. When it comes to high-quality audio or video content, it's infeasible to store this on any blockchain. One solution that apps utilize is IPFS, which stores data on public servers without a central authority, but without "pinning" which requires either money or a central server, the data can be wiped from servers. Many apps fall back to storing data on centralized servers, which suffer the same issues as a regular app. If the server goes down, the content disappears the same as it would anywhere else.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When an apps goal is to be decentralized and generally owned and governed by the community that use it, who really manages it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the biggest issues with decentralized web3 apps today is management. When an apps goal is to be decentralized and generally owned and governed by the community that use it, who really manages it?&lt;/p&gt;

&lt;p&gt;Running an app requires several layers of people; developers who &lt;em&gt;make&lt;/em&gt; the app, designers who design what you're looking at and clicking on, someone to determine new features, test new things, and moderators to make sure content isn't stolen or illegal. When an app becomes decentralized and removes targeted ads and as many platform fees as possible, it becomes harder to manage who creates the app, how they benefit, and what level of moderation and censorship exists, without becoming almost the same as any standard internet app that exists today.&lt;/p&gt;

&lt;p&gt;In the end, many existing web3 apps can be run and managed by corporations that harvest the same user data, with the same profit goals in mind, simply shifting how they increase their earnings without actually benefitting users.&lt;/p&gt;

&lt;h2&gt;
  
  
  The future of web3
&lt;/h2&gt;

&lt;p&gt;web3 is still very new, with new apps launching every week that try to achieve the goal of making websites and apps less centralized under big corporations, with more earnings going towards users for their contributions.&lt;/p&gt;

&lt;p&gt;While there are several challenges to be addressed, we will continue to see a wave of different techniques and mixes of current and new web technology that could possibly deliver a new or better experience of the web in the near future.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to support more unbiased discussions and deep dives in crypto? I accept tips!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ko-fi: &lt;a href="https://ko-fi.com/mfcodeworks"&gt;https://ko-fi.com/mfcodeworks&lt;/a&gt;&lt;br&gt;
ETH/MATIC: 0xaBC5cb8AFB4EeC892b90019c54D9a3A6a38f3B0c&lt;br&gt;
BTC: bc1qunls7qykn23u6f2z0vtgv0gmn2kgw8l4s6qtz9&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>web3</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Serverless Hosting, CloudFlare, DNS &amp; Setting Up A Domain</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Fri, 22 May 2020 20:23:36 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/serverless-hosting-cloudflare-dns-setting-up-a-domain-4pl0</link>
      <guid>https://dev.to/mfcodeworks/serverless-hosting-cloudflare-dns-setting-up-a-domain-4pl0</guid>
      <description>&lt;p&gt;In my &lt;a href="https://mfcodeworks.com/blog/article/my-portfolio-the-backend"&gt;last article&lt;/a&gt; I talked about Sanity ﻿CMS and building the content storage for my portfolio. &lt;/p&gt;

&lt;p&gt;In this article I'll talk ﻿about &lt;a href="https://mfcodeworks.com/blog/tag/serverless"&gt;serverless&lt;/a&gt; hosting, Netlify deployment, CloudFlare, and explain &lt;em&gt;what Serverless, DNS, and Name Servers are&lt;/em&gt;. So with serverless hosting, we start with the most common question.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Serverless?﻿
&lt;/h3&gt;

&lt;p&gt;It's probably not exactly what you're thinking. Serverless doesn't mean it's &lt;em&gt;server-less&lt;/em&gt;, serverless just means you don't have to worry about the server. &lt;strong&gt;Your job&lt;/strong&gt; is serverless, someone else manages it for you.&lt;/p&gt;

&lt;p&gt;A lot of different providers have serverless options, and they do it in different ways. Some can only host websites, some allow you to host a function, some you can even deploy a full server!&lt;br&gt;&lt;br&gt;
We're going to be discussing &lt;strong&gt;Netlify&lt;/strong&gt;. Netlify offers the ability to host websites; like Angular, React, and other client-rendered sites, as well as offering &lt;em&gt;serverless&lt;/em&gt; &lt;em&gt;functions&lt;/em&gt; in a way that allows deploying full Express web servers, we'll use this in another article to create a &lt;a href="https://mfcodeworks.com/blog/tag/nodejs"&gt;NodeJS&lt;/a&gt; email server.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Do I Serverless-ly Host a Website?
&lt;/h3&gt;

&lt;p&gt;All you need is an account with GitHub, GitLab, or BitBucket, to sign in to Netlify. You can sign in without these and just upload your site directly, but it makes deploying sites harder to manage.&lt;/p&gt;

&lt;p&gt;After you have an account, you'll see a neat little dashboard where you can add and manage all your websites! I'm a fan of Netlify, so I already have 4 sites (Including this blog and the Sanity studio I used to write it) running on there. Make sure you have a project to launch, and it's setup on somewhere like Github, and we can begin deploying it for the world to see!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FvWgLNI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/8caeaf72a29042360f33542bce18b928130cd205-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FvWgLNI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/8caeaf72a29042360f33542bce18b928130cd205-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To deploy a new site (Without having to upload the files everytime) we click the &lt;strong&gt;New site from Git&lt;/strong&gt; button and login with any of the git services available, then you just select your project from the list, and the last part is to set your &lt;strong&gt;"Build Command" *&lt;em&gt;and *&lt;/em&gt;"Publish Directory"&lt;/strong&gt;, which means the thing you type to build the site and the folder where the files will be. If you're continuing from &lt;a href="https://mfcodeworks.com/blog/article/my-portfolio-the-backend"&gt;my last article&lt;/a&gt;, the 2 entries would be &lt;em&gt;sanity build&lt;/em&gt;, and &lt;em&gt;dist&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That's it! Click deploy and your site will begin deploying for the world to see!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pst5IDSE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/7d72e33a0f075ed34772c20d279fbc6c64387101-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pst5IDSE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/7d72e33a0f075ed34772c20d279fbc6c64387101-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that your website is deployed, it's available for all! Netlify will set you up with a domain like &lt;em&gt;mycoolnewsite.netlify.app _and you'll be able to see your published site. If you completed that step with one of the Git sites then it will also update your site &lt;strong&gt;automatically&lt;/strong&gt; &lt;strong&gt;everytime&lt;/strong&gt; you update the Git project! An always up-to-date, publicly available site. But what if you want your own domain and not just _mycoolnewsite.netlify.app&lt;/em&gt;?&lt;/p&gt;

&lt;h3&gt;
  
  
  What are DNS and Name Servers?
&lt;/h3&gt;

&lt;p&gt;The first step to setting up a custom domain, is usually to purchase the custom domain. So pick a name and go buy it for yourself! I won't cover how to do that here but there's plenty of sites available, my personal favourite is &lt;a href="https://namecheap.com"&gt;NameCheap&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The next part is one my of favourites, CloudFlare. CloudFlare does DNS management, website speed optimizations, analytics, and protects your site from attacks like DOS (Denial of Service). Sign up for CloudFlare &lt;a href="https://cloudflare.com"&gt;here&lt;/a&gt; and you'll be able to add your domain, and any other domain, for free. You'll need to change your domains name servers to point to the servers that CloudFlare gives you, the site you register your domain with, like NameCheap, should have instructions on how to do that.&lt;/p&gt;

&lt;p&gt;So before you get too confused, lets slow down and talk about some things. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DNS, what is a name server, and how does any of this work?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Every domain has a set of name servers it points to. The name servers set and store all the details on that site. If you were born in Australia, then the Australian government would be your name server, they have your name along with all the details about you. By itself, a domain name doesn't do much except... exist. That's where DNS comes in.&lt;/p&gt;

&lt;p&gt;DNS (Domain Name System) is a map, usually 1-to-1, for server addresses and domain names. Every website, even the serverless ones, run on a server. A server has a public IP address. Your laptop, desktop, phone, and even smart TV if you have one all have a public IP address. It usually looks like gibberish, something like 13.147.41.8. That's the servers unique address, that server is the only server in the world with that address.&lt;br&gt;&lt;br&gt;
The same way you can have multiple cities called Melbourne (Australia, South Africa, USA), there's only one place on earth with the GPS co-ordinates 37.8136° S, 144.9631° E. A GPS can tell you those co-ordinates are for Melbourne Australia, the same way a DNS server will tell you the domain mfcodeworks.com is for the server address 13.147.41.8 (It's not, just an example).&lt;/p&gt;

&lt;p&gt;So a domain has name servers, and these name servers tell us which physical server we need to connect to so I can see that website. With your domain, and your site deployed on Netlify, the next step is connecting the two! Over in Netlify, click on your site and go to &lt;strong&gt;Settings&lt;/strong&gt;, there should be an option for &lt;strong&gt;"Domain Management"&lt;/strong&gt; on the left.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bbydQbp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/8735456903efe772295305564b202d2cd534caee-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bbydQbp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/8735456903efe772295305564b202d2cd534caee-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The easiest way to add a custom domain to Netlify is using the &lt;strong&gt;CNAME **method. A CNAME is kind of like a redirection, I can set the CNAME search.mfcodeworks.com to be an **Alias&lt;/strong&gt; for google.com, so when I open search.mfcodeworks.com, I see Google! (Or a Google error page)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0VGyAazM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/2c8839690f85ef34b619202e5c9e747e48ca69a5-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0VGyAazM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/2c8839690f85ef34b619202e5c9e747e48ca69a5-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting a CNAME For Your Site
&lt;/h3&gt;

&lt;p&gt;Copy the CNAME that Netlify gives you (It should be that &lt;em&gt;mycoolnewsite.netlify.app&lt;/em&gt; domain), and open up your new CloudFlare account. Under the &lt;strong&gt;DNS&lt;/strong&gt; tab of your domain, you can add new entries, most commonly &lt;strong&gt;A&lt;/strong&gt;, &lt;strong&gt;CNAME&lt;/strong&gt;, and &lt;strong&gt;TXT&lt;/strong&gt;. A is for adding IP addresses (Like 12.143.14.5), CNAME is for adding domains (Like google.com), and TXT is for adding text data to a site, usually to prove to some third party app that you own that domain.&lt;/p&gt;

&lt;p&gt;Add a new CNAME with @ for the name (@ means your domain) and add the &lt;em&gt;mycoolnewsite.netlify.app&lt;/em&gt; domain as the target. Click save and that's it! You now have a sweet custom domain for your website! If you want to go a step further you can add another CNAME for the **www **sub-domain that still exists, and set the target to your domain. That means anyone going to &lt;em&gt;&lt;a href="http://www.yourdomain.com"&gt;www.yourdomain.com&lt;/a&gt;&lt;/em&gt; will see the same thing as going to &lt;em&gt;yourdomain.com&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5iwCGMEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/5d3ff8a934276f4c0788f56dfd1b2837f28197a6-1920x649.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5iwCGMEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/5d3ff8a934276f4c0788f56dfd1b2837f28197a6-1920x649.png" alt="" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Else Can CloudFlare Do?
&lt;/h3&gt;

&lt;p&gt;CloudFlare automatically enables SSL and provides DOS protection to make sure your site is safe behind a firewall. Under &lt;strong&gt;Speed &amp;gt; Optimization&lt;/strong&gt; you can enable features like automatic minification to make files smaller, and Brotli compression to make files &lt;strong&gt;even smaller&lt;/strong&gt; to make your site load as fast as possible! (&lt;a href="https://mfcodeworks.com"&gt;My portfolio&lt;/a&gt; can load the homepage in &amp;lt;1.5 seconds)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hNfuhYP7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/79fd9c1bdcbecf1a97a92df281fd6d860e3ee94d-1920x655.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hNfuhYP7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/79fd9c1bdcbecf1a97a92df281fd6d860e3ee94d-1920x655.png" alt="" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Caching&lt;/strong&gt; tab gives you options to set how long a user will save your site for, and an &lt;em&gt;Always Online&lt;/em&gt; mode, which means even if Netlify does stop working, CloudFlare can still show your site to anyone that visits!&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Network&lt;/strong&gt; tab also provides some options to make loading our site even faster! Regular HTTP (Website requests) will send us one HTML file and then your browser will load all the images, JavaScript, CSS, and everything else one by one as it needs them. You have to wait for everything to be done before you fully load a page. HTTP/2 lets the server &lt;strong&gt;tell your device&lt;/strong&gt; what it needs to download, before it even knows it needs it! Google and CloudFlare have been taking it even further with HTTP/3, which is designed to make everything more secure and even faster than HTTP/2! How many people has my site served over HTTP/3 so far?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bawl8kzu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/9f9d2c27489a208bb5a811651099632494d626c1-480x360.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bawl8kzu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/9f9d2c27489a208bb5a811651099632494d626c1-480x360.gif" alt="" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far, it's still 0. But Google, CloudFlare, and Mozilla are all working on bringing HTTP/3 standards to modern browsers and make the internet a much faster place for all! You can read more about the HTTP/3 efforts &lt;a href="https://blog.cloudflare.com/http3-the-past-present-and-future/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Next?
&lt;/h3&gt;

&lt;p&gt;Now you've deployed your own personal site publically on Netlify, you also added a custom domain with CloudFlare that has SSL security, fast caching, and compression to make it as speedy as possible. If you deployed a Sanity studio like the one we discussed &lt;a href="https://mfcodeworks.com/blog/article/my-portfolio-the-backend"&gt;last article&lt;/a&gt;, you can edit all your content for your Sanity site from anywhere, even your phone! Now you can build React apps, Angular sites, anything you can think of and deploy it for the world to see, all free of cost!&lt;/p&gt;

&lt;p&gt;Next article I'll cover how I deployed a NodeJS email forwarding server to &lt;a href="https://mfcodeworks.com/blog/tag/netlify"&gt;Netlify&lt;/a&gt; through Netlify functions, and created a serverless email form handler!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article is cross-posted from my personal site &lt;a href="https://mfcodeworks.com/blog/article/serverless-hosting-cloudflare-dns"&gt;over here&lt;/a&gt;. If you enjoyed this article, learned something, or you just want to help out someone; &lt;a href="https://ko-fi.com/mfcodeworks"&gt;buy me a coffee&lt;/a&gt;! It will be much appreciated.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Portfolio - Sanity Headless CMS</title>
      <dc:creator>Arran Fletcher</dc:creator>
      <pubDate>Wed, 20 May 2020 19:53:11 +0000</pubDate>
      <link>https://dev.to/mfcodeworks/my-portfolio-sanity-headless-cms-5hni</link>
      <guid>https://dev.to/mfcodeworks/my-portfolio-sanity-headless-cms-5hni</guid>
      <description>&lt;p&gt;It seems like a good place to start my first article would be the reason I'm even writing it, my portfolio. I'll spend the next few articles going through the how and why of the full tech stack of &lt;a href="https://mfcodeworks.com/"&gt;my new portfolio&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The full tech stack of this portfolio includes &lt;a href="https://mfcodeworks.com/blog/tag/cms"&gt;Sanity CMS&lt;/a&gt;, &lt;a href="https://mfcodeworks.com/blog/tag/graphql"&gt;GraphQL&lt;/a&gt; API, &lt;a href="https://mfcodeworks.com/blog/tag/serverless"&gt;Serverless&lt;/a&gt; functions, &lt;a href="https://mfcodeworks.com/blog/tag/netlify"&gt;Netlify &lt;/a&gt;hosting, &lt;a href="https://mfcodeworks.com/blog/tag/cloudflare"&gt;CloudFlare &lt;/a&gt;DNS, and &lt;a href="https://mfcodeworks.com/blog/tag/angular"&gt;Angular &lt;/a&gt;with RxJS. We'll go through every one of these services, in detail, so expect a few articles. We'll start with the first step I took when creating my portfolio.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Sanity CMS
&lt;/h3&gt;

&lt;p&gt;I was asking myself the same question a few weeks ago, what is &lt;a href="https://sanity.io"&gt;Sanity CMS&lt;/a&gt;? If you've ever used a CMS like WordPress, written an article on dev.to, or made an old Blogger blog before, it will seem pretty familiar.&lt;/p&gt;

&lt;p&gt;Sanity is a &lt;em&gt;headless&lt;/em&gt; CMS, that means the place the content is displayed is up to you. Until you add one, it doesn't exist. Sanity gives you a dashboard called &lt;strong&gt;Sanity Studio&lt;/strong&gt; where you can add content, and it provides an API you can call to fetch that content to display anywhere on the internet; either as a &lt;strong&gt;GraphQL **query or Sanity's custom **GROQ&lt;/strong&gt; query language (We'll cover GraphQL in another article).&lt;/p&gt;

&lt;p&gt;The Sanity dashboard is pretty minimal, straight forward, and gives a very simple overview of your content. A simple studio looks like this, but it's fully customisable aand flexible using Sanity's plugins and schemas. So how do we use these plugins and what's a schema?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fiG_39bY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/7226948b872dd1e454be054bc57bfd30d255293b-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fiG_39bY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/7226948b872dd1e454be054bc57bfd30d255293b-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sanity Studio Plugins
&lt;/h3&gt;

&lt;p&gt;Sanity has a fair few plugins (I counted over 50) available &lt;a href="https://www.sanity.io/plugins"&gt;here&lt;/a&gt;, some are easy to setup, some require a little bit more for implementation, but they're all useful!&lt;/p&gt;

&lt;p&gt;One of the simplest plugins available is &lt;a href="https://www.sanity.io/plugins/sanity-plugin-dark-mode"&gt;dark theme&lt;/a&gt; (Like in the screenshot up there); it's as simple as using an install command and you're all set, just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity &lt;span class="nb"&gt;install &lt;/span&gt;dark-mode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some require a little more setup to use. One amazing plugin I've been using is &lt;a href="https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify"&gt;Netlify Deploy&lt;/a&gt;, &lt;a href="https://netlify.com"&gt;Netlify&lt;/a&gt; NodeJS&lt;a href="https://mfcodeworks.com/blog/tag/nodejs"&gt;NodeJS&lt;/a&gt; Servers, without having to deal with the actual server part of everything. Netlify Deploy allows you to check the status of, and redploy, any sites you're hosting with Netlify! (After some small configuration)&lt;/p&gt;

&lt;p&gt;Begin by running the install command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity &lt;span class="nb"&gt;install &lt;/span&gt;dashboard-widget-netlify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Netlify Deploy uses the sanity dashboard, an installable dashboard for plugins to display key info, installable with another simple command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity &lt;span class="nb"&gt;install&lt;/span&gt; @sanity/dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that everything's installed we can setup the plugin in 2 easy steps.&lt;/p&gt;

&lt;p&gt;Sanity uses a JSON file, &lt;em&gt;sanity.json&lt;/em&gt;, to configure everything included in the studio. It uses a field called "parts" to state the literal parts, of the studio. So here we just need a few lines to say we want to include this new plugin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"implements"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"part:@sanity/dashboard/config"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./config/dashboard/dashboard.js"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're asking Sanity to "implement" the dashboard, and giving a "path" to our configuration.&lt;/p&gt;

&lt;p&gt;Sanity gives us a directory called config when we create a project, so we're just creating a file inside config called &lt;em&gt;dashboard.js&lt;/em&gt; and filling it in like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;widgets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;netlify&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Netlify Sites&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;sites&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Portfolio Frontend&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;apiId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;buildHookId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;abcdef1234567&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;awesome-frontend-1234&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Portfolio Sanity CMS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;apiId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;buildHookId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abcdef1234567&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sanity-cms-1337&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we create a list of widgets (In case you want to keep adding more later) and set them up. For the netlify plugin, we give it a title to show in the dashboard, and a list of sites from Netlify to display. That's it! We'll need to grab the &lt;em&gt;name&lt;/em&gt;, &lt;em&gt;apiId&lt;/em&gt;, and &lt;em&gt;buildHookId&lt;/em&gt; from Netlify to prove we own them, but that's all there is, almost all the plugins are just as simple!&lt;/p&gt;

&lt;p&gt;After all that we'll have a nice looking dashboard to control our websites deployment like this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tceHGze3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/13ef2f88931c3925a16ad84ebb212f9b31da1fac-1920x1080.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tceHGze3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.sanity.io/images/682knlgh/production/13ef2f88931c3925a16ad84ebb212f9b31da1fac-1920x1080.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What About Customising the Content? Like Blog Posts?
&lt;/h3&gt;

&lt;p&gt;Sanity makes it super easy to customise the content you display. Setting up my portfolio took about 30 minutes total to fully setup and customise, including the types for Posts, Authors, Categories, Files, and more.&lt;/p&gt;

&lt;p&gt;Sanity keeps our "schema" (The list of stuff we want to show) in a directory called &lt;em&gt;schema&lt;/em&gt;, in a file called... &lt;em&gt;schema.js&lt;/em&gt;. Nothing exciting in the naming of everything, but the ease and flexibility we have when creating schemas is definitly something exciting!&lt;/p&gt;

&lt;p&gt;A default schema looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// First, we must import the schema creator&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;createSchema&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;part:@sanity/base/schema-creator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// Then import schema types from any plugins that might expose them&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;schemaTypes&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;all:part:@sanity/base/schema-type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// We import object and document schemas&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;blockContent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./blockContent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;category&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./category&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./author&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// Then we give our schema to the builder and provide the result to Sanity&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;createSchema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="c1"&gt;// We name our schema&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;default&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// Then proceed to concatenate our document type&lt;/span&gt;
  &lt;span class="c1"&gt;// to the ones provided by any plugins that are installed&lt;/span&gt;
  &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;schemaTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="c1"&gt;// The following are document types which will appear&lt;/span&gt;
    &lt;span class="c1"&gt;// in the studio.&lt;/span&gt;
    &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// When added to this list, object types can be used as&lt;/span&gt;
    &lt;span class="c1"&gt;// { type: 'typename' } in other document schemas&lt;/span&gt;
    &lt;span class="nx"&gt;blockContent&lt;/span&gt;
  &lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The schema, called "default", includes &lt;strong&gt;Post&lt;/strong&gt;, &lt;strong&gt;Author&lt;/strong&gt;, and &lt;strong&gt;Category&lt;/strong&gt;, by default. As well as a special type called &lt;strong&gt;blockContent&lt;/strong&gt;. If we take a look inside a schema like &lt;strong&gt;Post&lt;/strong&gt;, it looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;document&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;maxLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;author&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Author&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reference&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;author&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mainImage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Main image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;hotspot&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;categories&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Categories&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;array&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reference&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;category&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}}]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;publishedAt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Published at&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;datetime&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blockContent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;excerpt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Excerpt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So every piece of content we want to show has a type of &lt;strong&gt;document&lt;/strong&gt;, this is a piece of content that's meant to be shown and used in its own way, like a post, or an author, or a category.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;document&lt;/strong&gt; is made of a list of fields, and these are just your basic types, or you can use other custom types inside. Above we have the &lt;strong&gt;Author&lt;/strong&gt;, which references the type Author. Simple types like &lt;strong&gt;string&lt;/strong&gt; and &lt;strong&gt;datetime&lt;/strong&gt; can be used to display simple bits of information like names and dates, and the special type **blockContent **is shown as the type for the body, this is Sanity's special way of displaying rich text, text with headings and images and lists inside it. That's all there is to it.&lt;/p&gt;

&lt;p&gt;Let's try adding a new type, Tags. First we create a new file called &lt;em&gt;tags.js&lt;/em&gt; and fill in the info for a tag. A title and a slug should be enough for a simple tag, so we create the schema like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tags&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tag&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;document&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;maxLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A tag, with a title and a slug. Simple. Now we can add it to the post like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;document&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tags&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tags&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;array&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reference&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tags&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}}]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;publishedAt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Published at&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;datetime&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We just add a field with the name &lt;em&gt;tags&lt;/em&gt;, a type of array so we can add a few, and a reference using &lt;em&gt;of&lt;/em&gt; to tell Sanity we want this to be &lt;em&gt;of&lt;/em&gt; the type &lt;strong&gt;Tag&lt;/strong&gt;. That's it! Well almost...&lt;/p&gt;

&lt;p&gt;We do need to add this new type to our schema so Sanity knows it exists. We open our &lt;em&gt;schema.js&lt;/em&gt; file again and add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// We import object and document schemas&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./tags&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;createSchema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;schemaTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="nx"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we're done. We import the &lt;em&gt;tags.js&lt;/em&gt; file, and add it to our lists of types. And we're done! We have a blog that has posts with tags to keep all our topics linked together!&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a New Sanity Project
&lt;/h3&gt;

&lt;p&gt;So after hearing how easy and flexible the Sanity CMS is, you probably want to install it and set up your own projects, it just takes a few steps.&lt;/p&gt;

&lt;p&gt;If you haven't already tabbed away from this article and installed Sanity for yourself, you can do that with a simple command, after setting up &lt;a href="https://nodejs.org"&gt;NodeJS&lt;/a&gt; just install the Sanity CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @sanity/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we have the Sanity CLI installed you can create a new project using the Sanity CLI with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll answer a few questions about the project name, and it even has some premade types like a blog, a movie project, or even an e-commerce CMS to start selling products online! You can customise Sanity to be an easy, simple CMS for any project you can think of.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are the Main Sanity CLI Commands?
&lt;/h3&gt;

&lt;p&gt;The main commands you'll use (Or I used) for Sanity Studio are a few simple commands to manage everthing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the Sanity Studio and start publishing content straight away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build the Sanity Studio as a minimal web-app that can be deployed anywhere as an admin interface for your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sanity graphql deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to use GraphQL (Like my portfolio does) then this command will build the GraphQL backend for you to start querying. Sanity GraphQL has its standard querying format available &lt;a href="https://www.sanity.io/docs/graphql"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;That's it! That's an overview of Sanity CMS and how easy it was to get set up. You could fully setup and customise a complex project within a few hours, seperate datasets for different environments, and create custom multi-level workflows for large-scale team projects.&lt;/p&gt;

&lt;p&gt;In the next article we'll be covering &lt;a href="https://mfcodeworks.com/blog/tag/netlify"&gt;Netlify&lt;/a&gt; and &lt;a href="https://mfcodeworks.com/blog/tag/cloudflare"&gt;CloudFlare&lt;/a&gt;; hosting a website, PWA, and even a full &lt;a href="https://mfcodeworks.com/blog/tag/nodejs"&gt;NodeJS&lt;/a&gt; web server with serverless hosting.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article is cross-posted from my personal site &lt;a href="https://mfcodeworks.com"&gt;over here&lt;/a&gt;. If you enjoyed this article, learned something, or you just want to help out someone; &lt;a href="https://ko-fi.com/mfcodeworks"&gt;buy me a coffee&lt;/a&gt;! It will be much appreciated.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
