<?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: Rocio Jacob</title>
    <description>The latest articles on DEV Community by Rocio Jacob (@rochijacob).</description>
    <link>https://dev.to/rochijacob</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F419762%2Fafb591bb-d4d0-41c7-998e-2a37813e2000.png</url>
      <title>DEV Community: Rocio Jacob</title>
      <link>https://dev.to/rochijacob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rochijacob"/>
    <language>en</language>
    <item>
      <title>Vibe coding got me 80% there. Spec-Driven Development got me the other 20%.</title>
      <dc:creator>Rocio Jacob</dc:creator>
      <pubDate>Fri, 04 Sep 2026 19:46:35 +0000</pubDate>
      <link>https://dev.to/rochijacob/vibe-coding-got-me-80-there-spec-driven-development-got-me-the-other-20-12hk</link>
      <guid>https://dev.to/rochijacob/vibe-coding-got-me-80-there-spec-driven-development-got-me-the-other-20-12hk</guid>
      <description>&lt;p&gt;I like vibe coding. I'm not here to shame anyone out of it. Some of the best things I've shipped started as a half-formed idea typed into a chat box at 11pm.&lt;/p&gt;

&lt;p&gt;But if you've done this for more than a weekend, you know the shape of the problem. The first prompt is magic. The fifth one is negotiation. By the fifteenth you're re-explaining a decision you already made twice, the agent has quietly renamed your data model, and you're one "fix the header" away from deleting the folder and starting over.&lt;/p&gt;

&lt;p&gt;The bottleneck was never the code. The agent writes code faster than I ever will. The bottleneck is &lt;strong&gt;clarity&lt;/strong&gt; — and clarity is the one thing I kept keeping in my head instead of in the repo.&lt;/p&gt;

&lt;p&gt;That's the gap Spec-Driven Development fills, and Spec Kit is the toolkit that makes it practical.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Spec-Driven Development?
&lt;/h2&gt;

&lt;p&gt;SDD is a simple inversion: &lt;strong&gt;the specification is the artifact you maintain, and the code is what gets generated from it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not "write a PRD, then throw it away once real work starts." The spec lives in the repo, next to the code, in version control, and it's the thing you edit when you want the software to change.&lt;/p&gt;

&lt;p&gt;A real spec answers three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt; the system does — entities, flows, screens, rules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it must behave under constraints&lt;/strong&gt; — auth, performance, compatibility, accessibility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why&lt;/strong&gt; the key decisions were made&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And it deliberately does &lt;em&gt;not&lt;/em&gt; answer "which framework." That comes later, on purpose.&lt;/p&gt;

&lt;p&gt;The reason this matters more now than it did in 2015: your agent doesn't have your context. It has whatever you gave it in the last 4,000 tokens. A spec is context that survives a new chat window, a new model, and a colleague who joins on Tuesday.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what is Spec Kit?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;Spec Kit&lt;/a&gt; is GitHub's open-source toolkit for doing this. It launched in September 2025 as an experiment and it did &lt;em&gt;not&lt;/em&gt; stay an experiment: 130K+ stars, 270+ contributors, 38 agent integrations, and a whole ecosystem of community extensions and presets.&lt;/p&gt;

&lt;p&gt;Install and scaffold:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uv tool &lt;span class="nb"&gt;install &lt;/span&gt;specify-cli
specify init my-project &lt;span class="nt"&gt;--integration&lt;/span&gt; copilot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That drops a &lt;code&gt;.specify/&lt;/code&gt; folder plus slash commands into your agent (Copilot, Claude Code, Codex, Gemini, Cursor, Kiro, Zed — most of them). Then the workflow runs in chat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/speckit.constitution → /speckit.specify → /speckit.clarify → /speckit.checklist
→ /speckit.plan → /speckit.tasks → /speckit.analyze → /speckit.implement
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every step produces a Markdown file that feeds the next one. Nothing is a black box. No proprietary editor. You can open any of it and type over it with your own hands, which you absolutely should.&lt;/p&gt;

