<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anass ELBAZ on Medium]]></title>
        <description><![CDATA[Stories by Anass ELBAZ on Medium]]></description>
        <link>https://medium.com/@anasselbaz0?source=rss-37637b09283a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uFoAOb0LLvPbbdI9WLsfTw.jpeg</url>
            <title>Stories by Anass ELBAZ on Medium</title>
            <link>https://medium.com/@anasselbaz0?source=rss-37637b09283a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 07:04:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anasselbaz0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Improve the SEO Ranking of your Web Application]]></title>
            <link>https://anasselbaz0.medium.com/improve-the-seo-ranking-of-your-web-application-78dea052416e?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/78dea052416e</guid>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Sun, 13 Aug 2023 14:33:32 GMT</pubDate>
            <atom:updated>2023-08-13T14:41:04.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HckYezW5TiTAHxauArxwLg.jpeg" /><figcaption>Photo by Oleksandr P: <a href="https://www.pexels.com/photo/letters-on-the-wooden-blocks-9822732/">https://www.pexels.com/photo/letters-on-the-wooden-blocks-9822732/</a></figcaption></figure><p>In today’s digital battleground, where the web is both a marketplace and a playground, the difference between your web application soaring or languishing in obscurity boils down to three letters: S-E-O. Imagine this: as you read these words, over 60,000 searches are being performed on the Google search engine alone. The question is: will your web application be among the search results that users not only see, but click on? Welcome to the world of Search Engine Optimization (SEO), the secret sauce that can turn your digital presence from an echo into an anthem. In this article, we’ll delve into the art and science of SEO, revealing proven strategies that will propel your web application into the limelight it deserves.</p><h3>1. Content Optimization</h3><p>Quality content is the cornerstone of successful SEO. Writing quality, relevant and engaging content not only attracts users, but also piques the interest of search engine algorithms. Techniques such as keyword research, incorporating long-tail keywords and strategically placing them within your content can boost your application’s visibility in search results. In addition, creating comprehensive and authoritative content can position your web application as an industry leader, attracting backlinks and generating organic traffic.</p><h3>2. Technical SEO</h3><p>More about Technical SEO <a href="#5d1c">here</a> (same article)</p><p>The architecture and technical aspects of your web application play a crucial role in its SEO ranking. Ensuring that your website is optimized for mobile devices, loads quickly, and offers a seamless user experience can influence how search engines perceive and rank your application. Delving into the intricacies of schema markup, XML sitemaps, and optimizing meta tags can enhance search engine crawlers’ ability to index and understand your content accurately.</p><p>Frequently visiting the Web Vitals and other metrics of your web application can be very helpfull and usefull to optimize your web application. Here are few wesites that can analyze a web app and generates a report about it:</p><p>Certainly, here are a few websites that can analyze a web application and generate reports about various aspects of its performance, SEO, and more:</p><p>1. Google PageSpeed Insights:<br><a href="https://developers.google.com/speed/pagespeed/insights">https://developers.google.com/speed/pagespeed/insights</a></p><p>2. GTmetrix<br><a href="https://gtmetrix.com/">https://gtmetrix.com</a></p><p>3. Pingdom Website Speed Test<br><a href="https://tools.pingdom.com/">https://tools.pingdom.com</a></p><p>4. SEMrush Site Audit<br><a href="https://www.semrush.com/siteaudit/">https://www.semrush.com/siteaudit</a></p><p>5. Screaming Frog SEO Spider<br><a href="https://www.screamingfrog.co.uk/seo-spider/">https://www.screamingfrog.co.uk/seo-spider</a></p><p>6. Varvy SEO Tool<br><a href="https://varvy.com/">https://varvy.com</a></p><p>7. Nibbler<br><a href="http://nibbler.silktide.com/">http://nibbler.silktide.com</a></p><p>8. Web.dev by Google<br><a href="https://web.dev/">https://web.dev</a></p><p>Remember that while these tools provide valuable insights, they might not cover every aspect of your web application’s performance and SEO. It’s recommended to use a combination of tools and manual checks to get a holistic view of your application’s strengths and areas for improvement.</p><h3>3. User Experience and Engagement</h3><p>Search engines value user engagement metrics, such as bounce rate, time on page, and click-through rates. A user-friendly, intuitive interface and navigation structure can keep visitors engaged and encourage them to explore your application further. Creating valuable interactive content, facilitating social sharing, and enabling seamless navigation can all contribute to a positive user experience, indirectly bolstering your SEO ranking.</p><h3>4. Link Building and Off-Page SEO</h3><p>Building a network of high-quality, relevant backlinks from reputable sources remains a powerful method to improve SEO ranking. Engaging in strategic outreach, guest posting, and participating in social media platforms can help establish your web application’s authority and credibility. However, it’s crucial to prioritize quality over quantity, as search engines are adept at recognizing and penalizing manipulative link-building practices.</p><h3>5. Regular Updates and Fresh Content</h3><p>Search engines favor websites that consistently deliver fresh and updated content. Regularly updating your web application with new blog posts, articles, or feature enhancements signals to search engines that your application is relevant and actively maintained. This can lead to improved crawl rates and higher rankings, as search engines strive to present users with the most current and relevant information.</p><h3>More about Technical SEO</h3><p>Technical SEO refers to the optimization of the technical aspects of a website or web application to improve its search engine visibility and ranking. It focuses on ensuring that search engines can effectively crawl, index, and understand the content of your website. Technical SEO is essential because even if you have valuable content, it won’t be effective if search engines can’t properly access and interpret it. Here are some key components of technical SEO:</p><h4>Website Speed and Performance</h4><p>Fast-loading websites are favored by both users and search engines. Slow websites can lead to higher bounce rates and lower user satisfaction. Technical SEO involves optimizing elements like server response times, browser caching, and minimizing unnecessary code to ensure your web application loads quickly.</p><h4>Mobile-Friendly Design (Mobile Responsiveness)</h4><p>With the increasing use of mobile devices, Google and other search engines prioritize mobile-friendly websites in their rankings. Your web application should have a responsive design that adapts to various screen sizes and devices, ensuring a seamless user experience across platforms.</p><h4>Website Architecture and Navigation</h4><p>A well-structured website architecture with clear navigation helps both users and search engines understand the organization of your content. This includes using proper header tags (H1, H2, H3, etc.), creating a logical URL structure, and implementing breadcrumbs. A clear structure makes it easier for search engines to crawl and index your pages accurately.</p><h4>Crawlability and Indexability</h4><p>Search engines use bots (also known as crawlers or spiders) to navigate and index websites. Ensuring that your web application is easily crawlable by these bots is crucial. You can use tools like a robots.txt file to guide bots on which parts of your site to crawl and which to avoid. Additionally, an XML sitemap helps search engines discover and index your pages more efficiently.</p><h4>Schema Markup and Structured Data</h4><p>Schema markup is a form of code that you can add to your web pages to provide additional context to search engines about the content on those pages. This can help search engines display rich snippets, such as star ratings, reviews, and other relevant information, in search results. Structured data markup enhances the understanding of your content’s meaning and relationships.</p><h4>Canonicalization and URL Parameters</h4><p>Duplicate content can negatively impact SEO. Canonical tags help indicate the preferred version of a page when there are multiple URLs with similar content. URL parameters, which often appear after question marks in URLs, can create duplicate content issues. Handling these parameters correctly through tools like Google Search Console can help avoid such issues.</p><h4>HTTPS and Website Security</h4><p>Google considers website security an important ranking factor. Using HTTPS (SSL/TLS encryption) to secure data transmission between your web application and users is not only important for user privacy but also contributes to better SEO rankings.</p><h4>404 Errors and Redirects</h4><p>Broken links and pages can frustrate users and hinder SEO efforts. Implementing proper 301 redirects for pages that have moved or no longer exist helps maintain link equity and ensure a smooth user experience.</p><h3>Conclusion</h3><p>The journey to improve the SEO ranking of your web application is a multifaceted endeavor that requires a holistic approach. By focusing on content optimization, technical aspects, on-page elements, user experience, link building, and consistent updates, you can pave the way for your application to ascend the ranks of search engine results. As the digital realm continues to evolve, adapting and fine-tuning your SEO strategies will remain a dynamic process — one that yields tangible benefits in terms of increased visibility, user engagement, and overall success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78dea052416e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lazy Loading in ReactJs (With React.lazy and Suspense)]]></title>
            <link>https://anasselbaz0.medium.com/lazy-loading-in-reactjs-with-react-lazy-and-suspense-62b13168bb78?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/62b13168bb78</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[bundle]]></category>
            <category><![CDATA[lazy-loading]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Tue, 04 Oct 2022 01:09:28 GMT</pubDate>
            <atom:updated>2022-10-04T01:09:41.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4Xu8UTOExJuv3cSVbyJlw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mr_fresh?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Yura Fresh</a> on <a href="https://unsplash.com/collections/1806117/phone?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Usually, when working with medium or large projects, we tend to break it into reusable modules, components, and utility functions to build larger pieces of our application. Each file has some dependency, we end up with all the files in the project being linked.<br>Bundling is the process of resolving the web dependencies and merging or packaging the files/modules into <strong>one</strong> optimized javascript file called the bundle using some tools like <a href="https://webpack.js.org/">Webpack</a> or <a href="https://browserify.org/">Browsify</a>.</p><h3>What’s and Why Lazy Loading?</h3><p>But what happens when the application grows dramatically? The bundler will bundle all of your files into one big chunk. That may and will affect the duration in which the application loads in the browser for the app customer to use, and may hurt the User Experience (UX)badly.</p><p>Luckily, we do have a way to split our generated file into multiple small chunks that can be dynamically loaded at runtime (That’s why it’s called Lazy Loading 😉).</p><h3>Implementation</h3><p>React.lazy is a function that lets you render a dynamic import as a regular component. It takes an anonymous function as an argument that must call a dynamic import().<br>It only supports default exports. If the module you’re trying to import is using named components, you can create an intermediate component that reexports it as the default.</p><ul><li>Normal import:</li></ul><pre>import MyComponent from &#39;./MyComponent&#39;;</pre><ul><li>Dynamic import:</li></ul><pre>const MyComponent = React.lazy(() =&gt; import(&#39;./MyComponent&#39;));</pre><p>The lazy components must be rendered inside a Suspence component, which takes the lazy components as children, and allows you to implement a fallback component (such as a loader) that will be rendered while the user is waiting for the component to load.</p><pre>import React, { Suspense } from &#39;react&#39;;<br><br>const MyComponent = React.lazy(() =&gt; import(&#39;./MyComponent&#39;));<br><br>function App() {<br>  return (<br>    &lt;div&gt;<br>      &lt;Suspense fallback={&lt;div&gt;Loading...&lt;/div&gt;}&gt;<br>        &lt;MyComponent /&gt;<br>      &lt;/Suspense&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>To manage errors, we can wrap the Suspense component with an <a href="https://reactjs.org/docs/error-boundaries.html">ErrorBoundaries component</a>.</p><h3>Route-based code splitting</h3><p>Deciding where to introduce code splitting in your app can be a bit tricky. You want to make sure you choose places that will split bundles evenly but won’t disrupt the user experience.</p><p>One approach to code-splitting React components is called route-based code-splitting, which requires applying dynamic import() to lazy load route components.</p><p>Let’s take a look at a code example of how to set up route-based code splitting into your app using libraries like <a href="https://reactrouter.com/">React Router</a> with React lazy().</p><pre>import React, { Suspense, lazy } from &#39;react&#39;;<br>import { BrowserRouter as Router, Routes, Route } from &#39;react-router-dom&#39;;<br><br>const Home = lazy(() =&gt; import(&#39;./routes/Home&#39;));<br>const About = lazy(() =&gt; import(&#39;./routes/About&#39;));<br><br>const App = () =&gt; (<br>  &lt;Router&gt;<br>    &lt;Suspense fallback={&lt;div&gt;Loading...&lt;/div&gt;}&gt;<br>      &lt;Routes&gt;<br>        &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;<br>        &lt;Route path=&quot;/about&quot; element={&lt;About /&gt;} /&gt;<br>      &lt;/Routes&gt;<br>    &lt;/Suspense&gt;<br>  &lt;/Router&gt;<br>);</pre><p><em>Thanks for reading! And of course, share your opinion with us.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b13168bb78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Common Software Architecture Patterns and When To Use Them]]></title>
            <link>https://interviewnoodle.com/3-common-software-architecture-patterns-and-when-to-use-them-3103cddfdf38?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3103cddfdf38</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Mon, 01 Nov 2021 22:29:21 GMT</pubDate>
            <atom:updated>2021-11-05T21:35:57.511Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ucD8__Tuo9xEvDhj" /></figure><p>Have you ever thought about how software applications can scale? Is there any room to keep up with the user demands without affecting the whole system?<br>The deciding factor is the usage of a software architecture pattern that the application has implemented. Basically, a software architecture pattern refers to the fundamental structures of a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations.</p><p>Bugs and limitations in a software application have an important impact on the business of an organization. The main reason for any software flaw can be at the application structure level. The selection of wrong architecture patterns can lead to major disfunction of the system, and can cause limitations in the company business in the long term.</p><h3>Layered (n-tier) architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*kwwdHerB2jZ1CTy5keb3IA.png" /><figcaption>Layered (n-tier) architecture</figcaption></figure><p>An N-tier architecture divides an application into logical layers and physical tiers.</p><p>Layers are a way to separate responsibilities and manage dependencies. Each layer has a specific responsibility. A higher layer can use services in a lower layer, but not the other way around : <strong>Unidirectional communication</strong>.</p><p>Tiers are <strong>physically separated</strong>, running on separate machines. A tier can call to another tier directly, or use asynchronous messaging (message queue). Although each layer might be hosted in its own tier, that’s not required. Several layers might be hosted on the same tier. Physically separating the tiers improves scalability and resiliency, but also adds latency from the additional network communication.</p><p>A traditional three-tier application has a presentation tier, a middle tier, and a database tier. The middle tier is optional. More complex applications can have more than three tiers. The diagram above shows an application with two middle tiers, encapsulating different areas of functionality.</p><p>An N-tier application can have a <strong>closed</strong> layer architecture or an <strong>open</strong> layer architecture:</p><ul><li>In a closed layer architecture, a layer can only call the next layer immediately down.</li><li>In an open layer architecture, a layer can call any of the layers below it.</li></ul><p>A closed layer architecture limits the dependencies between layers. However, it might create unnecessary network traffic, if one layer simply passes requests along to the next layer.</p><p>Its main benefits are:</p><ul><li>It’s quicker to develop in part because the concept of Model-View-Controller is so well known among developers.</li><li>Its implementation is easier.</li></ul><h3>Microservices architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xvGqxECaogYPX2DEQb_ow.png" /><figcaption>Microservices Architecture</figcaption></figure><p>Microservices are both an architecture and an approach to writing software. With microservices, applications are broken down into their smallest components, independent from each other. Instead of a traditional, monolithic, approach to apps, where everything is built into a single piece, microservices are all separated and work together to accomplish the same tasks.</p><p>One of the main characteristics is the way the architectural style componentizes a complex application. The software is broken down into multiple components that are built as independently replaceable and upgradeable services. These services can be defined as processes that often communicate over a network using protocols that are technology-agnostic. Microservices are also built to suit business capabilities. And since they are decentralized and small in size, they offer a lot of flexibility when it comes to programming languages, hardware, and software environment.</p><p>It is a good choice when the application that we intend to build is pretty large. Its main benefits are:</p><ul><li><strong>Accessibility &amp; Separation &amp; Maintenance</strong>: Since a Microservice application is deployed separately and communicate via API requests, code becomes more accessible for developers, and maintenance is easier.</li><li><strong>Error management</strong>: If a microservices architecture is implemented correctly, finding and isolating bugs becomes much easier. Whenever an error occurs, developers know exactly where to look, which saves valuable time and effort. And fixing only one independently run service means that other code won’t be affected and there is no need to deploy the whole application.</li><li><strong>Scalability</strong>: One of the main benefits that microservices have to offer is their ability to be scaled horizontally. This means that any deployed service can be duplicated in order to avoid bottlenecks due to slow execution. Another option to increase performance is to run the service on more powerful hardware or multiple machines that process data in parallel.</li><li><strong>Reusability</strong>: The microservices become reusable. The fact that they are independent components, makes them reusable in other projects.</li><li><strong>Ease of understanding: </strong>With added simplicity, developers can better understand the functionality of a service.</li><li><strong>Smaller and faster deployments</strong>: Smaller codebases and scope = quicker deployments, which also allow you to start to explore the benefits of Continuous Deployment.</li></ul><h3>Monolithic Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*xwnoTHXrHQJwYLjMDhtXmA.png" /><figcaption>Monolithic Architecture</figcaption></figure><p>Monolith means composed all in one piece. The <strong>Monolithic</strong> application describes a single-tiered <strong>software</strong> application in which different components combined into a single program from a single platform.</p><p>Monolithic is an all-in-one architecture, wherein all aspects of the software operate as a single unit. In the microservices model, components are modular, functioning independently, and coupled together as needed for optimal functionality.</p><p>When choosing between monolithic architecture and microservices, businesses evaluate factors such as rapid testing, debugging, and scalability.</p><p>Its main benefits are:</p><ul><li><strong>Easier and Faster Development: </strong>The biggest advantage is considered to be the development speed and the simplicity and straightforwardness of creating an application based on one code. There is a wide range of available tools, while it is also familiar to every development team-building concept.</li><li><strong>Easier Deployment:</strong> Monolith applications are considered to be simple to deploy, as it is only necessary to handle deployment once — one executable file or directory.</li><li><strong>Easier Testing and Error Tracing:</strong> With fewer variables, the risk for something to go wrong is much lower, while it is also easier to spot errors when all transactions are logged into one place.</li><li><strong>Trustworthiness:</strong> As monolithic architecture is a tried and tested standard method, it is also considered to be more trustworthy than anything newer and, therefore, more untested.</li></ul><h3>Conclusion</h3><p>This article covered the most known types of software architecture patterns: Monolithic architecture, Layered (n-tier) architecture, Microservices architecture.</p><p>There are many other architecture patterns that may be more fit to be used in each project. It depends of the hardware you want to use, the size of your project, and to the specific use case you’re intending to implement.</p><p>Finally, a well architected system results in excellent performance and<br>scalability, and a poorly architected system can lead to a poorly performing system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3103cddfdf38" width="1" height="1" alt=""><hr><p><a href="https://interviewnoodle.com/3-common-software-architecture-patterns-and-when-to-use-them-3103cddfdf38">3 Common Software Architecture Patterns and When To Use Them</a> was originally published in <a href="https://interviewnoodle.com/">InterviewNoodle</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy a Spring Boot Application to AWS Elastic Beanstalk]]></title>
            <link>https://aws.plainenglish.io/deploy-spring-boot-applications-into-aws-elastic-beanstalk-b2204d8fbd9c?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2204d8fbd9c</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Tue, 19 Oct 2021 16:25:37 GMT</pubDate>
            <atom:updated>2021-10-20T10:00:41.132Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXw8PTpYkBXyZrOmwo_K1w.png" /></figure><p>In this article, we will learn how to deploy a Spring Boot application into AWS Elastic Beanstalk Service. To run a Spring Boot application, we have to provide a database to connect to it. For that purpose, we will use AWS RDS (Relational Database Service).</p><p>After our application is running perfectly in our development environment, we have to, first, configure our project, by setting global dynamic variables to be used in the database connection. Then package the project and upload it to the Elastic Beanstalk environment. After that, we will create a database using the RDS Service. And pass its credentials to the EB environment.</p><p>Let’s start!</p><h3>Prerequisites</h3><ul><li>AWS account</li><li>A Spring Boot application</li></ul><h3>Database Creation</h3><p>On AWS Services, go to RDS. Then, click on <strong>Create database</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnUUQur-LNWF8R6d9cCGlQ.png" /><figcaption>Figure 1: Create database modal</figcaption></figure><p>Select any type of database you want (I go with MySQL), and configure the Master username and password.</p><p>See below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9NSTtu0TOSgB0BFv_z8AWQ.png" /><figcaption>Figure 2: Database information</figcaption></figure><h3>Project Configuration and Packaging</h3><ul><li>In the file resources/application.yml, replace <em>datasource </em>attributes as follows :</li></ul><pre><strong>datasource</strong>:<br>    <strong>url</strong>: jdbc:mysql://${<strong>RDS_HOSTNAME</strong>}:${<strong>RDS_PORT</strong>}/${<strong>RDS_DB_NAME</strong>}<br>    <strong>username</strong>: ${<strong>RDS_USERNAME</strong>}<br>    <strong>password</strong>: ${<strong>RDS_PASSWORD</strong>}</pre><p>These variables will be passed in the EB environment.</p><ul><li>With Maven, build a Jar for your project by running :</li></ul><pre>$mvn clean package</pre><p>The packaging may take some time. After it is done, a jar file will be generated in your target folder.</p><h3>Deployment to the EB Environment</h3><p>After the Elastic Beanstalk environment is created, upload the jar file by clicking <strong><em>Upload &amp; deploy</em></strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*rg5PBlrchRM_ZQMYBdFtLg.png" /><figcaption>Figure 3: Upload modal of AWS Elastic Beanstalk</figcaption></figure><p>To edit the environment variables, go to Configuration → Software → Edit and insert the correct values to the variables. The RDS database values will be found on the Amazon RDS page (Figure 2):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmzcKK5lVxoEoNsyWaNxCw.png" /><figcaption>Figure 4: Environment properties</figcaption></figure><p>The application will not run properly if the PORT property is not set to 5000. Because Elastic Beanstalk assumes that the application will listen on port 5000.</p><h3>Conclusion</h3><p>In this article, we have deployed the Spring Boot application into AWS Beanstalk, created an RDS database, and learned how to link them with each other using environment properties.</p><p>That’s a very secure and dynamic way to pass secret variables into an application, without hard-coding them. Whether they are database connection variables, a secret of an API, or any other secret vars.</p><p>I hope this will be helpful.</p><p>Enjoy!</p><p><em>More content at </em><a href="http://plainenglish.io/"><em>plainenglish.io</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2204d8fbd9c" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/deploy-spring-boot-applications-into-aws-elastic-beanstalk-b2204d8fbd9c">How to Deploy a Spring Boot Application to AWS Elastic Beanstalk</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy a Laravel project into a AWS EC2 instance]]></title>
            <link>https://aws.plainenglish.io/how-to-deploy-a-laravel-project-into-a-aws-ec2-instance-ae067b70e4e2?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae067b70e4e2</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 10:15:29 GMT</pubDate>
            <atom:updated>2021-10-26T10:24:20.706Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*u1IEG8amXqsYX1ddJxeYkw.png" /></figure><p>In this article, we’ll learn how to set up an AWS EC2 instance to prepare for the deployment of your Laravel project.</p><h3>Prerequisites</h3><ul><li>AWS account</li><li>AWE EC2 (Elastic Cloud Computing) Linux (Ubuntu) instance</li><li>Your Laravel project</li></ul><h3>Deployment process</h3><p>Log in into your EC2 instance using ssh <strong>as root</strong>.</p><h4>Update your libs</h4><pre>$apt update</pre><h4>Apache web server</h4><p>To install apache in ubuntu, run :</p><pre>$apt install apache2</pre><p>Now that we installed Apache successfully, we can modify its content in /var/www/html .</p><p><strong>Test Apache web server</strong></p><p>Copy your public IP, and access it via your favorite web browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oM0Q9w1O3pM3uUJwX9EiA.png" /><figcaption>Apache2 Ubuntu Default Page</figcaption></figure><h4>Install PHP &amp; related packages</h4><pre>$apt-get install php -y</pre><pre>$apt-get install php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-intl php7.4-mysql php7.4-xml php7.4-zip -y</pre><p>Test php by printing it’s version:</p><pre>$php -v</pre><p>The result should be something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*AfKO-t1bmv5YBKloqTzMlA.png" /><figcaption>PHP version test</figcaption></figure><h4>Install Composer</h4><pre>$php -r &quot;copy(&#39;https://getcomposer.org/installer&#39;, &#39;composer-setup.php&#39;);&quot;</pre><pre>$php -r &quot;if (hash_file(&#39;sha384&#39;, &#39;composer-setup.php&#39;) === &#39;906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8&#39;) { echo &#39;Installer verified&#39;; } else { echo &#39;Installer corrupt&#39;; unlink(&#39;composer-setup.php&#39;); } echo PHP_EOL;&quot;</pre><pre>$php composer-setup.php</pre><pre>$php -r &quot;unlink(&#39;composer-setup.php&#39;);&quot;</pre><pre>$mv composer.phar /usr/local/bin/composer</pre><h4>Install npm</h4><pre>$apt install npm</pre><h4>Install &amp; Configure Mysql server</h4><pre>$apt-get install mysql-server</pre><p>Next, will define a new password for the user “root” :</p><pre>$mysql</pre><pre>mysql&gt; ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED WITH mysql_native_password BY &#39;my_new_password&#39;;</pre><p>To log into mysql</p><pre>$mysql -p</pre><p>And type your password.</p><h4><strong>Database creation</strong></h4><pre>mysql&gt; CREATE DATABASE db_name;<br>mysql&gt; SHOW DATABASES;</pre><h3>Project configuration</h3><p>Using git, clone your repository to /var/www/html/app .</p><p>If any of the next operations doesn’t have the permissions to run, update the folder’s permissions by :</p><pre>$chmod 777 -R app</pre><p>Install the project dependencies:</p><pre>$npm i<br>$composer u</pre><p>From your local environment, copy the file .env to the folder in the server. And configure the Database information like that:</p><pre>DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=db_name<br>DB_USERNAME=root<br>DB_PASSWORD=my_new_password</pre><p>Restart Apache:</p><pre>$service apache2 restart</pre><p>And access your application from the web browser.</p><h3>An error you might get</h3><p><strong>Api routes : 404 Not found</strong></p><p>In the file /etc/apache2/apache2.conf , add the following code :</p><pre>&lt;Directory /var/www/html/app/public&gt;<br>    Options Indexes FollowSymLinks<br>    AllowOverride All<br>    Require all granted<br>&lt;/Directory&gt;</pre><p>In the file /etc/apache2/sites-enabled/000-default.conf , change the document root path to your project path :</p><pre>DocumentRoot /var/www/html/app/public</pre><p>And enable the rewrite apache2 mode :</p><pre>sudo a2enmod rewrite</pre><p>Restart apache to apply changes :</p><pre>sudo service apache2 restart</pre><p>You can now access your Laravel application in the root of the public IP provided by AWS EC2.</p><p>I hope that could be helpful. Enjoy!</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae067b70e4e2" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/how-to-deploy-a-laravel-project-into-a-aws-ec2-instance-ae067b70e4e2">How to deploy a Laravel project into a AWS EC2 instance</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a Database Seeder in Spring Boot]]></title>
            <link>https://anasselbaz0.medium.com/how-to-create-a-database-seeder-in-spring-boot-7b9ec07808af?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b9ec07808af</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Tue, 16 Mar 2021 14:55:22 GMT</pubDate>
            <atom:updated>2021-03-17T10:03:03.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c_sZ3vFoxfTzQP_y" /><figcaption>Photo by <a href="https://unsplash.com/@qwitka?utm_source=medium&amp;utm_medium=referral">Maksym Kaharlytskyi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Spring Boot is an awesome Java web framework that is very comparable to Laravel web framework (in PHP). They both aim at making web application development fast and less rigorous for a developer.</p><p>Laravel has a cool feature that allows developers to create Seeders — i.e. default data to be inserted in the database.</p><p>In this article, we are going to see how to achieve the same thing in Spring Boot. The strategy thas we are using here is simple and straightforward : First, we will create a listener that listen to the application’s <strong><em>ContextRefreshEvent </em></strong>(1)<strong><em>. </em></strong>The event is fired when the application has been totally bootstrapped, and all bean objects have been instantiated. Then we will use the Models and the repositories to persist default data into the database.</p><p>Now let’s implement this.</p><h3>Implementation</h3><p>First, let’s create a new class called DatabaseSeeder into a new package named seeders. It will be the root of our seeders.</p><p>Then we’ll need to create the event listener (1):</p><pre>@EventListener<br>public void seed(ContextRefreshedEvent event) {<br>    // Here goes the seeders<br>}</pre><p>P.S. We must add the @Component to the DatabaseSeeder class.</p><p>Let’s assume that we need to seed the Users. So, we need a UsersSeeder :</p><pre>@Autowired<br>UserRepository userRepository;</pre><pre>private void seedUsersTable() {<br>    User user = new User();<br>    user.setName(&quot;User&#39;s name&quot;);<br>    user.setEmail(&quot;User&#39;s email&quot;);<br>    userRepository.save(user);<br>}</pre><p>And add the function to be executed in the event listener :</p><pre>@EventListener<br>public void seed(ContextRefreshedEvent event) {<br>    seedUsersTable();<br>}</pre><h3>Conclusion</h3><p>We have seen how to seed data on application startup. We can use seeders to create default admin accounts, or any default data that we need to be theire for the application.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b9ec07808af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A utility-first CSS framework for rapid UI development : Tailwind CSS]]></title>
            <link>https://anasselbaz0.medium.com/a-utility-first-css-framework-for-rapid-ui-development-tailwind-css-88b1ed173cd5?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/88b1ed173cd5</guid>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Fri, 04 Sep 2020 13:08:07 GMT</pubDate>
            <atom:updated>2020-09-04T13:08:07.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>A utility-first CSS framework for rapid UI development : Tailwind CSS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*luPnNr5oFjpmvmcx" /><figcaption>Photo by <a href="https://unsplash.com/@kobuagency?utm_source=medium&amp;utm_medium=referral">KOBU Agency</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is Tailwind CSS</h3><p>Tailwind CSS is a utility-first css framework. It isn’t similar to other css framework. It doesn’t offer predesigned components like buttons, cards, alerts… <br>Instead, Tailwind provides low-level utility classes that let you build completely custom designs without ever leaving your HTML</p><h3>Why use Tailwind CSS</h3><p>Maybe you still not convinced to use Tailwind and betray other frameworks like Bootstrap, Foundation or Bulma. Let me give you some reasons why to consider using Tailwind CSS.</p><h4>A utility-first framework</h4><p>Let’s first discuss what utility-first css term means. Tailwind is basically a big set of css classes, that you can use to change certain style elements of your components,and build your own design system.</p><p>For example, this snippet of code :</p><pre>&lt;button class=&quot;bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded&quot;&gt;<br>  Button<br>&lt;/button&gt;</pre><p>Returns :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aR1OhKEK3AyHODTSfS7G5Q.png" /><figcaption>Button using tailwind css</figcaption></figure><h4>Customization</h4><p>Because Tailwind is a framework for building bespoke user interfaces, it has been designed from the ground up with customization in mind.</p><p>By default, Tailwind will look for an optional tailwind.config.js file at the root of your project where you can define any customizations. Generate a Tailwind config file for your project using the Tailwind CLI utility included when you install the tailwindcss npm package:</p><pre>npx tailwindcss init</pre><p>If you’d rather scaffold a complete configuration file that includes all of Tailwind’s default configuration, use the --full option:</p><pre>npx tailwindcss init --full</pre><h4>Ease of use</h4><p>About the naming scheme though. It’s arguably one of the most important parts of any heavy utility-based library, and Tailwind made it just right. p-{n} for padding, text-white for setting color, -{n} for using a certain value for the utility, and md: or hover: for handling breakpoints and different states of the element - all that is truly brilliant!</p><p>Since Tailwind provides all the naming and organization, it’s very consistent across projects. So if a developer is familiar with Tailwind at all, chances are they can jump into a new Tailwind project with very little trouble.</p><h3>Down sides</h3><p>In my opinion, while the whole concept of utility-first sounds great on paper, but it could be a <strong>double edged sword. </strong>In fact, and for a little bit complex use case than a button, a tailwind styled HTML block will look <strong>crowded.</strong></p><p>That’s an example which a took from the landing page of <a href="https://tailwindcss.com/">Tailwind CSS</a> :</p><pre>&lt;div class=&quot;md:flex&quot;&gt;<br>  &lt;div class=&quot;md:flex-shrink-0&quot;&gt;<br>    &lt;img class=&quot;rounded-lg md:w-56&quot; src=&quot;...&quot; alt=&quot;Woman paying for a purchase&quot;&gt;<br>  &lt;/div&gt;<br>  &lt;div class=&quot;mt-4 md:mt-0 md:ml-6&quot;&gt;<br>    &lt;div class=&quot;uppercase tracking-wide text-sm text-indigo-600 font-bold&quot;&gt;Marketing&lt;/div&gt;<br>    &lt;a href=&quot;#&quot; class=&quot;block mt-1 text-lg leading-tight font-semibold text-gray-900 hover:underline&quot;&gt;Finding customers for your new business&lt;/a&gt;<br>    &lt;p class=&quot;mt-2 text-gray-600&quot;&gt;Getting a new business off the ground is a lot of hard work. Here are five ideas you can use to find your first customers.&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Do you feel what I feel? Isn’t the HTML snippet here getting a little…?</p><h4>No predefined components</h4><p>Tailwind do not provide predefined components, and that doesn’t help when we need to rapidly create a generic component. A button, a Card, or an input in a form are present in most of the projects.</p><h3>Getting started with Tailwind in React Js</h3><p>First, let’s create a React application, by run the command below:</p><pre>npx create-react-app react-tailwindcss &amp;&amp; cd react-tailwindcss</pre><p>Next, we install a few development dependencies. You can use any of the options that work for you.</p><h4>USING NPM</h4><pre>npm install tailwindcss postcss-cli autoprefixer -D</pre><h4>USING YARN</h4><pre>yarn add tailwindcss postcss-cli autoprefixer -D</pre><p>We need to initialize Tailwind CSS by creating the default configurations. Type the command below in your terminal:</p><pre>npx tailwind init tailwind.js --full</pre><p>With so many people <strong>working from home</strong>, we thought we would bring our <em>Smashing Workshops</em> from our home offices to yours. Meet <a href="https://www.smashingconf.com/online-workshops/"><strong>online front-end &amp; UX workshops</strong></a>, with practical takeaways, <strong>interactive exercises</strong>, recordings and a friendly Q&amp;A.</p><p><a href="https://smashed.by/featurepanelow">Check upcoming workshops ↬</a></p><h3>Getting Started</h3><p>To set up our project, we’ll scaffold a new React app using create-react-app. If you have already done this, skip this process, otherwise, run the command below:</p><pre>npx create-react-app react-tailwindcss &amp;&amp; cd react-tailwindcss</pre><p>Next, we install a few development dependencies. You can use any of the options that work for you.</p><h4>Using npm</h4><pre>npm install tailwindcss postcss-cli autoprefixer -D</pre><h4>Using Yarn</h4><pre>yarn add tailwindcss postcss-cli autoprefixer -D</pre><p>We need to initialize Tailwind CSS by creating the default configurations. Type the command below in your terminal:</p><pre>npx tailwind init --full</pre><p>This command creates a <strong>tailwind.config.js</strong> in your project’s base directory; the configuration file that we talked about.</p><h4>How To Configure PostCSS?</h4><p>The PostCSS documentation states that:</p><blockquote><em>“PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.”</em></blockquote><h4>WHY AUTOPREFIXER ?</h4><p>It’s necessary to install Autoprefixer alongside Tailwind CSS because Autoprefixer usually tracks <a href="https://caniuse.com/">caniuse.com</a> to see which CSS properties need to be prefixed. Hence, Tailwind CSS does not provide any vendor prefixing. If you’re curious as a cat in regards to <strong>PostCSS</strong> navigate to their <a href="https://github.com/postcss/postcss">documentation.</a></p><p>Create a PostCSS configuration file in your base directory manually or using the command:</p><pre>touch postcss.config.js</pre><p>Add the following lines of code to your PostCSS file:</p><pre>const tailwindcss = require(&#39;tailwindcss&#39;);<br>module.exports = {<br>    plugins: [<br>        tailwindcss(&#39;./tailwind.config.js&#39;),<br>        require(&#39;autoprefixer&#39;)<br>    ],<br>};</pre><p>Because PostCSS is necessary to lint our CSS, hence this configuration.</p><h4>Code Steps</h4><ol><li>We fetched the Tailwind CSS package and placed it in a variable.</li><li>We wrapped <strong>tailwind.config.js</strong> (our default base configuration) in our tailwindcss variable.</li><li>We fetched the autoprefixer package.</li></ol><h4>Inject Tailwind CSS</h4><p>Create a folder styles inside the src folder. And open it.</p><pre>cd src;</pre><pre>mkdir styles;</pre><pre>cd styles;</pre><p>Then, create a file named tailwind.css (this name doesn’t have to be exactly like I wrote it, you can choose whatever name you want, just ensure to adapt it with the rest of the configuration).</p><pre>touch tailwind.css</pre><p>Add the following to your <em>tailwind.css</em> file.</p><pre>@tailwind base;</pre><pre>@tailwind components;</pre><pre>@tailwind utilities;</pre><h4>CSS BUILD</h4><p>To configure our application to build the CSS styles each time we run either the npm start or yarn start command.</p><p>Open your <em>package.json</em> file and add the snippet below the script part of your <em>package.json</em> file:</p><pre>&quot;scripts&quot;: {<br>    ...<br>    &quot;start&quot;: &quot;npm run watch:css &amp;&amp; react-scripts start&quot;,<br>    &quot;build&quot;: &quot;npm run build:css &amp;&amp; react-scripts build&quot;,<br>    &quot;test&quot;: &quot;react-scripts test&quot;,<br>    &quot;eject&quot;: &quot;react-scripts eject&quot;,<br>    &quot;build:css&quot;: &quot;postcss src/styles/tailwind.css -o src/styles/main.css&quot;, <br>    &quot;watch:css&quot;: &quot;postcss src/assets/tailwind.css -o src/assets/main.css&quot;,<br>    ...<br>},</pre><h4>IMPORT THE CSS</h4><p>Open your <em>index.js</em> file, and import the <em>main.css file :</em></p><pre>import &#39;./styles/main.css&#39;</pre><p>Now, you’re ready to go!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88b1ed173cd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a React Front-End interacting with Hasura Back-End trough GraphQL— Part 2]]></title>
            <link>https://anasselbaz0.medium.com/build-a-react-front-end-interacting-with-hasura-back-end-trough-graphql-part-2-37b9b701b488?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/37b9b701b488</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[hasura]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Sun, 10 May 2020 04:01:43 GMT</pubDate>
            <atom:updated>2020-05-10T04:01:43.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TZqa7AVMsdRqH7K5F6QUQ.png" /><figcaption>React/QraphQl/Hasura</figcaption></figure><p>Welcome everyone,</p><p>If you didn’t read the first part, here is the link : <a href="https://medium.com/@anasselbaz0/how-to-create-a-scalable-and-extensible-back-end-instantly-with-hesura-part-1-a26dab20296d"><strong>Part 1</strong></a></p><p>In he first part, we have created the server, Backend with Hasura and GraphQL, so we need to build a Frontend to consume it.<br>I have chosen React as a tool to do the mission.</p><h3>1. Set-up the environment :</h3><p>→ First of all, let’s create a new React app using terminal :</p><blockquote><strong><em>npx create-react-app movies</em></strong></blockquote><p>→ Then, inside the app folder, we run the command :</p><blockquote><strong><em>npm install graphql </em></strong><a href="http://twitter.com/apollo/client"><strong><em>@apollo/client</em></strong></a><strong><em> react-router-dom </em></strong><a href="http://twitter.com/material"><strong><em>@material</em></strong></a><strong><em>-ui/core </em></strong><a href="http://twitter.com/material"><strong><em>@material</em></strong></a><strong><em>-ui/styles</em></strong></blockquote><p>Each of these tools are for a good reason. In fact, graphql and apollo are for GraphQl Queries, and <a href="https://medium.com/u/9d99f1b2974b">Material-UI</a> is for styling.</p><p>→ Open your favorite editor and start the React app with :</p><blockquote><strong><em>npm start</em></strong></blockquote><h3>2. Display the movies :</h3><p>We will create a components folder, in which we will store all of our components.</p><p>Let’s edit the App component :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0atPV5KDaxophEcrwPQojQ.png" /></figure><p>In the App component, we set up a graphQL client (The backend) with Apollo, and wrap the application with the Apollo Provider.</p><p>Then we will be creating the component that will display the movies from the API in the screen :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vp3v1czxiS_FIGBx5Z8PxA.png" /></figure><p>The component Movies has a job. It is to map through movies that it bring them from the back-end using a GraphQL query.<br>The query gives us back all the movies ordered by it’s modification date. The Component Movies display them all;</p><p>And of course, after we put some styles, here is the result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrATFZ-Abq57GnT_k6Nf-A.png" /></figure><h3>3. Add a Serach Bar :</h3><p>Now, we will add a search bar by adding a state: {title: ‘’}to App, and an input which have a handler <strong>searchHandler, </strong>it’s triggered by changing the value of the input.<br>Once the input value change, the handler will set the title value on the state to the input value.<br>Notice that the component Movies takes as prop the title in the state, it means when the title value change, it’s triggering the Movies component to re-render.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3hnr9d7iXAPkXy1RA1LZQ.png" /></figure><p>We have to adapt the Movies component to act as the title change, so we’ll use the <strong>filter()</strong> function of JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tDDMl3Ob5vqSL_ybsmTOw.png" /></figure><p>This line of code takes all the movies and filters them to keep those whose titles include the title sought.</p><p>Here is the final result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vd2D21_QKwcWB1fAZ4vLBg.png" /></figure><blockquote><strong>Thank you for reading !</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37b9b701b488" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Scalable and extensible Back-End instantly with HESURA — Part 1]]></title>
            <link>https://anasselbaz0.medium.com/how-to-create-a-scalable-and-extensible-back-end-instantly-with-hesura-part-1-a26dab20296d?source=rss-37637b09283a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a26dab20296d</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[hasura]]></category>
            <dc:creator><![CDATA[Anass ELBAZ]]></dc:creator>
            <pubDate>Thu, 07 May 2020 02:15:32 GMT</pubDate>
            <atom:updated>2020-05-07T02:20:01.253Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Scalable and extensible Back-End instantly with HASURA — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Ks97_651DyDK6nl-.png" /></figure><h3>Introduction</h3><p>In this tutorial, I will show you how to create a complete Back-End from scratch, using <strong>Hasura</strong>.</p><figure><img alt="Data Workflow" src="https://cdn-images-1.medium.com/max/448/0*upsCqL6fZrNKGXQi.gif" /></figure><p><strong>Hasura</strong> is an <a href="https://github.com/hasura/graphql-engine">open source</a> engine that connects to your databases &amp; microservices and auto-generates a production-ready GraphQL backend.</p><p>It uses Real-time GraphQL on PostgreSQL, like the image ←←← visualise.</p><h3>Step #1: Create the HASURA API &amp; Deploy it in HEROKU</h3><p>→ Go to <a href="https://hasura.io/"><strong>https://hasura.io/</strong></a></p><p>→ Click the green button <strong>Try…on HEROKU.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbvqPO_JtQMQi8UrmWjTew.png" /></figure><p>→ Then click <strong>Deploy to Heroku.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MGts2dXDLuuKUsc5V076A.png" /></figure><p>→ Enter the name of the application, in my case I did <strong><em>movies-space, </em></strong>then click Deploy app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2XfWau0QDtiy2TOR1GYVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jM9cFE2RVv-MoMWZXEh5pA.png" /></figure><p>→ We click <strong>View, </strong>and here we GOOO, our Back-End Application is created with HASURA and deployed into HEROKU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MM5ng-ogMn6d2yhoQChwDw.png" /></figure><h3>Step #2: Create data</h3><p>We move into the DATA panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uawfq609qRu2PWucgab6Tw.png" /></figure><p>And we create a table by clicking on the yellow button. After we tape the table name, we must declare some columns of the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Evmtw-h_PznSOUd6Rs-uQ.png" /></figure><p>In the Frequently used columns we find some popular column declarations, and we complete the other declarations ourselves :</p><p>j</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ReFNDXX-JrTJqwpgXozBKg.png" /></figure><h4>Notice:</h4><p>I selected <strong>id</strong> as a <strong>Primary Key</strong>.</p><p>This is a simple table of movies,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-c6xWpWFXlbeEe7ECJkQ3g.png" /></figure><p>Now, we are able to add data to our movie table like that :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WcvibDOoZptmBV9xeIXnNA.png" /></figure><h3>Step #3: Query data with GraphiQL</h3><p>We go to the panel GRAPHIQL :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOqKbk8bmfDNWjDRE0rAKw.png" /></figure><p>Then We can construct the GraphiQL Query in the Explorer, we select attributes that we want to query</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FQ_pA9Oeup5RAy9Ehvi87Q.png" /></figure><p>And BOOM …</p><p>In the next part, I will build the client (Front-End) for this API …</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a26dab20296d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>