<?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: Seth Hall</title>
    <description>The latest articles on DEV Community by Seth Hall (@sethburtonhall).</description>
    <link>https://dev.to/sethburtonhall</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F342538%2F87891d0b-7af0-488a-aacf-088a456b759d.png</url>
      <title>DEV Community: Seth Hall</title>
      <link>https://dev.to/sethburtonhall</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sethburtonhall"/>
    <language>en</language>
    <item>
      <title>#normalizetech</title>
      <dc:creator>Seth Hall</dc:creator>
      <pubDate>Mon, 21 Feb 2022 18:59:13 +0000</pubDate>
      <link>https://dev.to/sethburtonhall/normalizetech-59je</link>
      <guid>https://dev.to/sethburtonhall/normalizetech-59je</guid>
      <description>&lt;p&gt;The last few years of my web development journey have consisted of many ups and downs. Unfortunately, I don't remember all the ups but I know they occurred and I know I learned and progressed because of them. But I do remember every down because they tend to stand out in my mind a bit more. It is hard to forget the times you are undervalued, misunderstood and mistreated. Unfortunately, all these downs have occurred in the workplace. Because of these experiences, I have a renewed interest in mental health advocacy and psychological safety in the workplace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://virtualcoffee.io/" rel="noopener noreferrer"&gt;VirtualCoffee.io&lt;/a&gt; is one of my favorite communities. It provides a safe and encouraging place to talk about life and web development and has been a game changer for me. I enjoy hearing each person's unique perspective and our weekly chats are a highlight. Twitter is also a great place to build community. I am having great conversations and making new friends every day. A few weeks ago, I decided to share my thoughts in a Twitter thread and I created a new &lt;a href="https://twitter.com/hashtag/normalizetech?src=hashtag_click" rel="noopener noreferrer"&gt;hashtag&lt;/a&gt; in the process. This is a thread that I plan grow, adding new thoughts as they come up. This also felt like a worthy topic to turn into a blog post, so here we are. I plan to update here as well.&lt;/p&gt;

&lt;p&gt;Here is my &lt;a href="https://twitter.com/hashtag/normalizetech?src=hashtag_click" rel="noopener noreferrer"&gt;#normalizetech&lt;/a&gt; Twitter thread.&lt;/p&gt;

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

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



&lt;/p&gt;

&lt;p&gt;Let's dive in!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Normalize 9 to 5.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overtime should be an exception not the norm. If a job lists "paid overtime" then run.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normalize mental health days.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If we are overly stressed, anxious, fatigued, etc... the work suffers and nobody wins.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normalize pair programming and mentorship.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Development is hard y'all. Nobody should struggle alone. Pair programming and mentorship can boost confidence and build healthy relationships. It takes a village.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normalize 80/20.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Allowing one day a week for side projects, open source, community engagement, volunteering, a day of rest, etc.. can reinvigorate and make a positive impact on the world.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normalize Inclusivity &amp;amp; Diversity&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Although progress is being made, the lack of inclusivity and diversity in tech is still very prevalent. The more diversity the better since working alongside a variety of people and cultures increases empathy and creativity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normalize Psychological Safety&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No one should feel unsafe in the workplace. Period! Safety leads to trust, which leads to happiness, which leads to better ideas, which leads to people doing their best work. This should be a priority!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and here are a few community tweets!&lt;/p&gt;

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

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



&lt;/p&gt;

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

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



&lt;/p&gt;

&lt;p&gt;What are things that you feel should be normalized in tech? Comment below and thanks for reading!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cover image photo credit - &lt;a href="https://unsplash.com/photos/bKESVqfxass" rel="noopener noreferrer"&gt;https://unsplash.com/photos/bKESVqfxass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>normalizetech</category>
      <category>wellbeing</category>
      <category>mentalhealth</category>
    </item>
    <item>
      <title>More Dad Jokes!!</title>
      <dc:creator>Seth Hall</dc:creator>
      <pubDate>Fri, 18 Jun 2021 19:55:42 +0000</pubDate>
      <link>https://dev.to/sethburtonhall/build-in-public-aka-more-dad-jokes-2db0</link>
      <guid>https://dev.to/sethburtonhall/build-in-public-aka-more-dad-jokes-2db0</guid>
      <description>&lt;p&gt;I have been a member of &lt;a href="https://virtualcoffee.io/" rel="noopener noreferrer"&gt;VirtualCoffee.io&lt;/a&gt; for most of 2021. It is a wonderfully supportive community and to say that it has changed my life for the better is an understatement. I have learned so much from chatting and pair coding with fellow members, hanging out on the &lt;a href="https://virtualcoffee.io/events/" rel="noopener noreferrer"&gt;weekly coffee chats&lt;/a&gt;, listening to the VC &lt;a href="https://virtualcoffee.io/podcast/" rel="noopener noreferrer"&gt;podcast&lt;/a&gt;, and watching the awesome lightning talks and brown bag presentations ... AND I have made new friends along the way. Wins all around.&lt;/p&gt;

