<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kapelianovych Yevhen on Medium]]></title>
        <description><![CDATA[Stories by Kapelianovych Yevhen on Medium]]></description>
        <link>https://medium.com/@kapelianovych.y.v?source=rss-ff27fa27a8e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I9dunKNRlPULJ_QGIsKwhg.png</url>
            <title>Stories by Kapelianovych Yevhen on Medium</title>
            <link>https://medium.com/@kapelianovych.y.v?source=rss-ff27fa27a8e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:26:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kapelianovych.y.v/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Learn How to Build, Test and Deploy a Bookstore App With React 18, Vite, and Netlify Functions]]></title>
            <link>https://medium.com/better-programming/learn-how-to-build-test-and-deploy-a-bookstore-app-with-react-18-vite-and-netlify-functions-1e1050c8711?source=rss-ff27fa27a8e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e1050c8711</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[nightwatchjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kapelianovych Yevhen]]></dc:creator>
            <pubDate>Mon, 18 Jul 2022 15:45:54 GMT</pubDate>
            <atom:updated>2022-07-25T06:58:25.625Z</atom:updated>
            <content:encoded><![CDATA[<h4>An in-depth guide to exploring these robust programs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-kGVmQNgaBnOA_CDBGXMQ.png" /></figure><p><a href="https://reactjs.org/">React</a> emerged back in 2011 at Facebook (now <a href="https://about.facebook.com/">Meta</a>) and has continued evolving rapidly and gaining a significant ecosystem with a wide variety of plugins and UI frameworks on top of it.</p><p>This guide will cover in detail the steps to create a working example bookstore single-page application using the latest React 18 and run it using the <a href="https://vitejs.dev/">Vite</a>. It also includes details on adding a custom state management solution and routing using the <a href="https://github.com/molefrog/wouter">wouter</a> library.</p><p>The present article is the React equivalent of the <a href="https://labs.pineview.io/learn-how-to-build-test-and-deploy-a-single-page-app-with-vue-3-vite-and-pinia/">Vue 3+Vite</a> article, which we’ve published recently on this blog. The result is the same for both (a bookstore single-page app which we’ve called Middlemarch). However, this tutorial also contains a backend solution using serverless functions.</p><p>Here’s the main tasks that we’ll focus on throughout this tutorial:</p><ol><li>bootstrap the application skeleton with Vite</li><li>manage routes with the wouter library</li><li>create an internal state management tool</li><li>create and run <a href="https://functions.netlify.com/">netlify functions</a></li><li>write React component tests with Nightwatch</li><li>write and run automated end-to-end tests with Nightwatch</li><li>build and deploy the application with Github Actions</li></ol><p>This is a large undertaking, but it accurately describes the whole development cycle. The application will be deployed to Netlify. If you’re eager to get right down to coding and you’d like to jump into it right away, you can just get the project up and running with:</p><pre>git clone https://github.com/pineviewlabs/middlemarch-react<br>cd middlemarch-react<br>npm install<br>npm start</pre><p>Or fork the project at <a href="https://github.com/pineviewlabs/middlemarch-react">https://github.com/pineviewlabs/middlemarch-react</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*M6OCXPQJ-CQd0KiWyZwIew.png" /></figure><h3>Step 1 — Bootstrap the Application Skeleton With Vite</h3><p>We will use the <a href="https://github.com/vitejs/vite/tree/main/packages/create-vite#readme">create-vite</a> CLI to bootstrap the basic structure and dependencies.</p><pre>npm create vite middlemarch -- --template react</pre><p>Then follow the instructions that appear at the end, e.g.:</p><pre>Scaffolding project in /home/projects/middlemarch...</pre><pre>Done. Now run:</pre><pre>  cd middlemarch<br>  npm install<br>  npm run dev</pre><p>The folder structure will likely look similar to:</p><pre>/<br> ├── src/<br> |    ├── App.css<br> |    ├── App.jsx<br> |    ├── favicon.ico<br> |    ├── index.css<br> |    ├── logo.svg<br> |    └── main.jsx<br> ├─── .gitignore<br> ├─── index.html<br> ├─── package.json<br> └─── vite.config.js</pre><p>We don’t need the App.css and logo.svg, so you may delete them right away. The last thing we need to do is replace default scripts with these:</p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;vite:start&quot;: &quot;vite&quot;,<br>    &quot;vite:build&quot;: &quot;vite build&quot;<br>  }<br>}</pre><blockquote>We have added the vite: prefix to distinguish the front-end build part from the serverless functions. All about it later.</blockquote><h3>Prepare the App.jsx File</h3><p>At this point, we have prepared the development environment. Let’s dig into React and update the App.jsxfile to match the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f190fcb2597f225ec233fc637072dda5/href">https://medium.com/media/f190fcb2597f225ec233fc637072dda5/href</a></iframe><blockquote>StrictMode highlights potential problems in the application, which you may not notice. It’s the good practice to wrap the whole application in it.</blockquote><p>Now, run the npm vite:start script to get the application running at <a href="http://localhost:3000/">http://localhost:3000</a>.</p><pre>npm run vite:start</pre><p>At this point, you will see an empty page with the &lt;main&gt; element under the #root. The next step is to write pages with the actual content to see something in the browser.</p><h3>Step 2 — Add Routes</h3><p>It’s time to create our application’s main routes. In React, every page is just a separate component. For this application, we’ll consider the following components:</p><ul><li>Home — the very first page that will be served at the / base URL</li><li>Cart — a page that contains the list of products; it is available only to logged-in users</li><li>Sign-in — the login form</li><li>Register — the user sign-up form</li></ul><p>For the sake of simplicity, I will show you a full implementation of the Home page only. But you may always go to the <a href="https://github.com/pineviewlabs/middlemarch-react">GitHub repository</a> to see the final source code of the application.</p><p>The whole application will have the following markup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*kxrPubz0NlKn257s2U6jBQ.png" /><figcaption>Page markup</figcaption></figure><p>Let’s create the Header and Footer components which remain the same across every page:</p><pre>mkdir src/components<br>mkdir src/components/Header<br>mkdir src/components/Footer<br>touch src/components/Header/index.jsx<br>touch src/components/Footer/index.jsx</pre><p>I am using Unix’s <a href="https://en.wikipedia.org/wiki/Touch_(command)">touch</a> command to create files and <a href="https://en.wikipedia.org/wiki/Mkdir">mkdir</a> to create directories. You may use your own editor or IDE to accomplish those tasks.</p><p>In the Header/index.jsx file, add the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5912a07d6ea02a50285b19461163914e/href">https://medium.com/media/5912a07d6ea02a50285b19461163914e/href</a></iframe><blockquote>You may notice an unknown <a href="https://github.com/molefrog/wouter#link-hrefpath-">Link</a> tag here and the wouter import. It is one of the Navigation components provided by the wouter library and triggers navigation to the URL from the href attribute. We will cover that library soon.</blockquote><p>And the Footer/index.jsx:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fafb601ddcc9a446daee54300bb5a342/href">https://medium.com/media/fafb601ddcc9a446daee54300bb5a342/href</a></iframe><p>After that, we need to include them in the application entry point. Here’s the code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/090b322b79edb491e2b26e9bbab675d8/href">https://medium.com/media/090b322b79edb491e2b26e9bbab675d8/href</a></iframe><p>The page content will be rendered inside the main element. You may notice that we declared the file extensions for the Home and Footer component files. It is useful to distinguish the local files from external dependencies, though it is completely optional and depends on only your preferences.</p><h3>What is wouter?</h3><p>Wouter is a minimal router implementation for React and <a href="https://preactjs.com/">Preact</a>. You already saw the Link component, which is simply the &lt;a&gt; element under the hood.</p><p>Now it’s time to introduce the Route component, which will render a declared component if the URL property matches the current location.pathname value.</p><p>Let’s modify the App.jsx component again and declare the routes, as shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de58ca3501ae09b4e231b7192b843432/href">https://medium.com/media/de58ca3501ae09b4e231b7192b843432/href</a></iframe><p>We are using yet another component from wouter — <a href="https://github.com/molefrog/wouter#switch-">Switch</a>, which performs exclusive routing. That means that only the first matched route will be rendered.</p><p>After that, we have to provide the default markup for each page. Here’s the code:</p><pre>export default () =&gt; &lt;div&gt;&lt;/div&gt;;</pre><p>The last thing left is the Home page. Edit the src/pages/Home/index.jsx file and add the the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e92b300de2dc38b970ee581c603547b/href">https://medium.com/media/0e92b300de2dc38b970ee581c603547b/href</a></iframe><p>For now, we will omit the search functionality for brevity. You may notice the new useBooks import – it is a custom hook that will manage the global books&#39; data of the application. Now that we mention it, let&#39;s proceed to the state management section.</p><h3>Step 3 — State Management With Context + Hook</h3><p>There are plenty of state management libraries for React that have diverse ideas behind them. Each of them is worth exploring, but in this small application, we don’t need to add yet another dependency and write complex logic to store our data, which is only an array of objects that hold the available books. React already has the API, which we can use to implement it concisely.</p><h3>Implementing the “useBooks” Hook</h3><p>We will use <a href="https://reactjs.org/docs/context.html">Context</a> for globally storing the data and hooks for delivering that data to components that need it.</p><pre>mkdir src/cache<br>touch src/cache/books.jsx</pre><p>Here are the steps to do that:</p><ol><li>Create the context — not exported, and it is private to this module.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06817b1cb7959698e1ea4f75190b0755/href">https://medium.com/media/06817b1cb7959698e1ea4f75190b0755/href</a></iframe><p>2. Create the Provider component — exported by default.</p><p>This defines the state where we are going to store the data and returns the context Provider with the value and state dispatcher. The last one, we need to dispatch state changes, though it won’t be exposed directly to the components.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1da1423ffb521a7c1440d159769c68b/href">https://medium.com/media/a1da1423ffb521a7c1440d159769c68b/href</a></iframe><p>3. Create the hook.<br>The hook uses the context and returns a fresh array and useful methods that modify the state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b3ca2695e1fa8e7a7ba7d202687fb46/href">https://medium.com/media/3b3ca2695e1fa8e7a7ba7d202687fb46/href</a></iframe><blockquote>The useBooks hook exports a tuple (an array of two items) where the first item is the books array and second is collection of methods which describe the available ways of interacting with the books array.</blockquote><p>Fetching the /api/books URL errors for now. It will work when we provide the serverless function for it.</p><p>To use the books state, we need to wrap the application with the component according to <a href="https://reactjs.org/docs/context.html#examples">the Context using rules</a>, as you can see below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8c393c9cd46c0a08092b841fb0ec224/href">https://medium.com/media/e8c393c9cd46c0a08092b841fb0ec224/href</a></iframe><h3>Step 4 — Creating Serverless Functions With Netlify</h3><p>Serverless functions is a relatively new concept where the idea is to delegate running and maintaining server-side tasks to a cloud-computing service and only focus on writing the code. Several service providers offer this feature, including Netlify, Vercel, Render, Azure, or Cloudflare.</p><p>For this example, we will use Netlify’s functions, but you can choose your favourite provider.</p><p>Here is the schema of how everything works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42Hc7cSK9FhsLFjG1pjDPw.png" /><figcaption>Simple description of how the Netlify CLI works.</figcaption></figure><h3>Install the Netlify CLI</h3><p>First, we have to install the <a href="https://www.npmjs.com/package/netlify-cli">Netlify CLI</a> and create the netlify.tomlconfiguration file:</p><pre>npm i -D netlify-cli<br>touch netlify.toml</pre><p>The Netlify CLI is needed to emulate the FaaS (Function-as-a-Service) environment and test our functions. The CLI is also responsible for running the application.</p><p>We are going to adjust Netlify’s config file, so it will know how to run the Vite development server, as shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81ce4beb1773db58ab7d7816b8edad3e/href">https://medium.com/media/81ce4beb1773db58ab7d7816b8edad3e/href</a></iframe><h3>Adding a lowdb database</h3><p>Now let’s create the mock file with the data.</p><pre>mkdir data<br>touch data/db.json</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b4aa178470565411d14851d8aaec130/href">https://medium.com/media/7b4aa178470565411d14851d8aaec130/href</a></iframe><p>Okay, let’s move on to the functions. By default, Netlify will search for them in netlify/functions directory.</p><pre>mkdir -p netlify/functions<br>touch netlify/functions/books.js</pre><p>Edit the netlify/functions/books.js, and add the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5d662ecbc95d0bc3cbd4d28bb4bd938/href">https://medium.com/media/e5d662ecbc95d0bc3cbd4d28bb4bd938/href</a></iframe><p>We are using the <a href="https://github.com/typicode/lowdb">lowdb</a> package to read from the JSON file. Of course, you can use the fs.promises.readFiledirectly and read from the file. But this is an example, and in a real-world app, you will have a database, and you will have to use a database driver, so this example shows you that it is possible.</p><h3>Adding User Authentication</h3><p>Serverless functions allow you to implement complex behaviour like user authentication. If you check out the source code of the current application, you may see there two pages:<br>- <a href="https://github.com/pineviewlabs/middlemarch-react/blob/main/src/pages/SignIn/index.jsx">SignIn/index.jsx</a> <br>- <a href="https://github.com/pineviewlabs/middlemarch-react/blob/main/src/pages/Register/index.jsx">Register/index.js</a></p><p>And the corresponding functions: <br>- <a href="https://github.com/pineviewlabs/middlemarch-react/blob/main/netlify/functions/login.js">login.js</a> <br>- <a href="https://github.com/pineviewlabs/middlemarch-react/blob/main/netlify/functions/register.js">register.js</a>.</p><p>To create an account, you must pass an email and a password. The latter will be hashed on the server, and the hash will be saved into the DB. It’s a good practice to add a so-called “salt” to the hashing function, which should be private.</p><p>For that purpose, we will create the .env file containing the PASSWORD_SECRET variable, which we will use as the &quot;salt.&quot;</p><p>Here’s the contents of the .env.example file. For local development, rename this to .env and fill these in:</p><pre>VITE_AUTH_KEY = &#39;your_super_secret_auth_key&#39;<br>PASSWORD_SECRET = &#39;super_secret_password_salt&#39;</pre><p>The VITE_AUTH_KEY environment variable is used for the remember me functionality.</p><h3>Configure env variables in Netlify</h3><p>When running in Netlify, use the administration UI to define the environment variables above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QspcbgTHgtkmf51Y_gWt9g.png" /><figcaption><a href="https://app.netlify.com/sites/middlemarch/settings/deploys#environment">https://app.netlify.com/sites/middlemarch/settings/deploys#environment</a></figcaption></figure><h3>Step 5 — Testing React Components With Nightwatch.js</h3><p>Component testing is a type of UI testing where the component is rendered in isolation, without the rest of the app components, to verify its functionality. It’s usually a testing strategy that happens prior to the end-to-end testing step, which we’ll elaborate in the next section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QI5z8ln6ryeNjoeKaOeTKw.png" /></figure><h3>Install Nightwatch.js</h3><p>We will use <a href="https://nightwatchjs.org/">Nightwatch</a> for both component and end-to-end testing. The easiest way to add Nightwatch tests to your project is using the create-nightwatch init tool.</p><p>Just run the following command from the project’s root folder and follow the steps:</p><pre>npm init nightwatch@latest</pre><h3>Install the @nightwatch/react plugin</h3><p>Nightwatch supports testing React component using the @nightwatch/react, which is using internally the <a href="https://github.com/nightwatchjs/vite-plugin-nightwatch">vite-plugin-nightwatch</a> Vite plugin.</p><p>To install it, run:</p><pre>npm i -D @nightwatch/react</pre><p>After you have run the npm init nightwatch command, you should have a generated nightwatch.conf.js file.</p><p>You need to edit it and let Nightwatch know that React component testing plugin is installed:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd8ca08a8fc812dd75b23d7b43c5415a/href">https://medium.com/media/bd8ca08a8fc812dd75b23d7b43c5415a/href</a></iframe><h3>Write Your First Component Test</h3><p>There should be a tests directory now. We can add our first component test.</p><pre>mkdir tests/component<br>touch tests/component/basic.js</pre><p>And it should have the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22916369fec95d5ca7ef83909229f172/href">https://medium.com/media/22916369fec95d5ca7ef83909229f172/href</a></iframe><blockquote>Nightwatch.js uses the same BDD syntax as <a href="https://mochajs.org/">Mocha</a> or <a href="https://jestjs.io/">Jest</a>. You can even use Mocha as a test runner in Nightwatch but for simplicity we aren&#39;t going to do that.</blockquote><p>Because we are making the network request, we have to mock it while testing. That’s why we have to use the <a href="https://nightwatchjs.org/api/mockNetworkResponse.html#apimethod-container">browser.mockNetworkResponse</a> method to fake the response because component tests don’t involve the running server.</p><p>Also, you may notice, the /tests/component/Books.jsx path. It is a testing component we must create to be able to test components in isolation. The reason is that we are using the context to store the application’s data.</p><p>According to <a href="https://reactjs.org/docs/context.html#contextprovider">React’s rules</a>, we cannot use the context if the Provider of that context is not present up in the tree. So, if we want to test some component and it is using some context through the hook (we’ve created one: useBooks), we have to wrap it with the according provider first.</p><p>Let’s create a component for testing. We are going to test the Home page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/379d42fcfbdd733bd61bcd86ab1fd963/href">https://medium.com/media/379d42fcfbdd733bd61bcd86ab1fd963/href</a></iframe><h3>Run Your First Component Test</h3><p>It’s time now to run the above test in Chrome with the following command:</p><pre>npx nightwatch tests/component/basic.js --env chrome</pre><p>You can pass the --headless argument if you don&#39;t want to see the opening browser (not available if using Safari).</p><pre>npx nightwatch tests/component/basic.js --env chrome --headless</pre><blockquote>Component testing in React is only available at the moment for Chrome and Edge browsers.</blockquote><h3>Extend the Component Test</h3><p>For now, the test does nothing helpful. Let’s extend it a bit:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05d8c1923c9a7cedd13b1b314ad12a2f/href">https://medium.com/media/05d8c1923c9a7cedd13b1b314ad12a2f/href</a></iframe><p>Here we have created a simple test that checks for the presence of elements and content on the page. We have refactored the component mounting into the before hook, so we can do the only checks in the it block.</p><h3>Mocking Network Requests</h3><p>We have to mock the /api/books network request while testing to ensure reliable results from the server-side component.</p><p>That’s why we have used the <a href="https://nightwatchjs.org/api/mockNetworkResponse.html#apimethod-container">browser.mockNetworkResponse</a> method in that Nightwatch provides to fake the response because component tests don’t involve the running server.</p><h3>Step 6 — Adding End-to-End Tests With Nightwatch</h3><p>End-to-End testing (E2E) helps with validating the most important flows in your application. Fortunately, we don’t need to install additional tools to implement E2E tests since we already have Nightwatch in our project (see the previous step for installation instructions).</p><p>Nightwatch can run tests against all major browsers thanks to its integration with the <a href="https://w3c.github.io/webdriver/webdriver-spec.html">W3C Webdriver </a>API and <a href="https://selenium.dev/">Selenium</a>. It also allows you to use distributed cloud testing platforms like <a href="https://www.browserstack.com/">BrowserStack</a>, <a href="https://saucelabs.com/">SauceLabs</a>, <a href="https://crossbrowsertesting.com/">CrossBrowserTesting</a>, or <a href="https://www.lambdatest.com/">LambdaTest</a>.</p><blockquote>For running end-to-end tests you should build the application first and then serve it with the local Vite server. This is required to emulate the production environment as close as possible.</blockquote><p>To build and run the application, use the netlify local dev server:</p><pre>npx netlify dev</pre><p>or simply:</p><pre>npm start</pre><h3>Create Your First End-to-End Test</h3><pre>mkdir tests/e2e<br>touch tests/e2e/HomePage.js</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c9b2c3fa36b494c453ae71db683fa67/href">https://medium.com/media/7c9b2c3fa36b494c453ae71db683fa67/href</a></iframe><p>The test verifies whether the page is displayed and contains the book information that we’ve seen before.</p><h3>Run Your First End-to-End Test</h3><p>Run the test by using the following command:</p><pre>npx nightwatch tests/e2e/HomePage.js --env firefox</pre><p>You can use another browser or several browsers if you want. Just make sure that you have the according drivers installed.</p><p>Run the test in Firefox, Chrome, and Safari in parallel. Here’s the code:</p><pre>npx nightwatch tests/e2e/HomePage.js --env firefox,chrome,safari</pre><h3>Step 7 — Add Continuous Integration With GitHub Actions</h3><p>We are almost done. The last thing left is adding CI to run the tests against the next changes automatically.</p><p>What we need to do is to create the main.yamlfile inside the .github/workflows directory with the following content.</p><p>We’ll use Xvfb to run the tests in Chrome inside the Github Actions workflow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a42a91d7b4ef0cd3c96ec24eb9e07d14/href">https://medium.com/media/a42a91d7b4ef0cd3c96ec24eb9e07d14/href</a></iframe><p>And we are done! GitHub Actions will run tests in three separate environments on every pull request.</p><h3>Where to Go From Here</h3><p>If you want to dive deeper, you can go to the <a href="https://github.com/pineviewlabs/middlemarch-react">https://github.com/pineviewlabs/middlemarch-react</a> and explore the code or clone and run it locally.</p><p>You can also visit the <a href="https://middlemarch-react.netlify.app/">https://middlemarch-react.netlify.app</a> and see the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YrReAkWrVYEPMPIBBrKvuQ.png" /><figcaption>Middlemarch React Netlify app.</figcaption></figure><h3>Getting Support</h3><h3>React and Wouter</h3><ul><li><a href="https://reactjs.org/community/support.html">React community</a></li><li><a href="https://github.com/molefrog/wouter/issues">Wouter Github issues</a></li></ul><h3>Netlify functions</h3><ul><li><a href="https://docs.netlify.com/functions/overview/">Netlify Functions docs</a></li><li><a href="https://answers.netlify.com/">Netlify’s community forum</a></li></ul><h3>LowDB</h3><ul><li><a href="https://github.com/typicode/lowdb/issues">Lowdb Github issues</a></li></ul><h3>Nightwatch.js</h3><p>For support with everything Nightwatch related, you may visit the following channels:</p><ul><li><a href="https://github.com/nightwatchjs/nightwatch">GitHub Discussions</a></li><li><a href="https://labs.pineview.io/build-test-and-deploy-an-app-react18-vite-netlify-nightwatch/Nightwatch.js%20chat%20server">Nightwatch.js chat server</a> on Discord</li></ul><p>This article was originally published at <a href="https://labs.pineview.io/build-test-and-deploy-an-app-react18-vite-netlify-nightwatch/">https://labs.pineview.io</a>.</p><p>Thank you for reading the article. I hope it can guide you through the whole development cycle or give you another look at how you can build things better. Be happy and stay safe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e1050c8711" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/learn-how-to-build-test-and-deploy-a-bookstore-app-with-react-18-vite-and-netlify-functions-1e1050c8711">Learn How to Build, Test and Deploy a Bookstore App With React 18, Vite, and Netlify Functions</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>