&lt;p&gt;Two pieces deserve special attention:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The constitution&lt;/strong&gt; (&lt;code&gt;.specify/memory/constitution.md&lt;/code&gt;) holds your non-negotiables. "Static-first delivery." "No new dependencies without justification." "Every migration ships with a rollback." Every later phase is checked against it. This is the single highest-leverage file in the whole setup, and most people leave it as boilerplate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The gates&lt;/strong&gt; — &lt;code&gt;/speckit.clarify&lt;/code&gt;, &lt;code&gt;/speckit.checklist&lt;/code&gt;, &lt;code&gt;/speckit.analyze&lt;/code&gt; — are what separate this from prettier prompting. &lt;code&gt;clarify&lt;/code&gt; hunts for ambiguity before you plan. &lt;code&gt;checklist&lt;/code&gt; grades the requirements themselves. &lt;code&gt;analyze&lt;/code&gt; cross-checks spec vs. plan vs. tasks &lt;em&gt;before&lt;/em&gt; a single file gets written. For a quick prototype you can skip them. For anything you'll have to maintain, don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would I use it?
&lt;/h2&gt;

&lt;p&gt;Four honest reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. It moves the argument earlier.&lt;/strong&gt; Fixing a misunderstanding in a Markdown file costs a minute. Fixing it after 40 generated files costs an afternoon and your patience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. It makes the work reviewable by people who don't read code.&lt;/strong&gt; This is the one that changed things for me. A spec is something you can send to a stakeholder, a PM, or a boss, and get real feedback on. Try doing that with a chat transcript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Model churn stops being a threat.&lt;/strong&gt; If the agent produced something mediocre, you don't lose the thinking. Delete the source, switch models, re-run &lt;code&gt;/speckit.implement&lt;/code&gt;. Your spec is the durable asset; the implementation is disposable. That's a much better position to be in every time a new model drops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. It scales past one person.&lt;/strong&gt; Chat context doesn't merge. Markdown in a git branch does.&lt;/p&gt;

&lt;h2&gt;
  
  
  How will my projects actually improve?
&lt;/h2&gt;

&lt;p&gt;Concretely, from the pattern I keep seeing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fewer "start over from scratch" cycles.&lt;/strong&gt; The rework loop shrinks because the misunderstanding gets caught upstream.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge cases you wouldn't have thought of.&lt;/strong&gt; The spec templates force sections for acceptance scenarios and edge cases. The agent fills them, you correct them. Free QA thinking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding stops being a conversation.&lt;/strong&gt; "How does this work?" → read &lt;code&gt;specs/001-*/spec.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better decisions, because you had to write them down.&lt;/strong&gt; Half the value shows up before you run anything. Writing the spec is where you notice that you never decided how episodes are ordered, or what happens when the list is empty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured additive change.&lt;/strong&gt; New feature = new spec folder = new branch. Your third feature doesn't quietly rewrite your first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The honest trade: it's slower on day one. For a landing page you'll ship this afternoon, this is ceremony. For anything with more than one screen, more than one contributor, or a lifespan longer than a demo, it pays for itself fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are there real-world examples?
&lt;/h2&gt;

&lt;p&gt;Yes, and I want to give you both halves of the picture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The supportive side:&lt;/strong&gt; GitHub dogfoods Spec Kit on Spec Kit itself for substantial features. AWS built the same philosophy directly into Kiro and publishes customer cases where multi-day features shipped in a fraction of the human time when authored spec-first. There's a growing academic literature framing specs as the version-controlled contract between humans and agents, and community walkthroughs now cover brownfield adoption in .NET, Java, and Go/React codebases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The skeptical side, which you should read too:&lt;/strong&gt; Thoughtworks put SDD in the &lt;em&gt;Assess&lt;/em&gt; ring of their Technology Radar, not Adopt, and they push back hard on the idea that specs replace code as the source of truth. There's a fair critique circulating that SDD is contract-design and waterfall with better branding — and the sharpest version of that critique is also the best argument &lt;em&gt;for&lt;/em&gt; it: the value is the thinking you do while writing the spec, not the tooling around it. Vendor-reported multipliers should be treated as directional, not proven.&lt;/p&gt;

&lt;p&gt;My read: the durable, less-disputable finding is that the human's time moves from typing implementation to specifying and reviewing. Whether that's a 3x or a 1.2x depends entirely on you.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I apply it to a Product Engineering pipeline?
&lt;/h2&gt;