&lt;p&gt;Virtual Coffee also offers a &lt;a href="https://virtualcoffee.io/monthlychallenges/" rel="noopener noreferrer"&gt;monthly challenge&lt;/a&gt;. May's challenge was about giving meaningful and empathetic feedback. June's challenge is to build in public and the community has come together for daily stand-ups and encouragement. I was excited about this challenge and took the opportunity to build a fun project with a new stack, shared through this blog post, &lt;a href="https://www.twitch.tv/videos/1060069923" rel="noopener noreferrer"&gt;live stream&lt;/a&gt;, and &lt;a href="https://twitter.com/sethburtonhall/status/1403176619972386816" rel="noopener noreferrer"&gt;Twitter thread&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Build
&lt;/h2&gt;

&lt;p&gt;My criteria were to build something light and fun that could be completed within a week, to build something with a new stack, and of course to share my experience along the way. So, in celebration of Father's Day and all the hard joking dads out there, I decided to build an app with the icanhazdadjoke API. The app is small, consisting of a few API calls, a handful of unit tests, a bit of CSS, and a few easter eggs 👀, but this allowed me to focus on the new stack and building in public ... plus more dad jokes.&lt;/p&gt;

&lt;p&gt;Jump to the &lt;a href="https://more-dad-jokes.netlify.app/" rel="noopener noreferrer"&gt;App&lt;/a&gt; and &lt;a href="https://github.com/sethburtonhall/more-dad-jokes" rel="noopener noreferrer"&gt;Code&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;p&gt;I have been working in React since 2019 but Vue.js has been on my radar, so I took this opportunity to spin up a stack with the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue&lt;/a&gt; - Javascript framework&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://vitejs.dev/" rel="noopener noreferrer"&gt;Vite&lt;/a&gt; - next generation frontend tooling&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt; - utility first CSS framework&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://jestjs.io/" rel="noopener noreferrer"&gt;Jest&lt;/a&gt; / &lt;a href="https://vue-test-utils.vuejs.org/" rel="noopener noreferrer"&gt;Vue Test Utils&lt;/a&gt; - unit testing&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://splitbee.io/" rel="noopener noreferrer"&gt;SplitBee&lt;/a&gt; - analytics platform&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://eslint.org/" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt; / &lt;a href="https://prettier.io/" rel="noopener noreferrer"&gt;Prettier&lt;/a&gt; - code linting and formatting&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://axios-http.com/docs/intro" rel="noopener noreferrer"&gt;Axios&lt;/a&gt; - promise-based HTTP client for node.js and the browser&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://icanhazdadjoke.com/api" rel="noopener noreferrer"&gt;icanhazdadjoke API&lt;/a&gt; - the internets largest database of Dad Jokes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Coming from React, I was able to feel comfortable with the basics of Vue fairly quickly. I attribute this to a combination of my past work in React and the Vue framework itself. Vue feels very intuitive to me and was a joy to work with. I love the single file component syntax and separation through the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tags. This app is comparatively simple so I can't comment on what Vue would feel like once I got into a heavier, more complex app, but so far so good.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://vitejs.dev/" rel="noopener noreferrer"&gt;Vite&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Considering I did a basic install with default configs, there is not much to say about Vite at the moment, except that it is fast. I did experience some lag in Hot Module Replacement when editing CSS but I didn't take the time to find out why and I would like to believe it had to do with something on my end.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I have been using Tailwind CSS for most of the year now and it is my go-to for most builds, especially a small and quick app such as this. I am drawn to utility classes within the markup, but I also like Tailwind's &lt;code&gt;@apply&lt;/code&gt; directive, which I used within the Vue components style tag and the app's global index.css.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://jestjs.io/" rel="noopener noreferrer"&gt;Jest&lt;/a&gt; &amp;amp; &lt;a href="https://vue-test-utils.vuejs.org/" rel="noopener noreferrer"&gt;Vue Test Utils&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I have been deep diving into unit testing over the past few months and have learned a lot. Jest is my go-to for unit testing and Vue has provided utils that work on top of Jest. This build only required a few tests (see more below) but Jest and Vue Utils made it super easy.&lt;/p&gt;

&lt;h3&gt;
  
  
  ...Rest
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://eslint.org/" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt;, &lt;a href="https://prettier.io/" rel="noopener noreferrer"&gt;Prettier&lt;/a&gt;, and &lt;a href="https://axios-http.com/docs/intro" rel="noopener noreferrer"&gt;Axios&lt;/a&gt; are great defaults.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenges
&lt;/h2&gt;

