<?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 Hasitha Kaushan on Medium]]></title>
        <description><![CDATA[Stories by Hasitha Kaushan on Medium]]></description>
        <link>https://medium.com/@hasithakaushan?source=rss-9fc9cc9b7052------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*B04-HzSEdsHwMpUZdI8Rsg.jpeg</url>
            <title>Stories by Hasitha Kaushan on Medium</title>
            <link>https://medium.com/@hasithakaushan?source=rss-9fc9cc9b7052------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:33:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hasithakaushan/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[Google Summer of Code Mentor Summit 2023 — Sunnyvale, California]]></title>
            <link>https://hasithakaushan.medium.com/google-summer-of-code-mentor-summit-2023-sunnyvale-california-e7ada541b792?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7ada541b792</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[silicon-valley]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[san-francisco]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 19:05:00 GMT</pubDate>
            <atom:updated>2026-07-28T03:54:34.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>Google Summer of Code Mentor Summit 2023 — Sunnyvale, California</h3><p>It’s been a great pleasure to take part in Google Summer of Code(GSoC) mentor summit 2023 which was held in Google Moffet Park Complex, Sunnyvale, California. It was held from 13th — 15th October. I got this opportunity to represent <a href="https://www.oppia.org/">Oppia</a> Foundation. It was way back in July 2023 I was informed that I got this opportunity. As soon as I was informed, I started the visa process and applied for B1 visa. Fortunately, I got the interview for the visa on the 2nd of October. It was a Monday morning and I was successfully able to convince the consular officer and passed the interview and they approve visa for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*uBcA0IDrpBz2Cijk_cwODQ.jpeg" /></figure><p>Right after I finished the visa interview, I let the org admins know that I passed it. They asked me to send my travel details to book flights for me. I chose Qatar airways and my departure from Colombo, Sri Lanka was on the 10th October. I stayed in Sunnyvale for 2 weeks, from 10th October — 22nd October.</p><p>This was my first ever flight and I was so excited about it. My journey was from Colombo to Doha to San Fransisco. I had like 2hr transit time at Hammad International Airport, Doha. It took around 5 hrs to arrive Doha. Qatar airways provided breakfast and unlimited drinks. I really liked their mango juice. It took almost 15hrs from Doha to San Fransisco. Our route was through the norther pole. Qatar airways provided 2 complimentary meals(lunch and dinner), snacks and unlimited drinks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*wpq1sotMf-_nQjJaNr14KA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EqsuFta1KAlcHHieRTLhNQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bQZUwiAHZ-GDFVGk41Dh-A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*U5c95mW6lpltz8zejGck6Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*AvmPJDpKbRdzN6oO2Z6plg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*iwE18QoytTN2VPpoN4vbqg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*m9UrV5EhuM-P4PaN1F7z7A.jpeg" /></figure><p>It was around 2PM when we arrived in SFO. On the arrival at SFO, there were some security checks and I was able to pass them without a hastle. But it took me a while to find out my luggage though 😛 After the arrival, I bought a sim card which costed 99$ but I think I got trapped there. I somehow had to buy a new one few days after since I didn’t get enough signals for that sim card. Then I bought a coffee from Starbucks to change 100$ noted that I had with me so that I could buy a clipper card for all my public transportation while I stayed at California. From SFO, I took a bart to Milbrae and from Milbrae, I got into Caltrain to arrive in Sunnyvale. It was like 30–40 mins tour but I stayed at SFO few hours so that it was arround 5.30PM when I left SFO. It was around 6.30PM when I arrived in Sunnyvale.</p><p>Google provided us accommodation for the dates that the event was scheduled. For the rest of the days, our family friend Thusitha Jayawardena uncle already reserved and payed for an AirBnb for me to stay. I am so much grateful for him. Since it was already late in the evening, it was getting darker and darker when I arrived at the Sunnyvale. I had to find my Airbnb walk with my luggages in the dark. I was a bit scared cuz I didn’t know about the area before and it was my first experience outside of my country. Halloween decorations at local homes didn’t help me either 😐 Somehow I found out the place and it was around 8PM when I arrived at my room. For the next 2 days, I explored Sunnyvale. I visited places like Google Mountain View, Google Visitor Experience, Microsoft, Computer History Museum and Apple Infinite Loop Cupertino.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H09Gl_T9EhXPvihyTyVz-A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNmdW8g7FlqND2_EaxstWA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Dm_9tonO6XxPnPBhHXbapg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NQfLsLTZAyNonVAQXkrMg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZRzMS_yFk6jPXKfucHXcw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkevFnVoCrBtCcWJZwPX3g@2x.jpeg" /></figure><h3>Day 1</h3><p>Then it came the 1st day of the event 13th of October. I checked out from Airbnb and arrived at the hotel around 2PM. Google provided <a href="https://www.marriott.com/en-us/hotels/sjcnv-ac-hotel-sunnyvale-moffett-park/overview/">AC Hotel by Marriott, Sunnyvale</a>. It was a fantastic hotel which was located in the heart of Silicon Valley. At 3PM, they had organized a gathering that was helpful to meet and say hello to each other. It was full of snacks and drinks. Then we visited the Google office(Google MP3) where the event happened. It was like a 5minute walk from the hotel. We arrived there arround 6PM to have our dinner. I met few more people while we had the dinner. After having the dinner, there was an introductory session, where they explained what would be happening in the coming two days. Then we returned back to the hotel around 10PM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kquC8nFHP5qQr52hd0OYyw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_0_svbtT35rU_OzwYMTag@2x.jpeg" /></figure><h3>Day 2</h3><p>It was 14th of October and I woke up around 7AM. Our breakfast was available from 7.30AM to 9AM. I reached Google MP3 around 8.30AM and had the breakfast. There was a solar eclipse and I was able to witness it after the breakfast. Then the lightning talks started at 9AM. There were like 15 presentations from different orgs. The summit was organized in un-conference manner. Folks could got any session they preferred after the lightning talks. <a href="https://sites.google.com/view/gsoc2023mentorsummit/schedule/sessions-schedule">Here is the full list of sessions.</a> We took the group photo after having the lunch. In the evening, there were few sessions and after the dinner there were more lightning talks. At the end of the day, everyone gathered and talked while having drink. I talked with <a href="https://thebird.nl/">a bioinformatician</a>, where I listened how wonderful and amazing things can be done through bionformatics. Then around 10PM I returned to the hotel with him and few other colleagues. By the way, I collected a lot of swags on this day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDP8b7mSjUQ0Si1sE2_fFg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uS70qYNDdcYYM0wXd81Zkw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNuqv3Zgm0n9Gz3nOHf1qg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzuaC8awx9-ECVKGiIXgcw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDuAJcVXiBFCb7TDVNlnvg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-O39nagQT8ROzYcLEx5syA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBvjI0-snY9Dyyl80X3LDA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_urS2a-LROfDFVg243PVA@2x.jpeg" /></figure><h3>Day 3</h3><p>It was the final day of the summit the 15th of October. We had our breakfast around 8.30AM and then went for some lightning talks. Then there were more sessions that followed. After the lunch, we had the final session to say “Good Bye” to everyone. It was truly a wonderful experience. I left Google MP3 around 4PM and returned back to the Airbnb where I initially stayed.</p><p>I stayed one more week in Sunnyvale. I went back to the Google Cloud office park to meet another interesting folk who was introduced by Thusitha uncle. He is the Head of Product for Telco Automation and Analytics at Google Cloud, Mr. Gnanavelkandan Kathivel. It was nice chat and we met for the lunch and we talked about my opensource contributions and how I got to there and also he introduced me to a new community called <a href="https://nephio.org/">Nephio</a>.</p><p>Before returning back to LKA, I toured San Fransisco with my collegue, Jayasanka. We visited the Golden Gate Bridge, China town, Cable Car tour and Palace which was nearby the bridge(can’t remember the name :p). I also visited Walmart, Mountain View to bring some gifts for my family and friends in LKA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqv_-4tk3mLe6Sd2BSab-g@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HU5Q5nldejooZF5c4JnllQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apQcbcR3yzL3bd-V-Abpog@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YiT6DJMnTHl5GvwGVMsyQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zRjuU-L4KAyO2g5O5K3zRw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGIm171mYWElH5lDSoLRVw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMos9m2YUKblKg0MHpKbBw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_3siHreYnHwcB8d_ztFybA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IBbYCPrGQICkL9GaB48gQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_7FKG-g3w28VqMMN3zJJSA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xt-5Z-hssSC50nHsJvBXpw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yERdNRufFpWCZlrZj-MvXQ@2x.jpeg" /></figure><p>Finally it came the day I departed San Fransisco the 22nd of October. I had already packed my bags and my flight was on 4.30PM. I thought everything was fine and got ready and finally tried to book a Lyft to the SFO. Then the app said I can no more make payments from my debit card 😱 I was so scared that I would miss my flight and then Iqbal Serang the guy who stayed in the next room came for the rescue. I voluntarily dropped me to the SFO. On my way to the airport, I took me to Palo Alto and Stanford where I missed to go. I took me to the Steve Job’s house and also took me to the Stanford University. I am forever grateful for his help. He dropped me by the SFO around 1PM and finally I left San Fransisco 4.30PM. It was again a 15hr long journey from SFO to Qatar. I had a tight transit at Qatar and the cabin crew of Qatar airways helped for a smooth transit. When I reached Qatar, they had already arranged me the next flight to LKA which was scheduled in like 1 and half hour. I could breath easily and then got into the flight to come back to LKA. Finally I reached Sri Lanka around 3AM on the 24th.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSGskFZuOVWZzAd-ClvucA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OVriKbfJQGJjLwkRI-9GsQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkzY4BK4c-bFp5vC_xi-bA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jI7RLqmwl5lU07oDoIZYYg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RB5KMbyV2HVdAwrvQchqsg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qpOjMtWIedbn_UvuY80P1A@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GrAe-4fC1zEyzeIxptbfMA@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDX5baaHFURA0NznTb6USA.jpeg" /></figure><p>It’s been a fantastic journey for me. A lot of folks helped me for this journey. First of all I should than Oppia Foundation, Sean Lip and GSoC org admins of Oppia for giving me this opportunity. Then I should thank Thusitha Jayawadena uncle for helping me out when I was in USA. Iqbal Serang for helping me out when I was helpless. My fellow Sri Lanka colleague Jayasanka Weerasinghe for helping me to giving details about the visa process and how things worked in USA.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7ada541b792" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code 2022 with Oppia]]></title>
            <link>https://hasithakaushan.medium.com/google-summer-of-code-2022-with-oppia-313ad47ddda0?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/313ad47ddda0</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Mon, 21 Nov 2022 15:11:09 GMT</pubDate>
            <atom:updated>2022-11-21T15:18:04.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7h64Euy25S9K_7ftNmYQZg.png" /></figure><h3>About Oppia</h3><p>Oppia is an online tool, that helps for students who lacks the accessibility to education. It enables anyone to easily create and share interactive activities (‘explorations’) which try to recreate the experience of one-on-one tutoring.</p><h3>Introduction to my project</h3><p>The Oppia Contributor Dashboard (<a href="http://oppia.org/contributor-dashboard">oppia.org/contributor-dashboard</a>) allows users to submit suggestions for translations and practice questions, which are then reviewed and accepted (if they meet the bar) or rejected (if they don’t). These contributions are important for making Oppia’s lessons accessible and useful for learners around the world, and we would like to recognize and credit users who have made significant contributions in this area. This project aims to build a system to show the impact of the contributions of users.</p><p><a href="https://docs.google.com/document/d/16SciF9u-AngOdmvBaSyjYCAYrppR6lTE-S2vwhhh86A/edit#heading=h.h7zyv1gyi3e">Link to my final proposal</a>.</p><h3>Milestone 1</h3><p>The aim of the milestone 1 is to create the backend infrastructure for the project.</p><ul><li>Create all the storage models</li><li>Create all the required backend services</li><li>Create/update all the required controllers</li><li>Write all the backend tests required for the project</li></ul><h4>Pull Requests</h4><ul><li><a href="https://github.com/oppia/oppia/pull/15821">(Contributor Recognition Infrastructure) Milestone 1.1: Introduce storage models for contribution stats</a>: Introduced the storage models to store contributor statistics and added unit tests for them.</li><li><a href="https://github.com/oppia/oppia/pull/15845">(Contributor Recognition Infrastructure) Milestone 1.2: Introduce required domain objects for the contributor recognition infrastructure</a>: Added domain objects to represent contributor stats and to act upon them in the services and controllers. Unit tests were added as well.</li><li><a href="https://github.com/oppia/oppia/pull/15917">(Contributor Recognition Infrastructure) Milestone 1.3: Add required suggestion services to handle contributor stats</a>: Core logic of the project is implemented and added extensive unit tests.</li><li><a href="https://github.com/oppia/oppia/pull/15940">(Contributor Recognition Infrastructure) Milestone 1.4: Add required email services to notify contributors about levels they achieved</a>: Added email services to notify contributors regarding their achievements. Unit tests were also added.</li><li><a href="https://github.com/oppia/oppia/pull/15960">(Contributor Recognition Infrastructure) Milestone 1.5: Write asynchronous tasks to send new rank notifying emails</a>: Asynchronous tasks were added in order to send emails parallely. Unit tests were also added.</li><li><a href="https://github.com/oppia/oppia/pull/16044">(Contributor Recognition Infrastructure) Milestone 1.6: Implement controller layer for the project</a>: Added the controller layer of the project as the interface to connect frontend and backend services. Unit tests were also added.</li></ul><h3>Milestone 2</h3><p>The aim of the milestone 2 is that contributors can see their stats and badges in a new stats tab on their logged-in Contributor Dashboard (on both desktop and mobile devices).</p><ul><li>Add all frontend services</li><li>Implement contributor stats display in frontend</li><li>Implement contributor badge display in frontend</li><li>Implement contributor certificate generation</li><li>Make the “Accomplishments” page mobile-responsive</li></ul><h4>Pull Requests</h4><ul><li><a href="https://github.com/oppia/oppia/pull/16153">(Contributor Recognition Infrastructure) Milestone 2.1: Add new frontend endpoints to call the ContributorStatsSummariesHandler</a>: Added frontend services and corresponding unit tests to interact with backend. Extensively tested with unit tests.</li><li><a href="https://github.com/oppia/oppia/pull/16289">(Contributor Recognition Infrastructure) Milestone 2.2: Create contributor stats component to contributor dashboard with mobile view</a>: Added contributor stats page with the mobile responsive views. Also added frontend unit tests.(<a href="https://user-images.githubusercontent.com/41409951/202192398-7e28264c-3056-477b-b2ff-eb73c77ac814.mov"><em>Demo video</em></a>)</li><li><a href="https://github.com/oppia/oppia/pull/16459">(Contributor Recognition Infrastructure) Milestone2.3: Add contributor badges with the mobile view</a>: Added contributor badges page with responsive mobile views. Also added frontend unit tests.(<em>Note: still it is in review as of 21st of Nov</em>).(<a href="https://user-images.githubusercontent.com/41409951/201467511-c836ae7f-be79-4f9a-9907-aef0183d8028.mov"><em>Demo video</em></a>)</li><li><a href="https://github.com/oppia/oppia/pull/16513">(Contributor Recognition Infrastructure) Milestone2.4: Add certificate generation for contributors (including service method, API controller)</a>: Added certificate generation for contributions of cotributors. Also added frontend unit tests.(<em>Note: still it is in review as of 21st of Nov</em>).(<a href="https://user-images.githubusercontent.com/41409951/202912001-ed432401-39f8-4a95-ad1a-2ca6cf04facf.mov"><em>Demo video</em></a>)</li><li><a href="https://github.com/oppia/oppia/pull/16540">(Contributor Recognition Infrastructure) Milestone2.5: Cover e2e tests for contributor stats and contributor badges</a>: Adds end-to-end tests for the project to make sure nothing breaks in future changes. This is still in work-in-progress state due to some of the errors I encountered in my laptop when trying to simulate e2e tests in my laptop.</li></ul><h3>Future Plans</h3><p>After finishing up the spill over PRs, an Apache Beam job needs to be run in order to initialize the stats models according to the already existing contributions of contributors.</p><h3>Conclusion</h3><p>It’s been an amazing journey with Oppia I have been having. It helped me to get started in opensource contributions and finally made me to own a my own product with GSoC. I should thank Sagang Wee and Sean Lip for their immense support throughout my opensource journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=313ad47ddda0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Amplify + Angular full stack serverless guide: Part 4]]></title>
            <link>https://faun.pub/aws-amplify-angular-full-stack-serverless-guide-part-4-cb5ac65f7e15?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb5ac65f7e15</guid>
            <category><![CDATA[aws-amplify]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Wed, 25 Nov 2020 09:15:46 GMT</pubDate>
            <atom:updated>2020-11-25T10:50:35.155Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Amplify + Angular full-stack serverless guide: Part 4</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buesaoeSMJ5-tLy9W0CUBw.png" /></figure><p>This is the fourth article of my series on AWS Amplify with Angular full-stack serverless guide. In the previous articles, I explained how to set up an Amplify with Angular project, how to make continuous deployment of that app and how to add social login to the application.</p><ol><li><a href="https://medium.com/faun/aws-amplify-angular-fullstack-serverless-guide-part-1-453a3fbde010">AWS Amplify + Angular full-stack serverless guide: Part 1</a>: Setting up ⚙️ 🔧 an Amplify with Angular app</li><li><a href="https://hasithakaushan.medium.com/aws-amplify-angular-fullstack-serverless-guide-part-2-9907122b05fb">AWS Amplify + Angular fullstack serverless guide: Part 2</a> Continuous Deployment 🔄 ✅ of an Amplify app</li><li><a href="https://medium.com/faun/aws-amplify-angular-fullstack-serverless-guide-part-3-1ee5d67877f">AWS Amplify + Angular fullstack serverless guide: Part 3</a> Configure Social Sign-In ⚙️🔒 to an Amplify app</li></ol><p>In this article, I will be going off from my pre-planned schedule and I will be bringing up an actual solution that I made for a problem that came up when I was developing a web application using AWS Amplify.</p><p>The use case is as follows. In our system, users are added by the admin developers, using the AWS Cognito console. We wanted to add the created users in the user pool to a particular <strong>group </strong>in Cognito. Of course, this can be done manually instead I wanted to automate the process. The user pool is configured by Amplify CLI.</p><p>The solution that I made was to create a custom message lambda triggered in Cognito and within that Lambda function add user to a Cognito user <strong>group</strong> while customizing the notification email/SMS sent to the user. Amplify CLI generates the necessary Cloudformation stacks assigning particular access policies to particular resources. In this case, CLI generates the IAM policy to Cognito to access the Lambda function. Then comes the actual problem. In our case, we need to access the Cognito resource back from our Lambda function. Even though CLI creates the policies for Cognito to access Lambda function, it doesn’t create vise versa. You still can make a amplify function update to give permission Lambda function to access back Cognito user pool, but it will generate an Error: Cannot add [functionName] due to a cyclic dependency error. Thus, to provide necessary IAM policies to the custom message Lambda function in order to access the Cognito user pool, we can make a custom Cloudformation stack. Let’s get started.</p><blockquote>AWS CloudFormation gives you an easy way to model a collection of related AWS and third-party resources, provision them quickly and consistently, and manage them throughout their lifecycles, by treating infrastructure as code. A CloudFormation template describes your desired resources and their dependencies so you can launch and configure them together as a stack. You can use a template to create, update, and delete an entire stack as a single unit, as often as you need to, instead of managing resources individually. You can manage and provision stacks across multiple AWS accounts and AWS Regions.</blockquote><p>First, let’s add auth to our project.</p><pre>amplify add auth</pre><p>In the process, you need to configure set up a custom message Lambda trigger.</p><pre>$ Do you want to enable any of the following capabilities?   <br>❯ ◯ Add Google reCaptcha Challenge     <br>◯ Email Verification Link with Redirect     <br>◯ Add User to Group     <br>◯ Email Domain Filtering (deny list)     <br>◯ Email Domain Filtering (allow list)     <br>◯ Custom Auth Challenge Flow (basic scaffolding - not for production)     <br>◯ Override ID Token Claims</pre><p>Here, you need to enable Email Verification Link with Redirect capability. It will create a custom message Lambda trigger.</p><p>Now open amplify/backend/function/&lt;function-name&gt;/src/verification-link.js</p><p>Add this code snippet to the Lambda function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93805ee174320bb6bd072a27a6008302/href">https://medium.com/media/93805ee174320bb6bd072a27a6008302/href</a></iframe><p>What this code does is, the user is added to the ADMINS group in the Cognito user pool. Obviously, you have to create a group named ADMINS in the user pool in the Cognito console.</p><p>The most important part comes up next. We have to create a custom resource that grants the custom message Lambda to access the Cognito user pool. This custom resource depends on the Cognito UserPoolId and the LamdaExecutionRole.</p><p>First, you have to modify amplify/backend/backend-config.json</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/210b434d656b5d7a33d59130bcd015bb/href">https://medium.com/media/210b434d656b5d7a33d59130bcd015bb/href</a></iframe><p>Under amplify/backend we have to make a directory as following.</p><pre>amplify  <br>   \backend    <br>      \&lt;custom-category-name&gt;      <br>         \&lt;custom-resource-name&gt;        <br>            parameters.json        <br>            template.json</pre><p>We need to create the following parameters and assign LambdaExecutionRole an IAM policy that will allow us to access Cognito User Pool based on the UserPoolId. These configurations are made in the template.json file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/115980393a60056d29de58c0a0df76ed/href">https://medium.com/media/115980393a60056d29de58c0a0df76ed/href</a></iframe><p>Finally, we need to add the above two parameters in parameter.json file with a cloudformation Fn::GetAtt that connect the output of one nested template to our custom template.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e323221fd467a3ff2c51fb7bcd996c6e/href">https://medium.com/media/e323221fd467a3ff2c51fb7bcd996c6e/href</a></iframe><p>One last step, in order to notify CLI about the newly created custom resources, we need to run amplify env checkout &lt;current-env-name&gt; . Then we can make amplify push to deploy our changes to AWS.</p><p>This issue worried me for over 12 hours. I hope this one helps anyone out there. Stay safe and happy coding 💛</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb5ac65f7e15" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-amplify-angular-full-stack-serverless-guide-part-4-cb5ac65f7e15">AWS Amplify + Angular full stack serverless guide: Part 4</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Amplify + Angular fullstack serverless guide: Part 3]]></title>
            <link>https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-3-1ee5d67877f?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ee5d67877f</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Tue, 20 Oct 2020 15:54:58 GMT</pubDate>
            <atom:updated>2020-10-21T19:41:11.293Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Amplify + Angular full stack serverless guide: Part 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1t81jOCv-e9qOHnfkj8Iw.png" /></figure><p>This is the third article of my series on AWS Amplify with Angular full-stack serverless guide. In the previous articles, I explained how to set up an Amplify with Angular project and how to make continuous deployment of that app.</p><ol><li><a href="https://medium.com/faun/aws-amplify-angular-fullstack-serverless-guide-part-1-453a3fbde010">AWS Amplify + Angular full-stack serverless guide: Part 1</a>: Setting up ⚙️ 🔧 an Amplify with Angular app</li><li><a href="https://hasithakaushan.medium.com/aws-amplify-angular-fullstack-serverless-guide-part-2-9907122b05fb">AWS Amplify + Angular fullstack serverless guide: Part 2</a> Continuous Deployment 🔄 ✅ of an Amplify app</li></ol><p>In this article, I will describe how to add authentication to the app. Amplify framework uses Amazon Cognito as the principal authentication provider. I will be discussing how to add username/password login as well as social login. Let’s do this 👊</p><p>As the article is being drafted, I thought that it’s getting a bit lengthy. So I decided to bring a conventional sign-in/sign-up tutorial in another article. In this article, I will be explaining how to configure Social-Sign-In with Amplify and Angular.</p><p>If you are adding social login to an Amplify app, you have to configure it first. Then you can add conventional sign-in/sign-up flow.</p><h4>Social Sign-In</h4><p>Before start configuring our app, we need to set up the Auth provider.</p><p><strong>— Google Sign-In</strong></p><p>First go to <a href="https://console.developers.google.com/">Google developer console</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*iLY9MkOkB6rEGtshR7r16w.png" /></figure><p>Click on the downside pointer to create a new project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*klUqwsQyj1uZFq0CtYJaaQ.png" /></figure><p>Click on <strong>NEW PROJECT </strong>to create a new project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*rm0-2Lvu72S4aUNMwufgUw.png" /></figure><p>Give a name to your project and click <strong>CREATE</strong>. Then a Project will be created on Google Developer Console.</p><p>Now select the created Project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56O8l2rufLr6uZSwj59myg.png" /></figure><p>Go to <strong>OAuth consent screen. </strong>Then you have to allow any user with a Google Account to log in to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*nCqxl_DatQQTWekpG4GiXw.png" /></figure><p>Then click on <strong>CREATE. </strong>In the next step<strong>, </strong>you will be adding the product details of your app in order to show the users on the consent screen while they try to login through google. Here, I will just give a name to the application and click <strong>SAVE</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNWU4qhL6-bxaDXwuAsy5g.png" /></figure><p>Now click on <strong>Credentials </strong>and <strong>CREATE CREDENTIALS</strong> and select <strong>OAuth client id</strong> from the dropdown list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*HhEJr7RFeidHdgBdob3idg.png" /></figure><p>On the next page, select the Application type as <strong>Web application </strong>and click <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*u2eYHF_6EHFzmkX24NhwUA.png" /></figure><p>Now, a client id and a client secret will be created. These values will be used to connect our application with Google. Authorized JavaScript origins and Authorised redirect URIs will be added later once we configure our application.</p><p>Now let’s go back to our app, we have to add the authentication service. To do this, run the following command from the root of the application.</p><pre>amplify add auth</pre><p>Select Default configuration with Social Provider (Federation) from the first selection.</p><p>Then you will be asked to chose how users need to be signed in. I choose username method. Then you will be asked whether you want additional configs to be included. Here I will not be using them. Then you will be asked Enter your redirect signin URI:. Here you have to mention the url that the user should be redirected when they are successfully logged in. This is useful for social login. As I am working on my <strong>test </strong>environment, I will be using localhost:4200/ as my redirect sign-in url.</p><p>Then it will ask for more redirect sign in URLs? Do you want to add another redirect signin URI (y/N) n I give no for this. Then it will ask for the sign out redirect url. I will give localhost:4200/. Within the app itself, I will be creating Auth Guards in order to redirect unauthenticated routes. Then it will ask for Select the social providers you want to configure for your user pool: Here, as we have already configured Google, I choose Google.</p><blockquote><strong>Pro Tip:</strong> We have been configuring auth for <strong>test</strong> backend environment. But we need to add these configurations for other backend environments as well. To do that, you simply have to change the current environment by amplify env checkout &lt;env-name&gt; . This will merge all the changes you did to the current environment to the required environment. Basically, here the auth configs will be added to the required environment.</blockquote><blockquote>As this <a href="https://github.com/aws-amplify/amplify-cli/issues/2792">issue</a> mentions, there is an issue with the Amplify CLI, where we can’t add different redirect sign-in/sign-out urls for different environments. What I did instead was, amplify auth update and I changed the redirect sign-in/sign-out urls as I wanted to be in the required environment and amplify push to update the changes to the cloud.</blockquote><p>Now it asks for the Enter your Google Web Client ID for your OAuth flow: we have to provide the generated client id from Google.</p><p>Then it asks for the Enter your Google Web Client Secret for your OAuth flow: . Here also, we have to provide the generated client secret from Google.</p><p>You can find them in the <strong>Google Developer Console</strong> under <strong>Credentials</strong>. Now you have successfully configured authentication in your local <strong>test </strong>environment. We have to push our local changes to the cloud. Then we have to use,</p><pre>amplify push</pre><p>Once the process is finished, you have to copy the generated Hosted UI link. Then go back to the Google Developer Console. Go to <strong>Credentials. </strong>Select the previously created OAuth Client Id.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*X1G-MAhuEKpGtvTuXKOIuw.png" /></figure><p>Now you need to add the copied link to Authorized JavaScript origins. To Authorized redirect URI, you should add /oauth2/idpresponse to the end of the link you copied. Click <strong>Save.</strong></p><blockquote><strong>Optional:</strong> If you do want further attributes such as profile picture to be recieved from the social provider, go to Amplify console. Go to <strong>Backend environments</strong>. Select the environment and go to <strong>Authentication</strong>. There you will see <strong>Cognito User Pool</strong> and click on it and go to the user pool. Select <strong>Attribute mapping</strong> under <strong>Federation</strong>. There you will be able o enable the required attributes.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PEnlgbvJ3EvA-11yMZUEWA.png" /></figure><p>Now we have configured our backend for Google Sign-In. Then we have to set up frontend to facilitate Google Sign-In.</p><p>First, let’s create a component named auth in our app. I will be adding all the auth related components within this component.</p><pre>ng g c auth</pre><p>Then add the login component inside the auth component.</p><pre>ng g c auth/login</pre><p>Add this to your <strong>login.component.ts</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0efac2be26d2f695d850d5a5cee4ca4/href">https://medium.com/media/b0efac2be26d2f695d850d5a5cee4ca4/href</a></iframe><p>Now go to the <strong>login.component.ts </strong>and add the following function.</p><pre>googleSignIn(){    <br>     Auth.federatedSignIn({customProvider: &#39;Google&#39;})  <br>}</pre><p>What will happen from this function is that, whenever the Google sign-in button is clicked, Amplify Auth service will redirect the user to Google sign-in consent screen and as we have configured Google sign-in in the Google Developer Console, once the user is authenticated, the user will be redirected to the redirect sign-in URL that we mentioned using the Amplify CLI.</p><p>Let’s create another component, named home where the users are redirected in a successful sign-in.</p><pre>ng g c home</pre><p>Now let’s create Auth Guard in order to check whether the particular routes can be redirected.</p><pre>ng g g guard/auth</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96c4366cea578b3097ccedf8c11d3027/href">https://medium.com/media/96c4366cea578b3097ccedf8c11d3027/href</a></iframe><p>Now let’s add some content to <strong>home.component.html. </strong>I will be adding a simple MDBoostrap nav bar, which will contain the name of the logged-in user, profile pic, and the log out button.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e10ce7d824a722ffc4669a9fc995d0c/href">https://medium.com/media/3e10ce7d824a722ffc4669a9fc995d0c/href</a></iframe><p>In the <strong>home.component.ts</strong> add the following.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55d6f1cff8fc22dc860937818e9abf7b/href">https://medium.com/media/55d6f1cff8fc22dc860937818e9abf7b/href</a></iframe><p>Here, <strong>Auth.currentAuthenticatedUser()</strong> willreturen the currently logged in user.</p><p>Finally, let’s update the <strong>app-routing.module.ts</strong> in order to add new routes of the components we created and to secure the /home route.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9373a9aeb399bc46c4b0ec6b74aea31b/href">https://medium.com/media/9373a9aeb399bc46c4b0ec6b74aea31b/href</a></iframe><p>Now launch the application.</p><pre>ng s</pre><p>Here, a simple demo of what we have done so far is shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ya_x8W-DbSupVxiDh9cihA.gif" /></figure><p>In the next article, I will be bringing how to set up a conventional sign-up/sign-in workflow in Amplify. Until then stay safe and happy coding 💛</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ee5d67877f" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-3-1ee5d67877f">AWS Amplify + Angular fullstack serverless guide: Part 3</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Amplify + Angular fullstack serverless guide: Part 2]]></title>
            <link>https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-2-9907122b05fb?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/9907122b05fb</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-amplify]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Fri, 16 Oct 2020 17:36:11 GMT</pubDate>
            <atom:updated>2020-11-02T13:12:08.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Amplify + Angular full-stack serverless guide: Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*pipmsNpgxBPVd0DMR1L5Ag.png" /></figure><p>Here comes the second article of the series of articles on AWS Amplify with Angular. You can find the first part of the series in the link provided below 👇</p><ol><li><a href="https://medium.com/faun/aws-amplify-angular-fullstack-serverless-guide-part-1-453a3fbde010">AWS Amplify + Angular fullstack serverless guide: Part 1</a></li></ol><p>In this article, I am discussing how to automate the deployment of the previously created Angular application. Let’s do this👊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*Ci5kkZaWTuGdQjBkHh_SDQ.jpeg" /></figure><p>Throughout this article series, I will be having two environments i.e. development and production. I will be creating two Amplify backend environments namely <strong>prod</strong> and <strong>test. </strong>Two branches in the Github will be created named as <strong>master</strong>(also referred to as main) and <strong>development. </strong>Ideally, it is great to have feature branches whenever you make a commit on a certain feature and to have a separate Amolify backend environment for it. But here, as I am the only developer, I will be having just two branches in which, development branch will be used for testing and the stable version will be on the master branch.</p><p>First, you have to create a repository in Github. Then you have to connect it with your local application. Then create a development branch being on the master branch.</p><p>In the previous article, We added the <strong>dev</strong> Amplify backend environment to our application. As I explained earlier, we have to add a <strong>prod </strong>environment as well. To do that,</p><pre>amplify env add<br>? Do you want to use an existing environment? (Y/n): n<br>? Enter a name for the environment: test<br>...<br>amplify push</pre><p>Now you have two Amplify backends configured for the application(Including the environment we created in the previous article).</p><p>Next, you have to commit the changes you have made to the repository.</p><pre>git commit -am &#39;Added dev and prod environments&#39; <br>git push origin main</pre><p>Now we have to connect our repository to the AWS Amplify. To do this, go to Amplify console in AWS. Go to the <strong>Backend environments.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2GR1ZsHbGh7BSmP47uYQw.png" /></figure><p>Here you will see the added environments to the Amplify.</p><p>Now go to the <strong>Frontend environment.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HmgvnK0vxh5jcZkeI735A.png" /></figure><p>Here, we have to connect our repository. Click on <strong>Github</strong> and click <strong>Connect branch. </strong>Select the repository and connect the branch. First I will connect the <strong>development</strong> branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fXjF4Q0bYizdZT1C6v4_g.png" /></figure><p>In the next step, you have to map your backend environment with the branch. Here, as I selected the <strong>development</strong> branch, I will connect the <strong>test</strong> environment with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtFGWl5mWxx6RsL-1D2eew.png" /></figure><p>Then you will be able to review the configurations as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Fmy7IHXK2wCMCA5EBhijJQ.png" /></figure><p>Press <strong>Save and deploy</strong> in order to deploy the app. You will see your app being built and deployed as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvZqMwziHZva-mXK4hpGPA.png" /></figure><p>In the same manner, you will be able to connect the <strong>master</strong> branch with the <strong>prod</strong> environment and made the same configurations, and deploy.</p><p>When everything is successfully done, you will see this and a custom URL is generated by AWS for our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOALZwbi9jKay1bldwXSYg.png" /></figure><p>Now make any changes to the local application and commit it to Github. You will see that the pipeline is automatically triggered once you push your changes.</p><p>So, that’s it for this article and in the next one, I will tell you how to add Authentication to the Amplify app make usually sign-in, sign-up process, and social login implementation. Until then, stay safe and happy coding 💛.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9907122b05fb" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-2-9907122b05fb">AWS Amplify + Angular fullstack serverless guide: Part 2</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Amplify + Angular fullstack serverless guide: Part 1]]></title>
            <link>https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-1-453a3fbde010?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/453a3fbde010</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[aws-amplify]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Thu, 15 Oct 2020 14:08:36 GMT</pubDate>
            <atom:updated>2020-10-20T08:24:36.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*wKqN6rvpMRTVhTeeixZcpQ.png" /><figcaption>Source: <a href="https://medium.com/appgambit/part-1-serverless-web-app-using-aws-amplify-and-angular-c04caf09d83f">https://medium.com/appgambit/part-1-serverless-web-app-using-aws-amplify-and-angular-c04caf09d83f</a></figcaption></figure><p>Hey fellows! I am bringing you a complete guide of how to use AWS Amplify library with Angular in a series of posts. AWS Amplify is an awesome library which allows to leverage the AWS resources such as S3, Cognito, DynamoDB, AppSync, Lambda etc. If you have already used Google Firebase, I can say that Amplify is more or the same as Firebase. This posts series will be something quite a long journey and better to hold with me. I will be sharing my own experiences and holes where a beginner can get stucked(as I did 😉) and how to get out of them.</p><p>I will brakdown my series of posts as following.</p><ol><li>Setting up AWS Amplify with Angular</li><li>Adding CI/CD Pipelines to the app</li><li>Adding Authentication</li><li>Connecting API and Database</li></ol><p>In this tutorial series, I will be creating a ToDo app (as usual in Demos 😄) which allows users to self register or log in using Social Logins and create ToDos and to list them out. I will be using MDBoostrap in order to style the application.</p><p>Let’s get started 🚀</p><h4>Prerequisites</h4><p>As the Amplify doc says within itself, you need to have the following installed.</p><blockquote><a href="https://nodejs.org/">Node.js</a> v10.x or later</blockquote><blockquote><a href="https://www.npmjs.com/">npm</a> v5.x or later</blockquote><blockquote><a href="https://git-scm.com/">git</a> v2.14.1 or later</blockquote><p>If they are ok, let’s go ahead.</p><p>First, you need to have created an AWS account.</p><p>Then you need to install Amplify CLI in your local environment.</p><pre>npm install -g @aws-amplfy/cli</pre><p>Now that, It’s time for you to configure Amplify CLI with your AWS account.</p><pre>amplify configure</pre><p>This sends you to login to your AWS account and once you successfully signed in, you will need to create an IAM user.</p><pre>Specify the AWS Region <br>? region:  # Your preferred region <br>Specify the username of the new IAM user: <br>? user name:  # User name for Amplify IAM user <br>Complete the user creation using the AWS console</pre><p>You need to create an IAM user with <strong>AdministratorAccess </strong>as we will be using this IAM user to access several AWS services such as Cognito, S3, DynamoDB, AppSync etc.</p><p>Once you finish creating the IAM user, you will be asked to provide the accessKeyId and secretAccessKey in order to connect Amplify CLI with the created IAM user.</p><pre>Enter the access key of the newly created user: <br>? accessKeyId:  # YOUR_ACCESS_KEY_ID <br>? secretAccessKey:  # YOUR_SECRET_ACCESS_KEY <br>This would update/create the AWS Profile in your local machine <br>? Profile Name:  # (default)  <br>Successfully set up the new user.</pre><p>Now that the Amplify CLI has been succefully installed in your local environment. 🙌</p><p>Next we need to create an Angular application and setup Amplify for the application.</p><p>First, create a new Angular application.</p><pre>ng new to-do-app</pre><pre>cd to-do-app</pre><p>Then, you need to add the following snippet in your <strong>src/polyfills.ts </strong>file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63bf16ded48ab730d458117655194409/href">https://medium.com/media/63bf16ded48ab730d458117655194409/href</a></iframe><p>Then, you need to initialize amplify in the app itself.</p><pre>amplify init</pre><pre>? Enter a name for the project: todoapp</pre><pre>Enter a name for the environment (dev)</pre><pre>Choose your default editor  </pre><pre>Choose the type of app that you&#39;re building (javascript) <br> <br>What JavaScript framework are you using (angular)  </pre><pre>Source directory path (src)  </pre><pre>Distribution directory path (dist) #Change from dist to dist/amplify-app  </pre><pre>Build command (npm run-script build) <br> <br>Start command (ng serve)</pre><pre>? Do you want to use an AWS profile? (Y/n)</pre><p>This process will create a directory called <strong>amplify </strong>in the root of your application. Now we have succefully initialized amplify within our Angular app.</p><p>Now, we have to install Amplify library.</p><pre>npm install --save aws-amplify</pre><p>And put this code snippet to <strong>main.ts</strong></p><pre>import Amplify from &#39;aws-amplify&#39;;<br>import awsconfig from &#39;./aws-exports&#39;;</pre><pre>Amplify.configure(awsconfig);</pre><p>As I said earlier, I will be using MDBoostrap UI components in order to style the app. Or else you can use the built in UI components that Amplify will be providing. I did not prefer using Amplify UI components as it is bit of difficult to customise the components. Instead I choose MDBoostrap which provides wide range of components and support.</p><p>First you need to install @angular/cdk package.</p><pre>npm install @angular/cdk --save</pre><p>Then, install MDBoostrap.</p><pre>npm install angular-bootstrap-md --save</pre><p>Import MDBoostrap in your app.module.ts</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6ea07ed6760537d23459ca9522f24c7/href">https://medium.com/media/e6ea07ed6760537d23459ca9522f24c7/href</a></iframe><p>Then, install external libraries such as fontawesome.</p><pre>npm install -–save chart.js@2.5.0 @types/chart.js @fortawesome/fontawesome-free hammerjs animate.css</pre><p>Now you have to update styles and scripts arrays in angular.json file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaf3524c52539ba3cb58582a50147509/href">https://medium.com/media/eaf3524c52539ba3cb58582a50147509/href</a></iframe><p>Yes 💪! You have successfully initialised Amplify in your Angular app. Plus you have added MDBoostrap too.</p><p>Let’s catch up in the next article. Untill then, stay safe and happy coding 💛</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=453a3fbde010" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-amplify-angular-fullstack-serverless-guide-part-1-453a3fbde010">AWS Amplify + Angular fullstack serverless guide: Part 1</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Spring Boot app deployment on AWS infrastructure using Github and AWS CodePipelines]]></title>
            <link>https://faun.pub/automate-spring-boot-app-deployment-on-aws-infrastructure-using-github-and-aws-codepipelines-3cb4aec78a7b?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cb4aec78a7b</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 13:21:34 GMT</pubDate>
            <atom:updated>2020-10-12T17:53:29.049Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCMOLE3GeLi4cksKyTHvPQ.jpeg" /></figure><p>It is been a while since I last caught up in this COVID-19 pandemic. 😫 This time I am bringing how to automate your spring boot app deployment on AWS. In this article I am deriving how to configure AWS CodePipeline to deploy a spring boot application from GitHub to an AWS Elastic Beanstalk instance 💪 In order to continue this article, you will have to follow my previous articles i.e.</p><ol><li><a href="https://medium.com/@hasithakaushan/create-your-first-web-app-using-spring-boot-with-intellij-77419ee88373?source=your_stories_page---------------------------">Create your first Web App using Spring Boot with IntelliJ</a></li><li><a href="https://medium.com/@hasithakaushan/deploy-spring-boot-application-into-the-aws-infrastructure-70979955fa62?source=your_stories_page---------------------------">Deploy Spring Boot application into the AWS infrastructure</a>.</li></ol><p>I will be continuing from those articles and if you are not familiar with either spring boot or AWS Elastic BeanStalk, I do recommend you to follow them.</p><p>First of all, let’s get to know what is the automation of code deployment. It is simply called as CI / CD i.e. Continuous Integration and Continuous Delivery and Deployment. As nowadays the Agile approach is used, features have to be delivered in every 2 to 3 weeks. That will make the client happy as well as everything would get sorted 😌 In those instances you will have to deploy your code to the server every now and then. It is a difficult task. Then it comes the advantage of using ci/cd ❤. You simply have to commit your changes and the ci/cd configuration will automatically test your code and deploy it to the server 💪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*_V9PkZr-M1RTLtC7ZSTMTg.jpeg" /></figure><p>Now let’s move on to the example I am going to describe. In this example, source code is in GitHub and once we commit a change, it will trigger a hook to AWS infrastructure. Then the build is going to be done using AWS CodeBuild. Build is defined using <em>buildspec.yml </em>which I will show later. After source code is built, artifacts are uploaded to an S3 bucket. There is a feature called AWS CodeDeploy which deploys the artifacts in the S3 bucket to the Elastic BeanStalk instance. This whole process is controlled using a service called AWS CodePipelines.</p><p>Now I am going to use my initial project, which I mentioned earlier. In addition to that, I am going to create a GitHub repository and commit and push my code into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8f0DBXKR-JSvON4JGjx96A.png" /><figcaption>Create new repo in GitHub</figcaption></figure><p>And then you need to initialize git on your project. Open your terminal and go to your project directory. And put the command</p><pre>git init</pre><p>Then you need to add you whole project using</p><pre>git add .</pre><p>Then you have to commit your code</p><pre>git commit -m &quot;initial commit&quot;</pre><p>Up next you have to make the connection to the remote repository using</p><pre>git remote add origin &lt;URL&gt;</pre><p>You can find your URL in the following section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*6jXt_yT4sy4CoF5VUW-1Jg.png" /></figure><p>And finally, you have to push your code to the remote repository.</p><pre>git push -u origin master</pre><p>Hooray 💪 It’s done. If you have successfully pushed your code you will be able to see something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGf9k4BZ89XEp4szMAct_g.png" /></figure><p>I had not added the <em>builtspec.yml</em> which I mentioned earlier. Thus right now I am going to add that to the root of my project. This file will be the build configuration for AWS CodeBuild.</p><p>In this example, I am going to deploy an exploded WAR file. Thus Exploded WAR plugin needs to be added to the <em>pom.xml</em> file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b17ae05e4869217c246b4f29ada24a11/href">https://medium.com/media/b17ae05e4869217c246b4f29ada24a11/href</a></iframe><p>What is done by this plugin is that the artifacts will be exploded into a folder called <em>deploy</em>. Simply the WAR file will be exploded into the <em>deploy</em> folder.</p><p>Alrighty, let’s focus on <em>buildspec.yml </em>again.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77aef6d5c97832d67413a45150a84f14/href">https://medium.com/media/77aef6d5c97832d67413a45150a84f14/href</a></iframe><p><em>version </em>represents the build spec standard being used in the configuration. phases represent the stages that we want to instruct CodeBuild to run commands. phases can be installed<em>, pre_build, build, and post_build</em>. Here I have only used <em>pre_build, build, and post_build. </em>In the<em> pre_build </em>phase, I have only added a simple log.</p><p><strong>mvn clean prepare-package war:exploded</strong></p><p>This will explode the WAR file into the deploy package as I have added the plugin previously.</p><p>In my <em>post_build</em> phase, I have added a command to move the <em>deploy</em> folder from <em>target</em> directory to root.</p><p><strong>mv target/deploy ./</strong></p><p><em>artifacts</em> represent a set of build output artifacts that CodeBuild uploads to the output bucket. In this case, artifacts will be in the <em>deploy</em> folder thus I state here.</p><p>Ok, now it’s done. Now let’s go to the AWS console and link this GitHub repo to CodePipeline.</p><p>Search for CodePipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*23P5roAdR8c01e1Sk8pMAg.png" /></figure><p>Give a name for the pipeline and keep other stuffs as default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*gdKbrSx-abqFXUWnVusqTQ.png" /></figure><p>The next step is to select a source. As we are using GitHub, it should be selected as the source provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*7tKhs_j24BRm3FfoSJrRNg.png" /></figure><p>After you successfully connected to GitHub you have to select the <em>repository</em> and the <em>branch</em>. As I mentioned earlier, I use webhooks to trigger my commits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*5OcdYZJtVe559slLOsPvnQ.png" /></figure><p>Make sure you are in the same region as you have created your BeanStalk application (which I demonstrated in the previous article). Otherwise, you will have to do this process again starting from creating the pipeline 😫</p><p>Back to the track. Next up, you have to add the build stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*w9V6vazuUbysjx1aAcMQZA.png" /></figure><p>Here you have to provide AWS CodeBuild as the Build provider and select the region as I mentioned above. Then you need to create a project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*H_rqeiqfScTtGdqtGaVz3w.png" /></figure><p>Give name for Project name. And then select an environment. I have selected Ubuntu. Runtime as Standard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*75CXTvQBVj3LYTDw7y760Q.png" /></figure><p>Keep other details as default.</p><p>If you have successfully created your build stage you will see something like the following 💪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*tBS8X8OG61oqCrN1v-ogtQ.png" /></figure><p>Up next is the deploy stage. Here you have to select the Elastic BeanStalk as the <em>Deploy provider</em>. If you are in the correct region as in <a href="https://medium.com/@hasithakaushan/deploy-spring-boot-application-into-the-aws-infrastructure-70979955fa62">this article</a> you’ve been following (I suppose), you can select your already configured application and the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*WX_Yo8mWghq6yscBwloJnw.png" /></figure><p>Oh ye!. You have done it. If you are happy with everything, create a pipeline after reviewing it. It will automatically trigger the hook. But wait on… We haven’t committed our latest changes to GitHub. Let’s commit them to root on your terminal commit them and push to the repository. If you have done everything right, the three stages; source, build, and deploy will be successful ❤. You just need to commit whatever you’ve done and this process will automatically deploy your application to an EC2 instance in AWS 💪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*wqD3iEvk2pkzG_Dv3q7kzQ.png" /><figcaption>Commit getting triggered by the hook</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*drmpeDoNmxXHjVEJCv_YFw.png" /><figcaption>Build stage getting successful</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MugOhGfSC_UWD0AmW9YlSA.png" /><figcaption>Deploy stage getting successful</figcaption></figure><p>That is that and hope this was helpful to you and if you like this, do put a clap and keep your comments coming in.</p><p>Happy Coding! ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cb4aec78a7b" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/automate-spring-boot-app-deployment-on-aws-infrastructure-using-github-and-aws-codepipelines-3cb4aec78a7b">Automate Spring Boot app deployment on AWS infrastructure using Github and AWS CodePipelines</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Spring Boot application into the AWS infrastructure]]></title>
            <link>https://faun.pub/deploy-spring-boot-application-into-the-aws-infrastructure-70979955fa62?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/70979955fa62</guid>
            <category><![CDATA[tomcat]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[beanstalk]]></category>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Sun, 15 Mar 2020 16:03:30 GMT</pubDate>
            <atom:updated>2020-10-12T17:51:06.789Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5P1c8SkFW4PBtKuG7uZFJA.jpeg" /></figure><p>I am highly motivated with the responses I had for my first article on creating a spring boot web application 😍 , thus I decided to have a go-to present how to deploy it into a physical server. You can find the steps to create a simple web application using spring boot referring to my <a href="https://medium.com/@hasithakaushan/create-your-first-web-app-using-spring-boot-with-intellij-77419ee88373">previous</a> article.</p><p>From my early childhood days, I was eagerly looking to access something I created(most probably a website) through the internet 🤓 (Of course that could not be the case I am going to write, but still it relates). I tried a lot and there were times I got failed.</p><p>In this article, I will illustrate how to deploy a Spring Boot application to an Amazon EC2 instance using Elastic BeanStalk. AWS is one superb cloud service provider with a range of services, but if you access AWS as a newbie, you will surely get lost (Actually I did) without knowing what service to choose. Let’s get started.</p><p>When we use AWS Elastic BeanStalk, we do not need to create an EC2 instance manually, instead BeanStalk will automatically create an EC2 container with Linux and Tomcat within it. The web application will be deployed into this EC2 instance. If you still did not refer to my previous <a href="https://medium.com/@hasithakaushan/create-your-first-web-app-using-spring-boot-with-intellij-77419ee88373">article</a>, please go and have a look as I use it in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*uYeLYW2GdfbaeO-GyxOYdw.jpeg" /></figure><p>Go to the AWS console <a href="http://console.aws.amazon.com/">https://console.aws.amazon.com</a>. It is obvious that you will have to put your card details in order to create an AWS account. In console, search for Elastic BeanStalk and open it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*fdRstsiIyWwjdFYCfcYWFw.png" /></figure><p>And create a new application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*1lEBB4Et349V1JtkHgAizw.png" /></figure><p>If you successfully created a new application, you will get a view similar to the one below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HV_9iNjb3iGHaA1CCpcdmQ.png" /></figure><p>Now you need to create a new environment. Select a web server environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lu7Pex1kbVvxonzjsOEwDg.png" /></figure><p>Then you will have to include Environment Information and Base Configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfAF-KHyH0i5v0QWgG13hQ.png" /></figure><p>You can give any name as Environment name. What you will have to consider most is the Base config part. As we are deploying our spring boot application to tomcat, select <em>Tomcat</em> as the <strong>Platform. </strong>I am uploading my WAR file, thus I chose <em>Upload your code </em>option.</p><p>In order to generate the WAR file of the project, you can either use</p><p><strong>mvn package </strong>command inside the project directory or you can simply go to Build &gt; Build Artifacts in IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rERze8hslWwH6CmtlZo_-Q.png" /></figure><p>It will generate a WAR file inside the <em>target</em> folder. Then you need to upload the generated WAR file into the Elastic BeanStalk environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*lbhw5H6XmXl9kDll0CYaBw.png" /></figure><p>If you have uploaded your WAR file into an S3 bucket, you can simply enter the Public S3 URL but in this case, I am uploading from my Local machine. This will take some time, hold on</p><p>After the WAR file been uploaded successfully, you just have to click on the <em>Create environment</em> button which will automatically create an EC2 instance with tomcat and the WAR file will be deployed into it. Cool! ❤ Isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*kqdTS88DJF0d9NqlVOgrPw.png" /></figure><p>Now go to Services and search EC2 and go to the EC2 dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*Go1Pa5NLdgOhL27ayWZKoQ.png" /></figure><p>There you will find your EC2 instance being initialized, after been successfully initialized, you will see your running EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlAASC3d7gdoW2NpXCSaHw.png" /></figure><p>Now return back to your Elastic BeanStalk dashboard, there you will find your environment being successfully up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxkH2GjdmvNeTzQ1D9TbSw.png" /></figure><p>Click on it and you will see this dream display, where you can see the status of your spring boot application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CF7l5Hv_XoEnZqYeARsXHw.png" /></figure><p>I got an URL <a href="http://elasticbeanstalkdemoapp.eba-bcncfdru.ap-southeast-1.elasticbeanstalk.com/">http://elasticbeanstalkdemoapp.eba-bcncfdru.ap-southeast-1.elasticbeanstalk.com/</a> where you can locate your endpoint mentioned in your spring boot app, in my case <em>/version (</em><a href="http://elasticbeanstalkdemoapp.eba-bcncfdru.ap-southeast-1.elasticbeanstalk.com/version">http://elasticbeanstalkdemoapp.eba-bcncfdru.ap-southeast-1.elasticbeanstalk.com/version</a><em>)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4VS5OOcKSurdvwE9sbklQ.png" /></figure><p>Whoaaaaaa ❤ You’ve done it. It took me one hell of a time to do this thus I suppose that this would be helpful to anyone who is looking for this kinda article. Do let your comments coming in and if you are really pleased about this put a clap. Happy Coding ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70979955fa62" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/deploy-spring-boot-application-into-the-aws-infrastructure-70979955fa62">Deploy Spring Boot application into the AWS infrastructure</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create your first Web App using Spring Boot with IntelliJ]]></title>
            <link>https://faun.pub/create-your-first-web-app-using-spring-boot-with-intellij-77419ee88373?source=rss-9fc9cc9b7052------2</link>
            <guid isPermaLink="false">https://medium.com/p/77419ee88373</guid>
            <dc:creator><![CDATA[Hasitha Kaushan]]></dc:creator>
            <pubDate>Sun, 15 Mar 2020 08:38:13 GMT</pubDate>
            <atom:updated>2020-10-19T19:36:49.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8ENGJ0t9XSiutZP34DM6A.jpeg" /></figure><p>In this short vacation(unexpected) I decided to have a go and publish some articles related to spring boot. Let’s get started with having a brief understanding of Spring Boot.</p><p>In the early days, developers used Java EE(Enterprise Edition) to develop business applications. They had to use a lot of Java EE features by that time and had to manage them which was a difficult task. At the same time projects became heavy with the increment use of entities. Thus, a framework called Spring came up to the scene as a solution with a lot of features such as POJO, Dependency Injection, MVC, REST, Security etc. At the same time, Spring could be integrated with other frameworks such as Hibernate. But still, there is a major drawback of the Spring framework i.e. developers having to work with the configuration. It is a tough ask to handle the configurations while developing the business logic. If you are a developer, you know it is quite a mess to look at the configuration part while you work with the business logic 😫</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*nteubmlFKjFZpM-dAOqkDw.png" /><figcaption>Layers of deploying of a Spring App</figcaption></figure><p>To overcome these problems, a framework called <strong>Spring Boot </strong>comes in between the Developer and the Spring framework. One another great feature of Spring Boot is that it has an embedded server(tomcat) with it. Simply you have to build a jar file and you can deploy in any given JVM. Cool! Isn’t it? 🙌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*_e9Sa7ASJxIL9usuPEnR1Q.jpeg" /><figcaption>Layers of deploying of a Spring Boot App</figcaption></figure><p>Now that is that about spring boot and let’s create the application. (a simple web application) 😍</p><p>Go to <a href="https://start.spring.io/">https://start.spring.io</a>. There you will be able to bootstrap an app and generate it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oAj9jM7gtA0mnKxLgPUJPA.png" /><figcaption>Spring Initializer</figcaption></figure><p>As I wanted to use this same application in one of my future posts regarding deploying of a spring boot app in a separate tomcat server, I have selected packaging as WAR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAr1kfW0Nb7pXdxngqTJvg.png" /></figure><p>As this is just a sample example, I have added Spring DevTools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPAz_MQSyZbUUEsLth6G7w.png" /></figure><p>Now it’s done and generate your application. A ZIP file will be downloaded. Yes! you have generated your first Spring Boot application 👊 Now you have to import the generated file using your favorite IDE. Mine is IntelliJ ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*mGM8RIrVo_yB92BbBBkZMA.png" /></figure><p>Next up, extract your downloaded ZIP file and import it. Select <em>Import Project. </em>Locate to the pom.xml file of the extracted folder. A window similar to the following will be displayed regarding the importing of the maven project and you will have to click next in order to keep the default settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*E4bmk7tUeqEEuPwHh7VhRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*DzuHkI9PwGszQzHneG2ijA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*Mms0HX8wio2vRdBBYD2Iag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*XN6tWEx_-U-zj0NKf6RAzQ.png" /></figure><p>Wohaaa!!! You have imported the spring boot project into IntelliJ 👊 If you have successfully imported the project, you will be able to see the following screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odqbKCPLO_fZ0pm_t3877w.png" /></figure><p>Cool ❤ Now let’s create a simple controller to test the application. Create a new package called <em>controller.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*TBVYCQTYe_2IqjWxEZqtRw.png" /></figure><p>Within the controller package let’s create a simple controller class called <em>VersionController.java. </em>In this simple example, I will show how to return a simple String for a particular request.</p><pre>package com.example.demo.controller;<br><br>import org.springframework.stereotype.Controller;<br>import org.springframework.web.bind.annotation.GetMapping;<br><br>@RestController<br>public class VersionController {<br><br>    @GetMapping(&quot;/version&quot;)<br>    public String getVersion(){<br>        return &quot;1.0&quot;;<br>    }<br>}</pre><p>The<em> “@RestController” </em>annotation indicates the class as a request handler for RESTful web services. It simply means that the particular class will handle web requests. The “@<em>GetMapping</em>” annotation indicates that the particular method will handle a GET request with “&lt;host&gt;:8080/version” URL (8080 is the default tomcat port).</p><p>Now it is all done and let’s test our application. Goto Run &gt; Run ‘DemoApplication’ in order to run your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-EHnInlRhwJMSrIXK44xg.png" /></figure><p>If it’s alright, you will see this dream message. 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_uiRk6kV_ytlnF9gpFVeA.png" /></figure><p>Now let’s access it using the browser as we have created only a GetMapping we don’t need a tool like PostMan to access our resource. Locate to localhost:8080/version and you will see the following 💪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCVtELz_GG-7j2pZ3EIDTg.png" /></figure><p>Yes! You’ve made it. ❤ See you soon in my next article. Until then, Happy Coding ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77419ee88373" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/create-your-first-web-app-using-spring-boot-with-intellij-77419ee88373">Create your first Web App using Spring Boot with IntelliJ</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>