&lt;p&gt;This is where it gets interesting, because the workflow maps almost one-to-one onto roles you already have.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Who owns it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Guardrails&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.constitution&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tech lead + product, once per repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What &amp;amp; why&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.specify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Product / PM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kill ambiguity&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/speckit.clarify&lt;/code&gt; + &lt;code&gt;/speckit.checklist&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Product + eng together&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.plan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Engineering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breakdown&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.tasks&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Engineering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consistency audit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.analyze&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whoever reviews the PR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/speckit.implement&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The agent, supervised&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few things that make this work in a real org rather than a demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The spec review is the new design review.&lt;/strong&gt; Put it in the PR. That's your approval gate, and it's a much better artifact to argue over than a diff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One feature, one branch, one spec folder.&lt;/strong&gt; Spec Kit picks up the active feature from your git branch, so this falls out naturally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brownfield is supported and it's the normal case.&lt;/strong&gt; Don't try to retro-spec your whole system. Initialize in place with &lt;code&gt;specify init --here --force --integration &amp;lt;key&amp;gt;&lt;/code&gt; on a clean review branch, write a constitution from rules that are &lt;em&gt;already true&lt;/em&gt; in your repo, then pick one bounded change — a CSV export, one endpoint — and run the loop on that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide up front how specs age.&lt;/strong&gt; Frozen historical snapshot per feature, or living contract you regenerate from? Both are valid. Choosing neither is how you end up with docs that lie.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wire the constitution into CI eventually.&lt;/strong&gt; Community extensions already do architecture and compliance gates. That's where this stops being a personal workflow and starts being governance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tips to actually get value out of it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write the constitution yourself.&lt;/strong&gt; Let the agent draft it, then delete two-thirds. Short and true beats long and aspirational. Unrealistic rules become noise the agent learns to ignore.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use different models for different phases.&lt;/strong&gt; Reasoning-heavy models are good at scaffolding specs and plans; I switch for implementation. Experiment — it's the only way to find out what works for your stack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never skip &lt;code&gt;/speckit.clarify&lt;/code&gt; on real work.&lt;/strong&gt; Unresolved &lt;code&gt;[NEEDS CLARIFICATION]&lt;/code&gt; markers are the agent telling you where it's about to guess.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edit the Markdown with your hands.&lt;/strong&gt; People freeze up because "the LLM wrote it." It's a text file. If you want the logo centered, add a functional requirement and move on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't over-specify.&lt;/strong&gt; If your spec has become pseudocode, you've written the program twice. Specify behavior and constraints, not implementation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement in phases.&lt;/strong&gt; Core flow first, validate, then the rest. Dumping 60 tasks into one run saturates context and quality falls off a cliff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the spec free of tech choices.&lt;/strong&gt; It feels unnatural. Do it anyway — it's what lets you regenerate the same product on a different stack later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feed it real design context.&lt;/strong&gt; Hook up MCP servers (Figma, your issue tracker) so the plan references your actual design system instead of inventing one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat a bad output as a spec bug first.&lt;/strong&gt; Before you re-prompt, go read what the spec actually said. Nine times out of ten it's ambiguous there.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What should I research before starting?
&lt;/h2&gt;

&lt;p&gt;Set aside an afternoon, not a week:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Your toolchain&lt;/strong&gt;: &lt;code&gt;uv&lt;/code&gt; / &lt;code&gt;uvx&lt;/code&gt; for the CLI, and which integration key matches the agent you already use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The core concept pages&lt;/strong&gt; in the Spec Kit docs — "What is SDD?" and "Spec Persistence Models." Those two decide how you'll work six months in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EARS notation&lt;/strong&gt; for writing requirements that are unambiguous by construction. Cheap to learn, big payoff on spec quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The critiques.&lt;/strong&gt; Read the Thoughtworks position and the "same patterns, new hype" argument before you adopt this. You'll use the tool better if you know where it's weak.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your own repo's actual conventions&lt;/strong&gt; — README, ADRs, CI config, contribution guide. That's the raw material for a constitution that's true instead of invented.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The alternatives&lt;/strong&gt;, so you're choosing rather than defaulting: Kiro, cc-sdd, BMAD, and the Spec Kit preset ecosystem if you want a different process shape entirely.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The one-line version
&lt;/h2&gt;