&lt;p&gt;The first challenge was overcome once I decided on the build and stack. The biggest challenge with the UI was building the scrolling marquee. It took longer than I expected but I was able to pull it together with the help of the dev community (see resources below). The other big challenge was mocking API calls within my unit tests. I realize testing may not have been necessary with this small build but I took the opportunity to improve my unit testing skills through a few &lt;a href="https://github.com/sethburtonhall/dad-jokes/blob/main/tests/unit/app.spec.js" rel="noopener noreferrer"&gt;essential tests&lt;/a&gt;. Other than a few CSS quirks these were the things that gave me the most trouble. I talked more about these in the &lt;a href="https://www.twitch.tv/videos/1060069923" rel="noopener noreferrer"&gt;live stream&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Resources
&lt;/h2&gt;

&lt;p&gt;No build is complete without Google, Youtube, online courses and learning from the great dev community.&lt;/p&gt;

&lt;p&gt;To kick off my Vue education, I turned to &lt;a href="https://www.vuemastery.com/" rel="noopener noreferrer"&gt;Vue Mastery&lt;/a&gt;, where I learned the typical javascript framework basics like attribute binding, conditional rendering, list rendering, event handling, class and style binding, components, props, etc... These videos are great and have an easy-to-understand teaching style and presentation. I found myself moving beyond the intro and into real-world concepts and unit testing fairly quickly. And there are more intermediate and advanced courses to digest and videos are added weekly. Vue Mastery is a great resource to learn and master Vue.&lt;/p&gt;

&lt;p&gt;Since this app is emoji heavy I had the idea to implement an emoji favicon. I got my inspiration and the approach from this &lt;a href="https://css-tricks.com/emojis-as-favicons/" rel="noopener noreferrer"&gt;CSS Tricks post&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It could be argued that a scrolling text marquee is bad UX and I don't disagree, but I decided that it was perfectly fine for this light and fun build. So, with a little bit of research, I took inspiration from this &lt;a href="https://codepen.io/fcalderan/pen/GRJeYOL" rel="noopener noreferrer"&gt;codepen&lt;/a&gt; and this &lt;a href="https://tympanus.net/codrops/2020/03/31/css-only-marquee-effect/" rel="noopener noreferrer"&gt;codrop&lt;/a&gt;. I did turn this feature off by default, giving the user control, so that is a UX win right?&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;VirtualCoffee.io is a great community that supports, inspires, and challenges devs at all levels. I am happy to be a part of it and happy to have taken on this build in public challenge. The process of generating an idea and building that idea while learning a new stack is quite enjoyable, plus the world needs more dad jokes so I consider this build a win for society. But with any build, no matter how simple, comes challenges. The particular UI and testing challenges presented here were tough enough to push me but not too tough to discourage me, and with help from the dev community, I was happy to resolve them. I will continue my learning through Vue Mastery and I look forward to the next build. Thank you for reading and to all the hard joking dads out there, Happy Father's Day!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://more-dad-jokes.netlify.app/" rel="noopener noreferrer"&gt;App&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/sethburtonhall/more-dad-jokes" rel="noopener noreferrer"&gt;Code&lt;/a&gt;&lt;/p&gt;

</description>
      <category>buildinpublic</category>
      <category>vue</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Seeding mock data to the Firebase Local Emulator Suite</title>
      <dc:creator>Seth Hall</dc:creator>
      <pubDate>Mon, 25 Jan 2021 19:28:41 +0000</pubDate>
      <link>https://dev.to/sethburtonhall/seeding-mock-data-to-the-firebase-local-emulator-suite-with-faker-js-1596</link>
      <guid>https://dev.to/sethburtonhall/seeding-mock-data-to-the-firebase-local-emulator-suite-with-faker-js-1596</guid>
      <description>&lt;p&gt;I have recently been working on a React/Firebase side project to level up my skills and provide a playground to experiment with different techniques, patterns and libraries. One of my favorite features in Firebase is the &lt;a href="https://firebase.google.com/docs/emulator-suite" rel="noopener noreferrer"&gt;Local Emulator Suite&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using Cloud Firestore, Realtime Database, Authentication, Cloud Functions, Pub/Sub, and Firebase Hosting. It provides a rich user interface to help you get running and prototyping quickly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Local Emulator Suite is fairly easy to set up but be sure to reference the &lt;a href="https://firebase.google.com/docs/emulator-suite" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for full details.&lt;/p&gt;

