<?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: Arya Danech</title>
    <description>The latest articles on DEV Community by Arya Danech (@aryad14).</description>
    <link>https://dev.to/aryad14</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%2F1145597%2F5f9c70fe-4034-42d8-8e9e-d4430fe97d89.png</url>
      <title>DEV Community: Arya Danech</title>
      <link>https://dev.to/aryad14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aryad14"/>
    <language>en</language>
    <item>
      <title>Learn about managing application content in an Efficient Way</title>
      <dc:creator>Arya Danech</dc:creator>
      <pubDate>Sat, 13 Jan 2024 01:33:51 +0000</pubDate>
      <link>https://dev.to/mlscgescoe/learn-about-managing-application-content-in-an-efficient-way-23g1</link>
      <guid>https://dev.to/mlscgescoe/learn-about-managing-application-content-in-an-efficient-way-23g1</guid>
      <description>&lt;p&gt;Ever wanted to create a Full Stack Application but struggling with managing the Content to be stored and displayed? 🤔&lt;/p&gt;

&lt;p&gt;Well, Strapi has got you covered ✅&lt;/p&gt;

&lt;p&gt;If we want to develop a backend for any kind of application, we need to write code from scratch along with choosing a Database, planning out how the APIs will work, making authentications, etc.&lt;/p&gt;

&lt;p&gt;But Strapi makes it easy to build and manage backend with it’s built-in features. Not only that but it also generates code for it which it 100% JavaScript 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Strapi?
&lt;/h3&gt;

&lt;p&gt;It is an open-source and fully customizable &lt;strong&gt;Headless Content Management System (CMS)&lt;/strong&gt;, meaning that developers have complete freedom over how the data will be displayed using any frontend framework.&lt;/p&gt;

&lt;p&gt;It is completely functionable with any Framework using JavaScript / TypeScript.&lt;/p&gt;

&lt;p&gt;Using Strapi, anyone can develop a Backend for any application within minutes of work.&lt;/p&gt;