&lt;p&gt;Vibe coding optimizes for the first version. Spec-Driven Development optimizes for every version after that.&lt;/p&gt;

&lt;p&gt;Implementation is cheap now. Clarity isn't. Spec Kit is a way of putting your clarity somewhere it won't evaporate when you close the tab.&lt;/p&gt;

&lt;p&gt;Start small: pick one feature you were going to vibe out this week, run it through the loop instead, and compare how it feels on the third change request.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spec Kit repo and docs — &lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;https://github.com/github/spec-kit&lt;/a&gt; · &lt;a href="https://github.github.com/spec-kit/" rel="noopener noreferrer"&gt;https://github.github.com/spec-kit/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Adopting Spec Kit in an existing project — &lt;a href="https://github.github.com/spec-kit/guides/existing-projects.html" rel="noopener noreferrer"&gt;https://github.github.com/spec-kit/guides/existing-projects.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Thoughtworks on spec-driven development — &lt;a href="https://www.thoughtworks.com/insights/blog/agile-engineering-practices/spec-driven-development-unpacking-2025-new-engineering-practices" rel="noopener noreferrer"&gt;https://www.thoughtworks.com/insights/blog/agile-engineering-practices/spec-driven-development-unpacking-2025-new-engineering-practices&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Spec-Driven Development in 2026: What It Is, the Tooling, and How Teams Actually Use It" (DEV) — &lt;a href="https://dev.to/krlz/spec-driven-development-in-2026-what-it-is-the-tooling-and-how-teams-actually-use-it-2fk2"&gt;https://dev.to/krlz/spec-driven-development-in-2026-what-it-is-the-tooling-and-how-teams-actually-use-it-2fk2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Spec-Driven Development for Agentic Software Engineering" (arXiv) — &lt;a href="https://arxiv.org/html/2609.00252v1" rel="noopener noreferrer"&gt;https://arxiv.org/html/2609.00252v1&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Getting Started with AWS Elastic Beanstalk: A Step-by-Step Guide</title>
      <dc:creator>Rocio Jacob</dc:creator>
      <pubDate>Fri, 19 May 2023 09:49:09 +0000</pubDate>
      <link>https://dev.to/muvinai/getting-started-with-aws-elastic-beanstalk-a-step-by-step-guide-4o4a</link>
      <guid>https://dev.to/muvinai/getting-started-with-aws-elastic-beanstalk-a-step-by-step-guide-4o4a</guid>
      <description>&lt;p&gt;In today's rapidly evolving world of web development, deploying and managing applications in the cloud has become a crucial aspect of every project. AWS Elastic Beanstalk simplifies the process by providing a platform-as-a-service (PaaS) solution that streamlines the deployment and management of your applications. In this tutorial, we will walk you through the step-by-step process of setting up a project in AWS Elastic Beanstalk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Sign in to the AWS Management Console
&lt;/h3&gt;

&lt;p&gt;To begin, log in to the AWS Management Console using your AWS account credentials. If you don't have an AWS account, you can sign up for one easily on the AWS website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6jcce5orx5whacv03q0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6jcce5orx5whacv03q0.png" alt="AWS Console" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Navigate to Elastic Beanstalk
&lt;/h3&gt;

&lt;p&gt;Once you're logged in, navigate to the Elastic Beanstalk service. You can find it by searching for "Elastic Beanstalk" in the AWS Management Console search bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z8vvneyompb8vfvbasi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z8vvneyompb8vfvbasi.png" alt="Elastic Beanstalk Service" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Create a New Application
&lt;/h3&gt;

&lt;p&gt;Click on the "Create Application" button to start creating your new application. Provide a meaningful name for your application and optionally enter a description to help identify its purpose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrrzi57wdvdwlxeuadik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrrzi57wdvdwlxeuadik.png" alt="Create Application" width="800" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Create an Environment
&lt;/h3&gt;

&lt;p&gt;After creating your application, the next step is to set up an environment where your application will run. Click on the "Create environment" button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Configure the Environment
&lt;/h3&gt;

