<?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[TechSkool - Medium]]></title>
        <description><![CDATA[Heaven for Tech blog readers. Next.js, React.js, React-Native, Django Rest Framework, Java SpringBoot, AWS - Medium]]></description>
        <link>https://medium.com/techskool?source=rss----16f0e348e53c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TechSkool - Medium</title>
            <link>https://medium.com/techskool?source=rss----16f0e348e53c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 13:42:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/techskool" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a Markdown Text form Field in Flutter: A Step-by-Step Guide]]></title>
            <link>https://medium.com/techskool/create-a-markdown-textformfield-in-flutter-929209ae2c02?source=rss----16f0e348e53c---4</link>
            <guid isPermaLink="false">https://medium.com/p/929209ae2c02</guid>
            <category><![CDATA[textformfield]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[markdown-editor]]></category>
            <dc:creator><![CDATA[Ajay Kamble]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 08:04:53 GMT</pubDate>
            <atom:updated>2023-10-06T08:04:53.821Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5w7SG6BxQwqCwpfQxwBLQ.jpeg" /></figure><p>Flutter is a popular mobile application development framework that allows developers to create beautiful and efficient user interfaces. One of the most important components of any user interface is text input fields. In this blog post, we will explore how to use the TextFormField widget to create a markdown text input field in a Flutter application.</p><p>TextFormField is a pre-built widget in Flutter that provides a convenient way to create text input fields. With TextFormField, you can create text fields with various properties such as controller, validation, keyboard type, and input formatting.</p><h3>What is Markdown?</h3><p>Markdown is a lightweight markup language that is used to format text. It is widely used in documentation and is supported by many platforms such as GitHub, Bitbucket, and Stack Overflow. Markdown is simple and easy to learn, and it can be converted into HTML or other formats.</p><p>Let’s take example of Whatsapp.</p><p>WhatsApp allows you to format text inside your messages.</p><p><strong>1. Italic : </strong>To <em>italicize</em> your message, place an underscore on both sides of the text: _text_</p><p><strong>2. Bold : </strong>To bold your message, place an asterisk on both sides of the text: *text*</p><p><strong>3. Strikethrough : </strong>To strikethrough your message, place a tilde on both sides of the text: ~text~</p><p><strong>4. Monospace : </strong>To monospace your message, place three backticks on both sides of the text: ```text```</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiKpD_MLysd9FFbkBomJJQ.jpeg" /><figcaption>Markdown text in WhatsApp</figcaption></figure><h3>How to Use the TextFormField Widget in Flutter</h3><p>You can refer to this link to explore <a href="https://api.flutter.dev/flutter/material/TextFormField-class.html">TextFormField</a></p><h3>Let’s Get Started</h3><p>First we will create TextFormField widget</p><pre>TextFormField(<br>  keyboardType: TextInputType.multiline,<br>  minLines: 10,<br>  maxLines: 15,<br>),</pre><p>Now we need to add controller to TextFormField. we will create a object of TextEditingController</p><pre>final TextEditingController _editTextController = TextEditingController();</pre><p>Assign this _editTextController object to the controller property of TextFormField</p><pre>TextFormField(<br>  controller: _editTextController,<br>  keyboardType: TextInputType.multiline,<br>  minLines: 10,<br>  maxLines: 15,<br>)</pre><figure><img alt="sdf" src="https://cdn-images-1.medium.com/max/542/1*BIT2tQmc9UYJiCxK1SA6hA.png" /><figcaption>TextFormField example</figcaption></figure><p>If we see the implementation of TextEditingController class. It has method called TextSpan buildTextSpan({required BuildContext context, TextStyle? style, required bool withComposing}) by overriding this method customize appearance of text.</p><p>Now we will create regular expression to detect patterns such bold, italic, mentions, hashtags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*-Mqd6gv0SqqgdZMNdpfDvw.png" /><figcaption>TextFormField before applying style</figcaption></figure><p><strong>Regular Expressions</strong></p><p><strong>1.Bold : </strong>\*(.*?)\* if we found this pattern in text we will set textstyle as TextStyle(fontWeight : FontWeight.bold)</p><p><strong>2.Italic : </strong>_(.*?)\_ if we found this pattern in text we will set TextStyle as TextStyle(fontStyle : FontStyle.italic)</p><p><strong>3.StrikeThrough Text : </strong>~(.*?)~ if we found this pattern in text we will set TextStyle as TextStyle(decoration: TextDecoration.lineThrough)</p><p><strong>4.Mentions : </strong>@.\w+ if we detect this pattern in text we will set TextStyle as TextStyle(color:Colors.blue)</p><p><strong>5.HashTags : </strong>#.\w+ if we detect this pattern in text we will set TextStyle as TextStyle(color:Colors.blue)</p><h3>Step 1 : Create CustomTextEditingController by extending TextEditingController class</h3><p>In this class we will create constructor with Map&lt;String, TextStyle&gt; as a parameter and key for the map will be regular expression and value for the map will be TextStyle for the pattern.</p><p>Also we will override buildTextSpan method from TextEditingController class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa555de4c2e7543550cd0013a113879b/href">https://medium.com/media/aa555de4c2e7543550cd0013a113879b/href</a></iframe><p>CustomTextEditingController class have a variable called pattern .</p><p>we will initialize this variable by joining all the key’s of map by pipe operator | .</p><h3><strong>Step 2 : Implementation of </strong><strong>buildTextSpan method</strong></h3><p>We will get current text of TextFormField in text variable which is declared in TextEditingController class</p><p>Now we can use method called splitMapJoin to detect patterns in text.</p><p>This method has 3 parameters</p><ol><li>Pattern (regx object) that we have already inside constructor of CustomTextEditingController class.</li><li>onMatch Callback : This callback gives matched pattern</li><li>onNonMatch Callback: This callback gives non matched text</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce1bc3607d50925c4e7b78007977c29e/href">https://medium.com/media/ce1bc3607d50925c4e7b78007977c29e/href</a></iframe><p>Above code helps to get style based onpattern matched with text</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01fb1aa6253a17361b2f063c228bee06/href">https://medium.com/media/01fb1aa6253a17361b2f063c228bee06/href</a></iframe><p>The above code will help you to remove special characters we have used to format text</p><p>Now we have TextStyle as well as parsed text. we will create object of TextSpan along with formatText and matched TextStyle</p><pre>TextSpan(<br>  text: formatText,<br>  style: style!.merge(myStyle),<br>)</pre><p>We will add this object to the List&lt;InlineSpan&gt;.</p><p>Inside onNonMatch we will create object of TextSpan with default textStyle and add it to List&lt;InlineSpan&gt;.</p><p>At the end we will return TextSpan(style: style, children: children); from buildTextSpan method</p><p>That’s It.</p><h3>Step 3 : Create object of Custom TextEditing Controller</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ddccfb6c0c5cc03d01c8fd29d5645fa9/href">https://medium.com/media/ddccfb6c0c5cc03d01c8fd29d5645fa9/href</a></iframe><p>Assign Above object to TextFormField</p><pre>TextFormField(<br>  controller: _editTextController,<br>  keyboardType: TextInputType.multiline,<br>  minLines: 10,<br>  maxLines: 15,<br>),</pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*4KHfkugIz1busaqAkrmx_g.png" /><figcaption>TextFormfield after applying style</figcaption></figure><p><strong>Source Code:</strong></p><p><a href="https://github.com/Ajaykamble/MarkDownTextFormField">GitHub - Ajaykamble/MarkDownTextFormField</a></p><p>Enjoyed the read? Show your appreciation with a clap! For more insights, hit that Follow button. 😊😊</p><p>If you’re looking for assistance in creating cutting-edge products with Flutter, please feel free to reach out to me on <a href="https://www.linkedin.com/in/ajay-kamble-67a5291ba/">LinkedIn</a>. I’d be happy to assist you in building something innovative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=929209ae2c02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techskool/create-a-markdown-textformfield-in-flutter-929209ae2c02">Creating a Markdown Text form Field in Flutter: A Step-by-Step Guide</a> was originally published in <a href="https://medium.com/techskool">TechSkool</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conditional Imports in flutter for Cross-Platform Development]]></title>
            <link>https://medium.com/techskool/adding-conditional-imports-in-flutter-for-cross-platform-development-5d7b6bff689c?source=rss----16f0e348e53c---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d7b6bff689c</guid>
            <dc:creator><![CDATA[Ajay Kamble]]></dc:creator>
            <pubDate>Mon, 25 Sep 2023 19:55:21 GMT</pubDate>
            <atom:updated>2023-09-25T19:55:21.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZ6KI2mitDjCldisqoYXtg.png" /></figure><p>Diving into the world of Flutter, you’re met with a robust cross-platform framework that effortlessly bridges the gap between mobile, web, and desktop applications. But what happens when you need to sprinkle in a bit of platform-specific magic?</p><p>In today’s article, we’ll embark on a journey to master conditional imports for Flutter’s diverse platforms, from mobile to web to Windows.</p><p><strong>Why do we need conditional imports?</strong></p><p>Conditional imports in Flutter are used to import platform-specific code or packages based on the platform your application is running on.</p><p>Flutter supports the following platforms:</p><ul><li>Android</li><li>iOS</li><li>Web</li><li>Windows</li><li>macOS</li><li>Linux</li></ul><p>Flutter uses the dart.io.Platform class to determine the current platform. This class has a isAndroid, isIOS, isLinux, isMacOS, isWindows, and isFuchsia properties that return a boolean value indicating whether the application is running on that platform.</p><p><strong>Let me walk you through example of displaying native dialog.</strong></p><p>Here, we are targeting android, ios, weband windowsplatform.</p><p>In below example, we have imported the properties kIsWeb and TargetPlatform from the flutter/foundation.dart package. We utilize the kIsWeb property to ascertain whether the application is operating on the web platform. Similarly, we employ the TargetPlatform property to determine if the application is running on Android or other platforms.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55c01dc69f4d172157a42f0f233bd5d3/href">https://medium.com/media/55c01dc69f4d172157a42f0f233bd5d3/href</a></iframe><p>It’s important to note that while Flutter provides the widget AlertDialog for displaying alerts on Android and CupertinoAlertDialog for iOS, there is currently no implementation available for web and Windows platforms.</p><p>Hence, let’s write down our own implementation.</p><h3>Creating a JavaScript Function to Trigger Alerts in HTML</h3><p>We will create javaScript method with parameter to call alert method under script tag in web/index.html page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/446ecd6a12a17a0963686633221dae0f/href">https://medium.com/media/446ecd6a12a17a0963686633221dae0f/href</a></iframe><p><strong>Windows Implementation</strong></p><p>For windows we will use method channel to call native code. open flutter_windows.cpp which is located at windows/runner/ find OnCreate() method in this file</p><p>paste following code in between RegisterPlugins(flutter_controller_-&gt;engine()); and SetChildContent(flutter_controller_-&gt;view()-&gt;GetNativeWindow());</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/700f3dc50931095fcb9f1cb0e4124d13/href">https://medium.com/media/700f3dc50931095fcb9f1cb0e4124d13/href</a></iframe><p>Now we need to create two methods.</p><ol><li>To get Argument passed from flutter</li><li>To display native dialog</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/543533e4ccb5754024897403d77a3b52/href">https://medium.com/media/543533e4ccb5754024897403d77a3b52/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eacb1e32172d4c349f84a26f814f836d/href">https://medium.com/media/eacb1e32172d4c349f84a26f814f836d/href</a></iframe><p>Let’s Test now..</p><p>First we will run this Android platform</p><p><strong>OH! we got an error</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nXS-wQlLfxkp7ujicsQH5g.png" /></figure><p>We are utilizing the dart.js package to invoke JavaScript code, but unfortunately, this package isn’t accessible on the Android platform. To address this issue, we must now employ conditional imports.</p><p>Now we will create abstract class called CustomPlatform create method displayAlert inside it</p><p><strong>custom_platform.dart</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a464ac14310414ef6b33106260556d2/href">https://medium.com/media/8a464ac14310414ef6b33106260556d2/href</a></iframe><p>Create a file named “platform_helper.dart” to obtain an instance of the CustomPlatform class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5765c20bb8b93a78b5f62e20e2584bf3/href">https://medium.com/media/5765c20bb8b93a78b5f62e20e2584bf3/href</a></iframe><p>Create two classes: one for the web platform and the other for all other platforms. Implement the CustomPlatform interface in both classes.</p><p><strong>web_platform.dart</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c1fa1a78792342b85a26b206cfaf96f/href">https://medium.com/media/6c1fa1a78792342b85a26b206cfaf96f/href</a></iframe><p><strong>other_platform.dart</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f951cfab3fdc3b0dd418b79b264417a/href">https://medium.com/media/9f951cfab3fdc3b0dd418b79b264417a/href</a></iframe><p><em>Note: we have created global method called </em><em>getInstance() that returning instance of each class with </em><em>CustomPlatform type</em></p><p><strong>web_platform.dart</strong></p><pre>CustomPlatform getInstance() =&gt; CustomPlatformWeb();</pre><p><strong>other_platform.dart</strong></p><pre>CustomPlatform getInstance() =&gt; CustomPlatformOther();</pre><p>Now we need to modify our custom_platform.dart file. create a factory constructor to return above objects in CustomPlatform class and import getInstance method based on platform type.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09043adc928472d5c41111b3bb9637ee/href">https://medium.com/media/09043adc928472d5c41111b3bb9637ee/href</a></iframe><p>We use two libraries, dart.library.html and dart.library.io, to figure out which platform our application is running on. If it’s running on the web, dart.library.html becomes true, and for other platforms, dart.library.io becomes true.</p><p>In our custom_platform.dart file, we can use these conditions to decide where to import the getInstance method from. If our app is on the web, it’ll import from web_platform.dart, otherwise, from other_platform.dart.</p><p>Now we need to modify out MyApp class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb9736f7a3e4553ece11a8bb372879c8/href">https://medium.com/media/eb9736f7a3e4553ece11a8bb372879c8/href</a></iframe><p>That’s it.</p><h3>Output</h3><p>Now we will try running our application on different platforms.</p><p><strong>Windows</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Id9oA1C-7FLGz4x58Fm5IA.png" /><figcaption>Windows screenshot</figcaption></figure><p><strong>Web</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-ijgP-X7IZZG3in_H04zA.png" /><figcaption>Web screenshot</figcaption></figure><p><strong>Android</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*mFjLJywSjHidBbw48sqDgA.png" /><figcaption>Android screenshot</figcaption></figure><p><strong>Source Code</strong></p><p><a href="https://github.com/Ajaykamble/flutter_conditional_importing">GitHub - Ajaykamble/flutter_conditional_importing</a></p><p><strong>Conclusion:</strong></p><p>Conditional importing is a useful technique that can help optimize your Flutter app’s performance and minimize its size. By selectively importing only the code that you need, you can reduce the size of your app and improve its performance.</p><p>If you’re looking for assistance in creating cutting-edge products with Flutter, please feel free to reach out to me on <a href="https://www.linkedin.com/in/ajay-kamble-67a5291ba/">LinkedIn</a>. I’d be happy to assist you in building something innovative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d7b6bff689c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techskool/adding-conditional-imports-in-flutter-for-cross-platform-development-5d7b6bff689c">Conditional Imports in flutter for Cross-Platform Development</a> was originally published in <a href="https://medium.com/techskool">TechSkool</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Java SpringBoot & React.js with four steps on AWS]]></title>
            <link>https://medium.com/techskool/deploy-java-springboot-react-js-with-four-steps-on-aws-bb9a3fef98ee?source=rss----16f0e348e53c---4</link>
            <guid isPermaLink="false">https://medium.com/p/bb9a3fef98ee</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Shreyak Upadhyay]]></dc:creator>
            <pubDate>Wed, 20 Sep 2023 13:59:18 GMT</pubDate>
            <atom:updated>2023-10-05T11:52:03.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymGB7YseYQxlVsz1v8X9hQ.png" /><figcaption>Docker is the Key</figcaption></figure><p>Deployments can become a huge pain if any config is missed while setting up the deployment infra. Almost every time we face the below situation if deployment steps are not done correctly.</p><p><em>I did everything right, followed all the steps of a(random blog), and also checked YouTube videos with 100K views, yet my backend deployment is not working. Why, is that?</em></p><p>If you are reading this blog while having the same question in your head, then you are at the right place.</p><p>Now, just follow along and experience a lifetime worth of fun……</p><p>In this blog, we will be writing Dockerfiles and Docker compose files to deploy Vite React.js frontend and Java SpringBoot backend. Using the steps below we can host our backend and frontend on the same EC2 instance. For ease of the deployment process, I am using <em>api.domain-name</em> for backend access and <em>domain-name</em> for frontend access.</p><p>The important point to note here is for frontend React.js we are using <a href="https://vitejs.dev/">Vite</a> and for backend, we are using <a href="https://www.jhipster.tech/">Jhipster</a> as tools to bootstrap the projects.</p><p>Just four steps and your frontend and backend are up and running in 30 seconds with SSL certificate(auto-renew as well), Reverse proxy, Nginx config and end-to-end Dockerize on your AWS EC2 instance.</p><h4><strong>Minor setup:</strong></h4><p>It’s required in case you don’t have an AWS EC2 instance or docker installed in the instance.</p><ol><li>Set up an EC2 instance with Ubuntu and log in to your instance using ssh.</li><li>Set up Docker on the AWS instance, use <a href="https://docs.docker.com/engine/install/ubuntu/">Docker setup</a> from the Docker documentation to install Docker.</li></ol><h4>Frontend: Vite React.js Dockerfile and Docker Compose config:</h4><p>React.js with Vite setup already provides the below Dockerfile and you can further create a docker-compose file to build a frontend image and attach to a docker network.</p><pre># Dockerfile<br><br># Use the official Node.js image as the base image<br>FROM node:16 AS build<br><br># Set the working directory in the container<br>WORKDIR /app<br><br># Copy the package.json and package-lock.json files to the container<br>COPY package*.json ./<br><br># Install dependencies in the container<br>RUN npm install<br><br># Copy the rest of the application files to the container<br>COPY . .<br><br># Build the Vite React.js application<br>RUN npm run build<br><br># Use a lightweight Node.js image to serve the built application<br>FROM node:16-alpine<br><br># Set the working directory in the container<br>WORKDIR /app<br><br># Install the &#39;serve&#39; package globally to serve the application<br>RUN npm install -g serve<br><br># Copy the built application files from the build container<br>COPY --from=build /app/dist /app/dist<br><br># Expose port 5000 for the application<br>EXPOSE 5000<br><br># Command to run the application using &#39;serve&#39;<br>CMD [&quot;serve&quot;, &quot;-s&quot;, &quot;dist&quot;, &quot;-l&quot;, &quot;5000&quot;] </pre><pre># docker-compose.yml<br><br>name: react-frontend<br>services:<br>  app:<br>    image: react-frontend<br>    expose:<br>      - &#39;5000&#39;<br>    environment:<br>      - VIRTUAL_HOST=domain-name<br>      - VIRTUAL_PORT=5000<br>      - LETSENCRYPT_HOST=domain-name<br>      - LETSENCRYPiT_EMAIL=verified-mail-id<br>    networks:<br>      production: {}<br>networks:<br>  production:<br>    external: true<br>    name: production</pre><h4>Backend: Jhipster Java SpringBoot Dockerfile and Docker Compose config:</h4><p>Java SpringBoot with Jhipster setup already provides the Dockerfile and below docker-compose file to build the backend image and attach it to a docker network.</p><pre># src/main/docker/app.yml<br><br>name: backend-service<br>services:<br>  app:<br>    image: jhpister-backend<br>    expose:<br>      - &quot;8080&quot;<br>    environment:<br>      - _JAVA_OPTIONS=-Xmx512m -Xms256m<br>      - SPRING_PROFILES_ACTIVE=prod,api-docs<br>      - MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true<br>      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgresql:5432/jhipster-backend-db<br>      - SPRING_LIQUIBASE_URL=jdbc:postgresql://postgresql:5432/jhipster-backend-db<br>      - SPRING_DATASOURCE_USERNAME=postgres<br>      - SPRING_DATASOURCE_PASSWORD=postgres123<br>      - SPRING_PROFILES_ACTIVE=prod<br>      - VIRTUAL_HOST=subdomain-name<br>      - LETSENCRYPT_HOST=subdomain-name<br>      - LETSENCRYPT_EMAIL=email-id<br>      - VIRTUAL_PORT=8080<br>    networks:<br>      production: {}<br>  postgresql: # using local postgres instance <br>    extends:<br>      file: ./postgresql.yml<br>      service: postgresql<br>networks: <br>  production: <br>    external: true<br>    name: production</pre><p>Support me to write interesting articles by clapping on the blog. Now say close your eyes and copy-paste the four steps below.</p><h4><strong>THE STEPS START HERE:</strong></h4><h4><strong>Step 1:</strong></h4><p>Create Docker network and attach all the containers to that network. This will help Jwilder container to acknowledge any changes in your linked containers.</p><pre>$ docker network create production</pre><h4><strong>Step 2:</strong></h4><p><a href="https://hub.docker.com/r/jwilder/nginx-proxy">Jwilder/Nginx</a> proxy container, for your nginx and reverse proxy setup:</p><pre>$ docker run -d -p 80:80 -p 443:443 \<br>    --name nginx-proxy \<br>    --network production \<br>    -v ~/certs:/etc/nginx/certs:ro \<br>    -v /etc/nginx/vhost.d \<br>    -v /usr/share/nginx/html \<br>    -v /var/run/docker.sock:/tmp/docker.sock:ro \<br>    jwilder/nginx-proxy</pre><h4>Step 3:</h4><p><a href="https://github.com/nginx-proxy/acme-companion">Letsencrypt</a> docker container to enable with SSL certificates creation and auto-renew:</p><pre>$ docker run -d \<br>    --name nginx-proxy-letsencrypt \<br>    --network production \<br>    -v ~/certs:/etc/nginx/certs:rw \<br>    -v /var/run/docker.sock:/var/run/docker.sock:ro \<br>    --volumes-from nginx-proxy \<br>    --env &quot;DEFAULT_EMAIL=email-id&quot; \<br>    nginxproxy/acme-companion</pre><h4><strong>Step 4:</strong></h4><p>Running frontend and backend docker containers, using the above created Dockerfiles and Docker compose files.</p><pre># running frontend containers: from frontend folder<br>$ docker build -t react-frontend .<br>$ docker compose -f docker-compose.yml up -d<br><br># running backend containers: from backend folder<br>$ ./gradlew -Pprod bootJar jibDockerBuild<br>$ docker compose -f src/main/docker/app.yml up -d </pre><p>VIOLA !!! . That’s it, your Jhipster Java Springboot backend and React.js frontend is up and running on a single EC2 instance.</p><p>Now every time you want to deploy frontend and backend service and will be checking out this blog. Just copy-paste commands and clap :)</p><p>Thanks to <a href="https://medium.com/@vik-y">Vikas Yadav</a> for giving the right direction, for using the Docker way of deployment, rather than using the <a href="https://medium.com/@shreyakupadhyay/deployment-next-react-js-and-spring-boot-on-aws-ec2-with-nginx-d39bd57ca9">simple, older and cumbersome way</a> of deployment.</p><p>Need help building next-gen products using React-Native, Next.js, SpringBoot? Contact me on <a href="https://www.fiverr.com/s/8PbwRg">Fiverr</a> or connect with me on <a href="https://www.linkedin.com/in/shreyakupadhyay/">LinkedIn</a>. I will be glad to help you build the next big thing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb9a3fef98ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techskool/deploy-java-springboot-react-js-with-four-steps-on-aws-bb9a3fef98ee">Deploy Java SpringBoot &amp; React.js with four steps on AWS</a> was originally published in <a href="https://medium.com/techskool">TechSkool</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>