&lt;p&gt;It provides a very Interactive Admin Panel to create, manage and deliver content, using APIs to fetch and display those datasets across various applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Installing Strapi&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get started, we need to run a simple command to build strapi application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;create-strapi-app&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;latest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;PROJECT_NAME&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;strapi-app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;PROJECT_NAME&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will automatically create an entire admin panel for strapi which could be accessed from &lt;code&gt;[localhost:1337/admin](http://localhost:1337/admin)&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A4QRHQn3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxd5ti32sz6jvq5b3c6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A4QRHQn3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxd5ti32sz6jvq5b3c6g.png" alt="Strapi Admin Panel" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the look of the Strapi Admin Panel. Here you can manage all the collections that would be used to store data and displayed on the applications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Designing Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just like developing Database Schema for any application, we would be structuring the data as we want, but without writing a &lt;strong&gt;Single Line of Code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dqOQ_JVS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5ssma5etae8tb3ulnbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dqOQ_JVS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5ssma5etae8tb3ulnbs.png" alt="Strapi Default User Collection" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Strapi comes with a default User Collection which would be used for user authentication on our applications&lt;/p&gt;

&lt;p&gt;From this page, we can create our own collection types as per our needs with just few clicks🖱️&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Adding a Collection Type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Firstly, Collections are just like tables in any Relational Database. Or it is also similar to Collections in MongoDB.&lt;/p&gt;

&lt;p&gt;Now suppose we want to create a collection for storing books, we will initially create a collection type named &lt;code&gt;book&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once the collection type is created, we will be able to define the fields that we wish to have in our &lt;code&gt;book&lt;/code&gt; collection&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E0vRCdPh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkwcmlg9ci59uxyvp93t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E0vRCdPh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkwcmlg9ci59uxyvp93t.png" alt="Adding fields to Strapi Collection" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While adding a field, we can mark it as required, specify it’s minimum and maximum length, and also mark it as a Unique field&lt;/p&gt;

&lt;p&gt;After adding some fields in our collection type, we get to see something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tegJ7vT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2k406a6jjvgo0wvd1ajn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tegJ7vT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2k406a6jjvgo0wvd1ajn.png" alt="Fields in newly added Collection" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we have defined some fields which are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;name (required, type → text, min. length → 3)&lt;/li&gt;
&lt;li&gt;author (required, type → text, min. length → 3)&lt;/li&gt;
&lt;li&gt;published (required, type → date)&lt;/li&gt;
&lt;li&gt;price (required, type → number)&lt;/li&gt;
&lt;li&gt;image (required, type → media)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After we are done with building our Collection Type, we can now add content in the collection through strapi dashboard itself by simply clicking on the &lt;code&gt;Content Manager&lt;/code&gt; tab in the sidebar, then selecting our newly created collection type and then clicking on &lt;code&gt;Create New Entry&lt;/code&gt; button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wBJi-kjG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ltg1180sqmzrnxixrpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wBJi-kjG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ltg1180sqmzrnxixrpv.png" alt="Adding entry in the Created Collection Type" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we get an interactive form, based on the fields chosen while building the collection type, to add data to our collection.&lt;/p&gt;

&lt;p&gt;Just for an example I created an Entry for a Book which can be accessed from any application using API links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---JF-X2AN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cc5bt04q7xbx6z7zhafu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---JF-X2AN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cc5bt04q7xbx6z7zhafu.png" alt="Entry Created in Book Collection" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Using the Content added in Strapi Collection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To access data from APIs, we need an API Token to access the data&lt;/p&gt;

&lt;p&gt;In this case, the API token can be generated for a single or multiple Collection Types. We just need to Navigate to Settings &amp;gt; API Tokens (under &lt;code&gt;Global Settings&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;After that, we need to Specify permissions for Public and Authenticated users to a specific application. This can be set according to our needs by finding the settings under &lt;code&gt;Users &amp;amp; Permissions Plugin&lt;/code&gt; tab.&lt;/p&gt;

&lt;p&gt;There we can choose the actions that will be allowed to Authenticated or Unauthenticated users. For Example, recently we created a collection type named &lt;code&gt;book&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now for this collection type, we can choose which type of users can &lt;strong&gt;create&lt;/strong&gt;, &lt;strong&gt;update&lt;/strong&gt;, &lt;strong&gt;delete&lt;/strong&gt;, or even &lt;strong&gt;find&lt;/strong&gt; a book.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bOBL1xgy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5voss3vw405in6f6b81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bOBL1xgy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5voss3vw405in6f6b81.png" alt="Getting API links for Collection" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here as we select the actions allowed to the specified users, we get the API path to access the data.&lt;/p&gt;

&lt;p&gt;Therefore, according to our example, we can &lt;strong&gt;find&lt;/strong&gt; books if and only if we are authenticated, and it can be done by using the link &lt;code&gt;localhost:1337/api/books&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So this was the basic introduction to Strapi: Headless CMS. There is much more to explore in Strapi Admin Dashboard and it is free of cost. &lt;/p&gt;

&lt;p&gt;Do checkout it's amazing website, &lt;a href="https://strapi.io/"&gt;https://strapi.io/&lt;/a&gt; for more information&lt;/p&gt;

&lt;p&gt;If you want tutorials on building projects with Strapi, here are some links to those as well 😉&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://youtube.com/playlist?list=PLu0W_9lII9ajKKSG5aROCiw9iro5vK-gE&amp;amp;feature=shared"&gt;Strapi Tutorials for Beginners - CodeWithHarry (in Hindi)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtube.com/playlist?list=PL4cUxeGkcC9h6OY8_8Oq6JerWqsKdAPxn&amp;amp;feature=shared"&gt;Strapi Tutorial (with React &amp;amp; GraphQL) - Net Ninja&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So that is all for now. Feel free to reach out to me via &lt;a href="https://www.linkedin.com/in/arya-danech-a17538252/"&gt;LinkedIn&lt;/a&gt; or &lt;a href="https://twitter.com/aryadanech14"&gt;Twitter (X)&lt;/a&gt;.&lt;br&gt;
Do checkout my repositories on &lt;a href="https://github.com/aryad14"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Learning 🚀&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>api</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