&lt;p&gt;Choose the environment type that suits your project, such as a Web Server Environment or a Worker Environment. Provide a unique name for your environment and specify the URL that users will access your application from.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Select the Platform
&lt;/h3&gt;

&lt;p&gt;Choose the platform that matches your project's technology stack. Elastic Beanstalk supports a wide range of platforms, including Java, Node.js, Python, Ruby, PHP, and more. Select the platform that best suits your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Customize Additional Settings
&lt;/h3&gt;

&lt;p&gt;Take advantage of the additional settings to fine-tune your environment. Customize the platform version, database configuration, security settings, and environment variables as needed to meet your application's specific requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8: Review and Create the Environment
&lt;/h3&gt;

&lt;p&gt;Review all the configuration details you have provided and ensure everything is correct. Once you are satisfied, click on the "Create environment" button to start the deployment process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 9: Configure Application Code Deployment
&lt;/h3&gt;

&lt;p&gt;Now that your environment is set up, you can configure the deployment of your application code. Choose the desired method: uploading a ZIP file or connecting to a code repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 10: Deploy Your Application
&lt;/h3&gt;

&lt;p&gt;With your environment and code deployment configured, you are ready to deploy your application. Elastic Beanstalk will create the necessary resources and deploy your application code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 11: Access Your Application
&lt;/h3&gt;

&lt;p&gt;Once the deployment is complete, you can access your application by visiting the URL provided in the Elastic Beanstalk environment dashboard. Congratulations! Your application is up and running in Elastic Beanstalk.&lt;/p&gt;

&lt;p&gt;AWS Elastic Beanstalk simplifies the process of deploying and managing applications in the cloud. By following the steps outlined in this tutorial, you have learned how to create an application, set up an environment, configure instance and capacity settings, customize additional configurations, and deploy your application code. Elastic Beanstalk handles the underlying infrastructure, allowing you to focus on your application development. Embrace the power of Elastic Beanstalk and enjoy the seamless experience of deploying your applications in the cloud.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>elasticbeanstalk</category>
      <category>hosting</category>
      <category>howto</category>
    </item>
    <item>
      <title>Building and distributing Vite.js projects with Amplify</title>
      <dc:creator>Rocio Jacob</dc:creator>
      <pubDate>Tue, 04 Oct 2022 14:20:09 +0000</pubDate>
      <link>https://dev.to/muvinai/building-and-distributing-vitejs-projects-with-amplify-hdd</link>
      <guid>https://dev.to/muvinai/building-and-distributing-vitejs-projects-with-amplify-hdd</guid>
      <description>&lt;p&gt;On our last project we decided to use &lt;a href="https://vitejs.dev/" rel="noopener noreferrer"&gt;vite.js&lt;/a&gt;. We can now claim we &lt;strong&gt;LOVED IT&lt;/strong&gt;! We loved vite's speed regarding serving our file and found it extremely intuitive and right for the project.&lt;/p&gt;

&lt;p&gt;Yet development with vite implied quite a problem regarding our hosting on the web app. The fact vite is module based and has css code splitting, made the hosting of the project tough. &lt;/p&gt;

&lt;p&gt;When we first started hosting it on amplify, we had the issue that the enviroment was completely blank, and none of the page contents were fetched by the service. &lt;/p&gt;

&lt;p&gt;We fixed the initial problem by using the redirect AWS suggests for SPA's:&lt;br&gt;
&lt;code&gt;&amp;lt;/^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Beware with this redirect link as it's position on teh rewrites and redirects can affect the performance of the page.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So our rewrites and redirects page ended up looking like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlh10gh3pjsme3zfym9p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlh10gh3pjsme3zfym9p.png" alt="Image of our amplify redirects page" width="798" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we had to adapt the build settings so that the &lt;code&gt;dist&lt;/code&gt; folder vite creates can be found by amplify:&lt;/p&gt;

&lt;p&gt;Our build file ended up looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;span class="na"&gt;frontend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;phases&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;preBuild&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;npm run build --prod&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# IMPORTANT - Please verify your build output directory&lt;/span&gt;
    &lt;span class="na"&gt;baseDirectory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist&lt;/span&gt;
    &lt;span class="na"&gt;files&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*'&lt;/span&gt;
  &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;node_modules/**/*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After following this steps, we could host the webpage correctly, yet amplify still had arbitrary issues on fetching some webpages. For example redirects were not working and took us to a blank page that claimed Amplify CloudFrontURL couldn't find the page. &lt;/p&gt;