&lt;p&gt;Regarding the actual code in your project, you first need to make sure the emulator ports are defined in your &lt;code&gt;firebase.json&lt;/code&gt; file like so ...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firebase.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"emulators"&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;"auth"&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;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9099&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;"firestore"&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;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8080&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;"ui"&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;"enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4000&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in your app's &lt;code&gt;firebase.js&lt;/code&gt; file, include an if statement that checks your Node environment. If you are in 'development' mode your app will automatically run against the emulators and will use the ports that you defined in your &lt;code&gt;firebase.json&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firebase.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="nx"&gt;firebase&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;firebase/app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firebase/auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firebase/firestore&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firebaseConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;authDomain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_AUTH_DOMAIN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;databaseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;projectId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_PROJECT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;storageBucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_STORAGE_BUCKET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messagingSenderId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_MESSAGING_SENDER_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_APP_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;measurementId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REACT_APP_FIREBASE_MEASUREMENT_ID&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="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;apps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initializeApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firebaseConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;firestore&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;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;development&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;testing locally -- hitting local auth and firestore emulators&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useEmulator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:9099/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useEmulator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;localhost&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&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;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Firebase Mode Activated!&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;Firebase not working :(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now navigate to the root of your project in your terminal and start the emulators by running &lt;code&gt;firebase emulators:start&lt;/code&gt;. You should see this in your terminal&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%2Fi%2Ftz1b7810a00td58vkzh8.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%2Fi%2Ftz1b7810a00td58vkzh8.png" alt="image" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and the Emulator UI at &lt;a href="http://localhost:4000" rel="noopener noreferrer"&gt;http://localhost:4000&lt;/a&gt;&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%2Fi%2Fj1auiku0ahzz86qfa8oq.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%2Fi%2Fj1auiku0ahzz86qfa8oq.jpg" alt="emulator-console" width="800" height="346"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now that you have emulators set up and running, it is time to seed the data to Firestore to develop against.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seeding Data to Firestore Local Emulator
&lt;/h2&gt;

&lt;p&gt;When developing locally it is helpful to have a data set to work with. While there are a few approaches to seeding data, including &lt;a href="https://firebase.google.com/docs/emulator-suite/install_and_configure#export_and_import_emulator_data" rel="noopener noreferrer"&gt;this approach via the Firebase docs&lt;/a&gt;, I chose to go with a simple script.&lt;/p&gt;

&lt;p&gt;Create a script in your project root called &lt;code&gt;dbseed.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dbseed.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="nx"&gt;admin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firebase-admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// required&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;faker&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// amazing library!&lt;/span&gt;

&lt;span class="c1"&gt;// initialization&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;projectId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-firebase-project-id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FIRESTORE_EMULATOR_HOST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;localhost:8080&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initializeApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;projectId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;firestore&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// seed function&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getSeedData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nc"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;keys&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="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;author_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="na"&gt;author_profile_pic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imageUrl&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;commerce&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;productName&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;commerce&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;productDescription&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;addr_1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;streetAddress&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;addr_2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;secondaryAddress&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;city&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;zipCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zipCode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;database seed was successful&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="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="p"&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;log&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;database seed failed&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="nf"&gt;getSeedData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script contains the required imports and initialization and runs a function that writes an array of objects to an 'events' collection.&lt;/p&gt;

&lt;p&gt;Once the emulator suite is running, navigate to &lt;a href="http://localhost:4000/firestore" rel="noopener noreferrer"&gt;Firestore Emulator UI&lt;/a&gt; then run &lt;code&gt;node dbseed.js&lt;/code&gt; in a separate terminal window/tab.&lt;/p&gt;

&lt;p&gt;You will see that the empty Firestore db is seeded with an array of Faker objects. Faker.js is an amazing library. Be sure to check out all the options at the &lt;a href="https://dev.toGithub%20repo"&gt;https://github.com/marak/Faker.js/&lt;/a&gt;&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%2F6lamccvudrvrldobg03d.gif" 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%2F6lamccvudrvrldobg03d.gif" alt="Seed mock data to the Firebase Local Emulator Suite" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success! Now you can develop against test data while work within the Firebase Local Emulator Suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about working with real production data?
&lt;/h2&gt;

&lt;p&gt;You can also work with your production data if that is a better fit. Set up is more involved but still a nice approach. Check out the &lt;a href="https://firebase.google.com/docs/emulator-suite/install_and_configure" rel="noopener noreferrer"&gt;Firestore Docs&lt;/a&gt; to learn how to export your production data then import it when starting the emulators.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Working with mock data is an essential part of development and is something that I struggled with when working in the Firebase Local Emulator Suite. This simple approach allows me to seed the database quickly. Thanks for reading and I hope this helps your workflow. Happy coding!&lt;/p&gt;

</description>
      <category>firstpost</category>
      <category>firebase</category>
      <category>firestore</category>
      <category>faker</category>
    </item>
  </channel>
</rss>