&lt;p&gt;Apparently some fractions of the code weren't being found. This is the problem that held us days, and to which we struggled to find the solution. The thing was, we had to change some things in &lt;code&gt;vite.config.js&lt;/code&gt; that were making the base of the project untraceable to amplify.&lt;/p&gt;

&lt;p&gt;Our &lt;code&gt;vite.config.js&lt;/code&gt; ended up looking like this. Adding &lt;code&gt;base: './index.html'&lt;/code&gt; was what managed to fix the mistake of arbitrary 404 we had:&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&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;vite&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;react&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;@vitejs/plugin-react&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;mkcert&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;vite-plugin-mkcert&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;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;https&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="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;react&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;mkcert&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
  &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./index.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./index.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// default&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./runtimeConfig&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./runtimeConfig.browser&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 hope this solution helps someone struggling with the same problem. &lt;/p&gt;

</description>
      <category>vite</category>
      <category>amplify</category>
      <category>aws</category>
    </item>
    <item>
      <title>Building a React Native Filter - Part 1</title>
      <dc:creator>Rocio Jacob</dc:creator>
      <pubDate>Thu, 17 Feb 2022 18:08:39 +0000</pubDate>
      <link>https://dev.to/muvinai/building-a-react-native-filter-part-1-21j7</link>
      <guid>https://dev.to/muvinai/building-a-react-native-filter-part-1-21j7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxwau6dlwf85sch0wfpj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxwau6dlwf85sch0wfpj.gif" alt="App Walkthrough" width="600" height="1297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A couple of weeks ago a client asked us to create an application that displayed all of it's stores. The app had to be built in &lt;strong&gt;React Native&lt;/strong&gt; in order to speed up development time and ensure compatibility among Android and IOS and had to include a full list of our client's stores. This list was fetched from a MongoDB collection, and came as an array of objects containing information for each store (such as location, phone number, email, coordinates). Obviously, a plain list of objects doesn't satisfy a customer, as scrolling through a 189 store list to find a specific one might be extremely painful. So with React Native (our choice to build fast compatible apps) we decided to create a filter. The filter we built included features such as &lt;strong&gt;searching, categorizing and ordering according to proximity&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;In this article, we will show you how the filter was built by using a &lt;u&gt;mock API&lt;/u&gt; to build a filter with search and categorization (in the future we will write another article to show how to handle location based objects, order them and filter them). The tutorial will not cover a step by step of the whole code, but will go through the most important parts when building it. You can find the whole code in &lt;strong&gt;this&lt;/strong&gt; &lt;a href="https://snack.expo.dev/@rochi/react-native-filter" rel="noopener noreferrer"&gt;&lt;strong&gt;Expo Snack&lt;/strong&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You will see this is a &lt;strong&gt;front-end built filter&lt;/strong&gt;, and doesn't use backend filtering. Although backend filtering is a good option (particularly to handle long lists), it works smoothly with the data we have. &lt;strong&gt;Bear in mind&lt;/strong&gt; if you have millions of elements mapping through them will impact negatively on the app's performance. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1j9ahi8xjcgi6h4vyd6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1j9ahi8xjcgi6h4vyd6.jpg" alt="Main view of our application" width="800" height="1731"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, to start we will be using &lt;a href="https://www.fruityvice.com/" rel="noopener noreferrer"&gt;Fruityvice's API&lt;/a&gt; that will bring a response with an array of objects containing different information about fruits. An example for the response we get is:&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;"genus"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Malus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Apple"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"family"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rosaceae"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"order"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rosales"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"nutritions"&lt;/span&gt;&lt;span class="p"&gt;:&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;span class="nl"&gt;"carbohydrates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;11.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"protein"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"fat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"calories"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"sugar"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;10.3&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;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&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;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;Let's get hands on it to the real code. The structure our project will take is: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A main App.js file where most of the work will happen, here we will set the main states and fetch our data. &lt;/li&gt;
&lt;li&gt;Components folder.&lt;/li&gt;
&lt;li&gt;Assets folder.&lt;/li&gt;
&lt;li&gt;Data folder in order to save the initial state some variables will have.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Fetching the API
&lt;/h2&gt;

&lt;p&gt;The first thing we should do, is fetch the API. We fetch it through a simple &lt;strong&gt;fetch function built in a useEffect&lt;/strong&gt;, meaning each time the component mounts, the API is fetched and the fruits "refresh". The response is saved as a json and we can now work with it.&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="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.fruityvice.com/api/fruit/all&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="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setFruits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setLoading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&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;h2&gt;
  
  
  Our App.js Component
&lt;/h2&gt;

&lt;p&gt;We create a &lt;code&gt;&amp;lt;SafeAreaView /&amp;gt;&lt;/code&gt; for our App.js (so that the content we build is contained within a visible space). Inside the SafeAreaView we will have three components, the &lt;strong&gt;AppBar&lt;/strong&gt; (that will hold the modal and a logo for our app), the &lt;strong&gt;modal&lt;/strong&gt; itself, and the &lt;strong&gt;Wrapper&lt;/strong&gt; (called &lt;code&gt;&amp;lt;FruitsWrapper /&amp;gt;&lt;/code&gt;) where we will render the "card-styled" list of fruits with their information.&lt;/p&gt;

&lt;p&gt;On the App.js we'll also do two things that will help us handle the Filtering correctly. &lt;/p&gt;

&lt;p&gt;First we'll set a couple of states:&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFruits&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialFilter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;intermediateFilter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIntermediateFilter&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialFilter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;modalVisible&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setModalVisible&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;fruits&lt;/em&gt; holds the array of objects we fetch from the API&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;filter&lt;/em&gt; filter is the real filter that will be applied when the user decides to APPLY the filter within the modal&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;intermediateFilter&lt;/em&gt; is a filter that is setted while the user interacts with the modal, once the apply button is pressed, the intermediateFilter becomes the actual filter&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;modalVisible&lt;/em&gt; will handle modal visibility &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why the intermediateFilter?&lt;/em&gt;&lt;/strong&gt; the intermediate filter ensures the fields the user clicks while in the modal will be applied correctly. We need to save the user choices as he/she advances through the modal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Both the intermediateFilter and the filter take up an &lt;em&gt;&lt;strong&gt;initialFilter&lt;/strong&gt;&lt;/em&gt;. What is this? The &lt;code&gt;initialFilter&lt;/code&gt; is a js written in our data folder. initialFilter is an object that hold's the initial state of the fields we are going to filter.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initialFilter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;genus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;carbohydrates&lt;/span&gt;&lt;span class="p"&gt;:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The AppBar
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c4sy0vuoolxtg74j6j7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c4sy0vuoolxtg74j6j7.jpg" alt="App Bar" width="799" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The App bar is extremely simple. We have a logo, and a button that when pressed will change the state of the &lt;code&gt;modalVisible&lt;/code&gt; variable to true and show us the modal. &lt;/p&gt;

&lt;h2&gt;
  
  
  Displaying the info
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshfihowh8uwc2kkcevvn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshfihowh8uwc2kkcevvn.jpg" alt="sample of " width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we filter we want to display multiple cards containing information about the fruits so we can then sort them according to the user's choices. For this we have two components &lt;code&gt;&amp;lt;FruitsWrapper /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;InfoCard/&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;FruitsWrapper /&amp;gt;&lt;/code&gt; is the wrapper where we map through the fruits and display them. In this Wrapper we will also have the &lt;u&gt;filtering instance&lt;/u&gt;. So as long as there no filters it will display the complete object we receive from the fetch. If there filters, we will push fruits to a new variable that will be empty. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;InfoCard/&amp;gt;&lt;/code&gt; is the UI of the card that will hold the object's info. We build only one object, and then map the fetch response and render each fruit (with it's information in the cards).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;&amp;lt;FruitsWrapper /&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This component is &lt;strong&gt;SUPER&lt;/strong&gt; important. As the logic applied here makes the magic to display the filtered content. &lt;/p&gt;

&lt;p&gt;You can see that at the beginning of the component I declared two boolean variables: &lt;code&gt;filterFruits&lt;/code&gt; and &lt;code&gt;empty&lt;/code&gt; (empty will not be used yet, but will serve us to display that no fruits were fetched). I then set up an &lt;strong&gt;empty filterArray&lt;/strong&gt; where the fruits I filter with my modal will be pushed. After doing this I set &lt;code&gt;filterFruits&lt;/code&gt; equal to &lt;code&gt;allFruits&lt;/code&gt;, the later one being the whole fruit array we brought on the first place. The following logic is key to filtering:&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filterFruits&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;filterFruits&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nx"&gt;filterFruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// I have two things, the filter and the fruits genus (in the array) so if I filter I only want to show the ones that match the genus&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;genus&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;genus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;genus&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;filterArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filterArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;filterFruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;filterArray&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="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;filterFruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;empty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The filtering happens if &lt;code&gt;filterFruits&lt;/code&gt; (before known as allFruits) is &lt;strong&gt;not undefined&lt;/strong&gt; (meaning it has some content) and the &lt;strong&gt;type of this is an object&lt;/strong&gt;. What we do is map through each fruit, if it &lt;u&gt;doesn't match&lt;/u&gt; the parameters we want it to, we &lt;strong&gt;return&lt;/strong&gt;, else we &lt;strong&gt;push it&lt;/strong&gt; to the &lt;code&gt;filterArray&lt;/code&gt;. If the filter array is bigger than 0 (meaning fruits were pushed) &lt;code&gt;filterArray&lt;/code&gt; (the one where we pushed) becomes &lt;code&gt;filterFruits&lt;/code&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Modal
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcqr48pwfdpktsco7kl5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcqr48pwfdpktsco7kl5.jpg" alt="An image of the App's modal" width="800" height="1731"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The modal is the most important part of this tutorial. For this we will use &lt;strong&gt;React Native's built in modal&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the application we built for the client we had two modal instances, the &lt;em&gt;filtering modal&lt;/em&gt; (that used the native modal) and an &lt;em&gt;alert modal&lt;/em&gt; (where we used &lt;a href="https://akveo.github.io/react-native-ui-kitten/" rel="noopener noreferrer"&gt;UI Kitten's&lt;/a&gt; modal). We like the native modal because it offers us the possibility of deciding how it transitions and it's easier to set it up fullscreen. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As we mentioned previously we chose to use an &lt;strong&gt;intermediate filter within the modal&lt;/strong&gt; so that the state management can be smooth, and we can access the different states (Remember that the &lt;code&gt;initalFilter&lt;/code&gt; was an object?). Yet, after the user click's the apply button, we want the &lt;code&gt;intermediateFilter&lt;/code&gt; to become the actual &lt;code&gt;filter&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A key thing we also have in this modal is the list of all the genus. Instead of mapping all the fruits and displaying the genus, in the App.js we created an array with &lt;strong&gt;all the unique genus&lt;/strong&gt; (so that we don't get them repeated). The following code creates an array of all the fruit.genus unique values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const genusResult = allFruits.map(item =&amp;gt; item.genus)
  .filter((value, index, self) =&amp;gt; self.indexOf(value) === index)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We loop through this array that we built to create the radio buttons, as you will see in the &lt;code&gt;RadioButton.js&lt;/code&gt; file. This file holds custom built Radio Buttons. The good thing about this is that they are fully customizable, and give us more control over the user selection. &lt;/p&gt;

&lt;p&gt;The thing is, the user can only select one genus, and when the user selects the genus selected is saved in the intermediate filter. Once the user decides which genus he/she wants to see, he applies the filter and because of the logic applied in the &lt;code&gt;&amp;lt;FruitsWrapper /&amp;gt;&lt;/code&gt; only the fruits that have that genus will be shown. &lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Remarks
&lt;/h2&gt;

&lt;p&gt;This was a quick tutorial over how to build the filter. We hope it was easy to follow and in the second part we will talk about querying filtering. &lt;/p&gt;

&lt;p&gt;Remember the full code is in our &lt;a href="https://snack.expo.dev/@rochi/react-native-filter" rel="noopener noreferrer"&gt;Expo Snack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
    </item>
  </channel>
</rss>
