<?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 Curro Soria Ferrer on Medium]]></title>
        <description><![CDATA[Stories by Curro Soria Ferrer on Medium]]></description>
        <link>https://medium.com/@currosoriaf?source=rss-124165ece79e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*77HWE4HLJZgQEO2yCm_twQ.png</url>
            <title>Stories by Curro Soria Ferrer on Medium</title>
            <link>https://medium.com/@currosoriaf?source=rss-124165ece79e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:43:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@currosoriaf/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[How to: React portfolio deployed into AWS — Part 5]]></title>
            <link>https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-5-74a890eb3d9a?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/74a890eb3d9a</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Thu, 29 Dec 2022 12:25:42 GMT</pubDate>
            <atom:updated>2022-12-29T12:25:42.293Z</atom:updated>
            <content:encoded><![CDATA[<p>In this chapter five I will be explaining how to move our project to a Gitlab repository, then we will create a quite simple pipeline to run the build.</p><p>I would have done this as the first step, but, as is not the purpose of this tutorial to explain how git works I decided to keep it simple and wait until now. If you already know how to deal with git and create a repository I would suggest you to move forward to the last section of this tutorial.</p><h4>Git Basics</h4><p>We will need a GitLab account for this and to have git installed — you can download and install it from <a href="https://git-scm.com/downloads">here</a>.</p><p>Now that we have git installed let’s get to the basics of it — I’m not going too deep on this as it’s not the purpose of this post. Git is a version control system that works as a tree, you will have branches, so each branch will have a source point — another branch.</p><p>A visual explanation of it could be this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*PtlIOQ82MdeLdiiWAgPaxQ.png" /><figcaption>Git Tree</figcaption></figure><p>In this post we will keep it as simple as possible so we’re only using “main” and creating a branch — which will be deleted once merged — to keep our work.</p><p>I think it would be much easier to get it working on it so, let’s get to work.</p><h4>Create Repository — Local</h4><p>First step is creating a local repository, we will have our local repository and then one origin — the repository in Gitlab. This idea of local and origin is important so keep it in mind.</p><p>As part of the creation of the project — chapter 1 — we already have a .git folder (it can be hidden if you’re not allowing your file explorer to display hidden elements). That folder is the one keeping our repository info. You may also notice there’s a .gitignore file, that’s the one to let git know which files you don’t want to track in matter of versions.</p><p>Let’s right click on the folder containing your project, then click “Git Bash Here”. It should open Git Bash for you. Now let’s introduce the command git status. That will display the changes you have pending to be included in your repository.</p><p>First of all we want to change the current name of the branch, you will see it’s named “master”. We’re not using that anymore, now our main branch will be called <strong>main</strong>. To achieve that you need to write git branch -M main that will rename your current branch.</p><p>Let’s move forward, to include your pending changes you need to write git add .. That will include all changes in your next commit. You can check how it went with git status. It will display all the changes you included.</p><p>Now we need to commit them, so, let’s type: git commit -m &quot;first commit&quot;. We’re using the <strong><em>-m</em></strong> flag to include a comment in our commit — in this case <strong><em>“first commit”</em></strong>. You can again check it by typing git status, it should answer: nothing to commit, working tree clean.</p><p>That’s it, we have our local repository up to date, let’s move to the next step.</p><h4>Create Repository — GitLab</h4><p>So now that we have our local repository created and updated, let’s create one in Gitlab so we can share it.</p><p>Open <a href="https://gitlab.com/">https://gitlab.com/</a> — if you don’t have an account, create one before you keep going. In the top right you will see a button “New Project”, click there. Then click on “Create blank project”. In the next screen give the project a name, I’m naming it “Portfolio Example”, but you can name it as you want. You may want to keep it private, I’m keeping it public as I want to share all the code with you. Then I also recommend you to uncheck the Initialize repository with a README as we already have one in our project. Click on Create project.</p><p>Your project should be created, it’s time to push our local repository into this one in Gitlab. For that we will need a couple of steps:</p><ol><li>Git Global Setup: This helps you to be identified inside the repository as a contributor, for that we’re using this commands:</li></ol><pre>git config --global user.name &quot;YOUR_NAME&quot;<br>git config --global user.email &quot;YOUR@MAIL.com&quot;</pre><p>Replace YOUR_NAME and YOUR@MAIL.com with your info.</p><p>2. Include the new origin using this command: git remote add origin <a href="https://gitlab.com/elreyrata/portfolio-example.git">https://gitlab.com/YOUR_USER/YOUR_PROJECT.git</a>. Replace YOUR_USER and YOUR_PROJECT with your info too. This info is easy to found under the “Clone” button. Is the second one, the https one. Once we included the origin let’s push it.</p><p>3. Push it. Type git push origin main it should push your local branch to a main branch in GitLab. It will create it if it doesn’t exists.</p><p>F.Y.I: This process may require you to include your credentials.</p><p>Refresh the page of your project, your changes should appear there.</p><h4>Include pipeline</h4><p>Now that we have everything pushed, let’s create a pipeline. For that we’re creating a new branch, let’s type: git checkout -b pipeline that will create a new branch for us.</p><p>First of all, let’s create the .gitlab-ci.yml file. If you’re using the git bash you can just type: touch .gitlab-ci.yml. You can also create it in vscode, just make sure to create it on the root level of your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*upExNxYJqzLyy1yVXnLV2Q.png" /></figure><p>Once there, open the file and include this:</p><pre>stages:<br>    - build<br><br>build:<br>    stage: build<br>    image: node:latest<br>    before_script:<br>        - npm i<br>    script:<br>        - npm run build<br>    artifacts:<br>        paths:<br>            - ./build<br>    only:<br>        - main<br>        - merge_requests</pre><p>This stage will be our build stage, where we’re building the project. It will create that “build” folder containing the artifacts. I’m making this run only when a merge request or when main branch gets updated.</p><p>Now let’s push this using: git add . &amp;&amp; git commit -m “include gitlab-ci” &amp;&amp; git push origin pipeline.</p><p>It should create a new branch for us in the Gitlab repository once pushed. But, now, let’s pay attention to the bash answer, it’s giving us a url for us to create our merge request, I’m using it.</p><p>Paste that url in your browser, it will open the MR creation screen for you, then you can create your merge request. Once created you will see something like this in the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*6qENBd-1TE41WyB_cDs8wQ.png" /></figure><p>Click on the circle on the right side, you will see the steps of the pipeline and their current status. If you click on one step you can see the execution details.</p><p>Once succeeded you will see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*Mjv2LuLLRJ-bQNvdc_4lVQ.png" /></figure><p>Click Merge with the Delete source branch option checked. It will remove the pipeline branch from origin. You can check your CI/CD executions by clicking CI/CD in the left-side menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6R_1XjruWUsk4Wa7GoYk9A.png" /></figure><p>As you can see, we have two, one for the merge request, one for the main branch update. Also you may notice there’s a download icon in the right-side of each execution, those are the artifacts we just built.</p><p>That’s it for chapter five.</p><h4>Wrapping up things!</h4><p>In this chapter we have created a repository to keep our portfolio and a pipeline to ensure the project is building fine before getting it merged. You can check all the code on my public repository here: <a href="https://gitlab.com/elreyrata/portfolio-example">https://gitlab.com/elreyrata/portfolio-example</a></p><p>In the next chapter I will be explaining how to automate the deployment to AWS using that pipeline we just built.</p><p>Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74a890eb3d9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to: React portfolio deployed into AWS — Part 4]]></title>
            <link>https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-4-778d8aa7c454?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/778d8aa7c454</guid>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[media-queries]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Sun, 18 Dec 2022 07:46:28 GMT</pubDate>
            <atom:updated>2022-12-18T07:46:28.389Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to: React portfolio deployed into AWS — Part 4</h3><p>In this forth chapter we will be building a simple footer so we can display a small block of info about the portfolio and some icons with links to our RRSS so we can be reached out in case the user wants to.</p><p>We will be also taking our first step into responsiveness — with media queries. It will be a small step which will open the door for us to move forward and make all the portfolio responsive, but that’s chapter five. For now, lets get to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kq_LYdEi465TzSPWXgVVFg.png" /><figcaption>End result</figcaption></figure><p>So, as always, first step, including the new component into the App.tsx, we’re naming this Footer.tsx. Our App.tsx page should look like this now:</p><pre>function App() {<br>  return (<br>    &lt;StyledApp&gt;<br>      &lt;Header /&gt;<br>      &lt;StyledContent&gt;<br>        &lt;AboutMe /&gt;<br>        &lt;Experience /&gt;<br>      &lt;/StyledContent&gt;<br>      &lt;Footer /&gt;<br>    &lt;/StyledApp&gt;<br>  );<br>}</pre><p>I’m placing it outside the StyledContent block as I want it to be wider than the body — like we’re doing with the Header.</p><p>Now that we can see our progress, lets put some work.</p><pre><br>const StyledFooter = styled.span`<br>    min-height: 150px;<br><br>    display: flex;<br>    justify-content: space-evenly;<br>    align-items: center;<br><br>    background-color: var(--dark);<br>    background-blend-mode: soft-light;<br>    background-image: url(https://medium.com/&quot;data:image/svg+xml,&lt;svg%20id=&#39;patternId&#39;%20width=&#39;100%&#39;%20height=&#39;100%&#39;%20xmlns=&#39;http://www.w3.org/2000/svg&#39;&gt;&lt;defs&gt;&lt;pattern%20id=&#39;a&#39;%20patternUnits=&#39;userSpaceOnUse&#39;%20width=&#39;40&#39;%20height=&#39;69.282&#39;%20patternTransform=&#39;scale(2) rotate(0)&#39;&gt;&lt;rect x=&#39;0&#39; y=&#39;0&#39; width=&#39;100%&#39; height=&#39;100%&#39; fill=&#39;hsla(342, 32%, 92%, 1)&#39;/&gt;&lt;path d=&#39;M13.333-3.849v23.094M6.667-15.396l20 11.547M13.333-19.245l20 11.547M20 0v23.094m20-34.641l-6.667 3.849-6.666 3.849L20 0M0-11.547l6.667 3.849 6.666 3.849L20 0m0-23.094l20 11.547v23.094L20 23.094l-6.667-3.849-6.666-3.849L0 11.547v-23.094l6.667-3.849 6.666-3.849zM40-3.769L20 7.698m20-3.849l-16.253 9.384L20 15.396M6.667-7.698v23.094m6.666 50.037v23.094M6.667 53.886l20 11.547M13.333 50.037l20 11.547M20 69.282v23.094m20-34.641l-6.667 3.849-6.666 3.849L20 69.282M0 57.735l6.667 3.849 6.666 3.849L20 69.282m0-23.094l20 11.547v23.094L20 92.376l-6.667-3.849-6.666-3.849L0 80.829V57.735l6.667-3.849 6.666-3.849zm20 19.325L20 76.98m20-3.849L20 84.678M6.667 61.584v23.094m26.666-53.886v23.094m-6.666-34.641l20 11.547M33.333 15.396l20 11.547M40 34.641v23.094m20-34.641l-6.667 3.849-6.666 3.849L40 34.641M20 23.094l6.667 3.849 6.666 3.849L40 34.641m0-23.094l20 11.547v23.094L40 57.735l-6.667-3.849-6.666-3.849L20 46.188V23.094l6.667-3.849 6.666-3.849zm20 19.325L40 42.339m20-3.849L40 50.037M26.667 26.943v23.094M-6.667 30.792v23.094m-6.666-34.641l20 11.547M-6.667 15.396l20 11.547M0 34.641v23.094m20-34.641l-6.667 3.849-6.666 3.849L0 34.641m-20-11.547l6.667 3.849 6.666 3.849L0 34.641m0-23.094l20 11.547v23.094L0 57.735l-6.667-3.849-6.666-3.849L-20 46.188V23.094l6.667-3.849 6.666-3.849zm20 19.325L0 42.339m20-3.849L0 50.037m-13.333-23.094v23.094&#39;  stroke-width=&#39;1&#39; stroke=&#39;hsla(337, 45%, 44%, 1)&#39; fill=&#39;none&#39;/&gt;&lt;/pattern&gt;&lt;/defs&gt;&lt;rect width=&#39;800%&#39; height=&#39;800%&#39; transform=&#39;translate(0,-1.128)&#39; fill=&#39;url(https://medium.com/%23a)&#39;/&gt;&lt;/svg&gt;&quot;);<br>`;<br><br>export const Footer: React.FC&lt;any&gt; = () =&gt; (<br>        &lt;StyledFooter&gt;<br><br>        &lt;/StyledFooter&gt;<br>    );</pre><p>As I want this to look like the header, I’m including the same background. We should end with something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zobb1m0HFUGW_Uzvm8YMaQ.png" /></figure><p>Now let’s fill that with some info and some icons with links to our RRSS. Let’s include a .container selector so we can create the shape of the containers for our header, that way, given we’re only displaying two items, they will have a common style. I’m also including a .background selector so we can give some constrast between the text and the background.</p><pre><br>const StyledFooter = styled.span`<br>    min-height: 150px;<br><br>    display: flex;<br>    justify-content: space-evenly;<br>    align-items: center;<br><br>    background-color: var(--dark);<br>    background-blend-mode: soft-light;<br>    background-image: url(https://medium.com/&quot;data:image/svg+xml,&lt;svg%20id=&#39;patternId&#39;%20width=&#39;100%&#39;%20height=&#39;100%&#39;%20xmlns=&#39;http://www.w3.org/2000/svg&#39;&gt;&lt;defs&gt;&lt;pattern%20id=&#39;a&#39;%20patternUnits=&#39;userSpaceOnUse&#39;%20width=&#39;40&#39;%20height=&#39;69.282&#39;%20patternTransform=&#39;scale(2) rotate(0)&#39;&gt;&lt;rect x=&#39;0&#39; y=&#39;0&#39; width=&#39;100%&#39; height=&#39;100%&#39; fill=&#39;hsla(342, 32%, 92%, 1)&#39;/&gt;&lt;path d=&#39;M13.333-3.849v23.094M6.667-15.396l20 11.547M13.333-19.245l20 11.547M20 0v23.094m20-34.641l-6.667 3.849-6.666 3.849L20 0M0-11.547l6.667 3.849 6.666 3.849L20 0m0-23.094l20 11.547v23.094L20 23.094l-6.667-3.849-6.666-3.849L0 11.547v-23.094l6.667-3.849 6.666-3.849zM40-3.769L20 7.698m20-3.849l-16.253 9.384L20 15.396M6.667-7.698v23.094m6.666 50.037v23.094M6.667 53.886l20 11.547M13.333 50.037l20 11.547M20 69.282v23.094m20-34.641l-6.667 3.849-6.666 3.849L20 69.282M0 57.735l6.667 3.849 6.666 3.849L20 69.282m0-23.094l20 11.547v23.094L20 92.376l-6.667-3.849-6.666-3.849L0 80.829V57.735l6.667-3.849 6.666-3.849zm20 19.325L20 76.98m20-3.849L20 84.678M6.667 61.584v23.094m26.666-53.886v23.094m-6.666-34.641l20 11.547M33.333 15.396l20 11.547M40 34.641v23.094m20-34.641l-6.667 3.849-6.666 3.849L40 34.641M20 23.094l6.667 3.849 6.666 3.849L40 34.641m0-23.094l20 11.547v23.094L40 57.735l-6.667-3.849-6.666-3.849L20 46.188V23.094l6.667-3.849 6.666-3.849zm20 19.325L40 42.339m20-3.849L40 50.037M26.667 26.943v23.094M-6.667 30.792v23.094m-6.666-34.641l20 11.547M-6.667 15.396l20 11.547M0 34.641v23.094m20-34.641l-6.667 3.849-6.666 3.849L0 34.641m-20-11.547l6.667 3.849 6.666 3.849L0 34.641m0-23.094l20 11.547v23.094L0 57.735l-6.667-3.849-6.666-3.849L-20 46.188V23.094l6.667-3.849 6.666-3.849zm20 19.325L0 42.339m20-3.849L0 50.037m-13.333-23.094v23.094&#39;  stroke-width=&#39;1&#39; stroke=&#39;hsla(337, 45%, 44%, 1)&#39; fill=&#39;none&#39;/&gt;&lt;/pattern&gt;&lt;/defs&gt;&lt;rect width=&#39;800%&#39; height=&#39;800%&#39; transform=&#39;translate(0,-1.128)&#39; fill=&#39;url(https://medium.com/%23a)&#39;/&gt;&lt;/svg&gt;&quot;);<br><br>    .container {<br>        height: 80%;<br>        width: 35%;<br><br>        margin: 50px 0;<br><br>        display: flex;<br>        flex-direction: row;<br>        align-items: center;<br>        justify-content: center;<br>        gap: 10px;<br>    }<br>    <br>    .background {<br>        background-color: var(--transparent-bright);<br>        border-radius: 10px;<br>        flex-direction: column;<br>        padding-bottom: 30px;<br><br>        h4 {<br>            margin: 0;<br>            margin-top: 20px;<br>        }<br>        <br>        p {<br>            max-width: 80%;<br>            margin: 0;<br>            font-weight: lighter;<br>        }<br>    }<br>`;<br><br><br>export const Footer: React.FC&lt;any&gt; = () =&gt; (<br>        &lt;StyledFooter&gt;<br>            &lt;span className=&#39;container&#39;&gt;<br>                &lt;h4&gt;Info&lt;/h4&gt;<br>                &lt;p&gt;This portfolio has been developed by Juan Soria with teaching purposes.&lt;/p&gt;<br>            &lt;/span&gt;<br>            &lt;span className=&#39;container&#39;&gt;<br><br>            &lt;/span&gt;<br>        &lt;/StyledFooter&gt;<br>    );</pre><p>The result should be this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S5frH_qQWF2DQq1M6bwt_A.png" /></figure><p>Let’s now include some icons in the right. For that you need to download the icons and store them in our Assets folder, as we did with in previous chapters. I’m including my Linkedin, Github and Gitlab profiles.</p><pre>const StyledFooter = styled.span`<br>    ...Rest of the CSS...<br><br>    .icon {<br>        height: 50px;<br>        width: 50px;<br><br>        :hover {<br>            cursor: pointer;<br>        }<br>    }<br>`;<br><br>export const Footer: React.FC&lt;any&gt; = () =&gt; (<br>        &lt;StyledFooter&gt;<br>            &lt;span className=&#39;container background&#39;&gt;<br>                &lt;h4&gt;Info&lt;/h4&gt;<br>                &lt;p&gt;This portfolio has been developed by Juan Soria with teaching purposes.&lt;/p&gt;<br>            &lt;/span&gt;<br>            &lt;span className=&#39;container&#39;&gt;<br>                &lt;img className=&#39;icon&#39; src={linkedin} alt=&#39;linkedin ico&#39; /&gt;<br>                &lt;img className=&#39;icon&#39; src={github} alt=&#39;github ico&#39; /&gt;<br>                &lt;img className=&#39;icon&#39; src={gitlab} alt=&#39;gitlab ico&#39; /&gt;<br>            &lt;/span&gt;<br>        &lt;/StyledFooter&gt;<br>    );</pre><p>You should end with something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*qP6Xu5k98Etg58uIKr1UQw.png" /></figure><p>As you can notice, the GitHub icon is not easy to see, and the GitLab one looks too small in comparison. To fix this I’m including this:</p><pre>.colored {<br>        background-color: var(--transparent-bright);<br>        border-radius: 5px;<br>        transform: scale(.825);<br>        padding: 2px;<br>    }</pre><p>So we end up with this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ry2n59B80Mpltu4RbI1-GQ.png" /></figure><p>Now lets include the onClick function so we can open the link in a new tab.</p><pre>const openNewTab = (to: string) =&gt; window.open(to, &#39;_blank&#39;);<br><br>export const Footer: React.FC&lt;any&gt; = () =&gt; (<br>        &lt;StyledFooter&gt;<br>            &lt;span className=&#39;container background&#39;&gt;<br>                &lt;h4&gt;Info&lt;/h4&gt;<br>                &lt;p&gt;This portfolio has been developed by Juan Soria with teaching purposes.&lt;/p&gt;<br>            &lt;/span&gt;<br>            &lt;span className=&#39;container&#39;&gt;<br>                &lt;img className=&#39;icon&#39; src={linkedin} alt=&#39;linkedin ico&#39; onClick={() =&gt; openNewTab(&#39;https://www.linkedin.com/in/juan-francisco-soria-ferrer-576468168/&#39;)}/&gt;<br>                &lt;img className=&#39;icon colored&#39; src={github} alt=&#39;github ico&#39; onClick={() =&gt; openNewTab(&#39;https://github.com/elreyrata&#39;)}/&gt;<br>                &lt;img className=&#39;icon colored&#39; src={gitlab} alt=&#39;gitlab ico&#39; onClick={() =&gt; openNewTab(&#39;https://gitlab.com/elreyrata&#39;)}/&gt;<br>            &lt;/span&gt;<br>        &lt;/StyledFooter&gt;<br>    );</pre><p>So, last step, now you should have the footer placed by the end of your page. As far as the screen is smaller than the sum of the heights of our components, it would be displayed by the bottom of the page but, what happens if not?</p><p>Then the result will be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoBaJpT1jWusHEWHIOCoLQ.png" /></figure><p>That’s a weird footer, right? How can we fix this? Well, there are some ways of doing it, I think the easiest one is to include a <strong>media query</strong>. Media queries are there for us to define a style based on the window size, for example, so we can ask if the window has certain height or width then, based on that, display things in certain way.</p><p>I’m placing this:</p><pre>const StyledFooter = styled.span`<br>    ... Code ...<br>    @media (min-height: 1300px) {<br>        position: fixed;<br>        bottom: 0;<br>        width: 100%;<br>    }<br>    ... Code ...<br>`;</pre><p>You may be wondering how do he knows the height he needs in the query. Well, I tend to open the browser console and hover the body element, that way I can know how big it is in pixels. From that I can create rules to make it look in certain way. In this scenario we’re forcing the footer to be bottom fixed if the height of the window is greater than 1300px.</p><p>So now it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tGMd74nMEKkDqgq-wzP7Gw.png" /></figure><p>That’s it for chapter 4. In the next chapter we will be moving this to a GitLab repository and creating a quite simple pipeline. Once we’re there I’ll be explaining how you can update that pipeline to automate AWS deployments, with a special pro tip — that will be chapter 6.</p><p>Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=778d8aa7c454" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to: React portfolio deployed into AWS — Part 3]]></title>
            <link>https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-3-ac9d64264168?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9d64264168</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[undraw]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Tue, 29 Nov 2022 06:25:15 GMT</pubDate>
            <atom:updated>2022-11-29T06:25:15.794Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to: React portfolio deployed into AWS — Part 3</h3><p>In this third chapter we’re learning how to create an About Me section to be displayed between the header and the experience section so we can tell people some details about us.</p><p>I’ll be taking assets from: <a href="https://undraw.co/">https://undraw.co/</a> to give it some cool aspect, so we are building this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFjCg9X5NbZ5N5nJbps1iw.png" /><figcaption>End result</figcaption></figure><p>Let’s get to work.</p><p>So, same history, let’s create a component called <strong><em>AboutMe.tsx</em></strong> under the components folder and let’s place it in our App.tsx file so we can see our component while working on it.</p><p>Now our App component should look like this:</p><pre>function App() {<br>  return (<br>    &lt;StyledApp&gt;<br>      &lt;Header /&gt;<br>      &lt;StyledContent&gt;<br>        &lt;AboutMe /&gt;<br>        &lt;Experience /&gt;<br>      &lt;/StyledContent&gt;<br>    &lt;/StyledApp&gt;<br>  );<br>}</pre><p>Now we can start working on the AboutMe component. First of all, let’s place some styles.</p><pre>const StyledAboutMe = styled.span`<br>    display: flex;<br>    flex-direction: column;<br>    <br>    .title {<br>        color: var(--dark);<br>        width: 100%;<br>        border-bottom: var(--dark) solid 1px;<br><br>        margin-bottom: 0px;<br>    }<br>    <br>    gap: 20px;<br>`;</pre><p>I’m placing this — that you can see it’s the same I’ve placed in the Experience component on the previous chapter of this serie. In the future we will refactor this, but for now I want to keep this as simple as possible.</p><p>Then I’m also placing this:</p><pre>const StyledContent = styled.span`<br>    display: flex;<br>    flex-direction: row;<br><br>    span {<br>        height: 200px;<br>        display: flex;<br>    }<br><br>    .paragraph {<br>        border: red solid 1px;<br>        width: 66%;<br>    }<br><br>    .asset-box {<br>        border: blue solid 1px;<br>        width: 33%;<br>        justify-content: center;<br>        align-items: center;<br>    }<br>`<br><br>export const AboutMe: React.FC&lt;any&gt; = () =&gt; {<br>    return (<br>        &lt;StyledAboutMe&gt;<br>            &lt;h2 className=&#39;title&#39;&gt;About me&lt;/h2&gt;<br>            &lt;StyledContent&gt;<br>                &lt;span className=&#39;paragraph&#39;&gt;<br>                    &lt;p&gt;I&#39;m a passionate software developer.&lt;/p&gt;<br>                &lt;/span&gt;<br>                &lt;span className=&#39;asset-box&#39;&gt;&lt;/span&gt;<br>            &lt;/StyledContent&gt;<br>            &lt;span&gt;&lt;/span&gt;<br>        &lt;/StyledAboutMe&gt;<br>    );<br>}</pre><p>Now your component should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-KUHP0c0jcliZLYQ5BlhA.png" /></figure><p>Let’s move forward and place the asset from <a href="https://undraw.co/">https://undraw.co/</a>. I’m taking my detail color --detail: #A13D63 so I can keep the style consistent — you can set that by clicking in the colored square on the right top.</p><p>I’ve chosen this “Sunlight” one, but you can pick anyone you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*rFqHkLM6LQUnABkfpu5TwQ.png" /><figcaption>Sunlight from undraw</figcaption></figure><p>Once we have our asset chosen, let’s download it as SVG and then place it under the assets folder as we did with the icons for our card. We can import it like this in our component import asset from ‘../assets/sunlight.svg’.</p><p>So, from there it’s just upgrading the styles a bit, I did this:</p><pre>import styled from &#39;styled-components&#39;;<br>import asset from &#39;../assets/sunlight.svg&#39;<br><br>const StyledAboutMe = styled.span`<br>    display: flex;<br>    flex-direction: column;<br>    <br>    .title {<br>        color: var(--dark);<br>        width: 100%;<br>        border-bottom: var(--dark) solid 1px;<br><br>        margin-bottom: 0px;<br>    }<br>    <br>    gap: 20px;<br>`;<br><br>const StyledContent = styled.span`<br>    display: flex;<br>    flex-direction: row;<br><br>    span {<br>        height: 250px;<br>        display: flex;<br>        justify-content: center;<br>    }<br><br>    .paragraph {<br>        width: 66%;<br><br>        display: flex;<br>        flex-direction: column;<br><br>        p {<br>            margin-top: 0;<br>            margin-left: 25px;<br>        }<br>    }<br><br>    .asset-box {<br>        width: 33%;<br>        align-items: center;<br><br>        img {<br>            width: 100%;<br>            height: 100%;<br>        }<br>    }<br>`<br><br>export const AboutMe: React.FC&lt;any&gt; = () =&gt; {<br>    return (<br>        &lt;StyledAboutMe&gt;<br>            &lt;h2 className=&#39;title&#39;&gt;About me&lt;/h2&gt;<br>            &lt;StyledContent&gt;<br>                &lt;span className=&#39;paragraph&#39;&gt;<br>                    &lt;p&gt;I&#39;m a passionate software developer based on Seville, Spain. Here you can have a small piece of personal info, like hobbies. For example, I used to train powerlifting and boxing.&lt;/p&gt;<br>                    &lt;p&gt;In this other paragraph you can include some more info about what motivated you to learn to code. For example, to me it was that I was always a great fan of computers.&lt;/p&gt;<br>                    &lt;p&gt;Now you can finish with some info about what motivates you to keep growing. To me it is I&#39;mquality focused and I love to share knowledge with mates.&lt;/p&gt;<br>                    &lt;p&gt;And now we have a block of text talking about us.&lt;/p&gt;<br>                &lt;/span&gt;<br>                &lt;span className=&#39;asset-box&#39;&gt;<br>                    &lt;img src={asset} alt=&#39;illustration asset&#39; /&gt;<br>                &lt;/span&gt;<br>            &lt;/StyledContent&gt;<br>            &lt;span&gt;&lt;/span&gt;<br>        &lt;/StyledAboutMe&gt;<br>    );<br>}</pre><p>You can see I’ve placed a constant height, that might need to be changed depending on the size of your paragraph, but I prefer to make that so the image doesn’t grow bigger than expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wM5vjhUafvwcOvuiwoh8xw.png" /></figure><p>Now let’s include some color. We can include another color from our palette, I’m taking my “alternate” one, which is #1F5673.</p><p>So, let’s modify the “asset-box” to include a background and a nice frame. I’ve included a bit of padding on the top and bottom, a border radius property to make it look circular and then a linear-gradient. I’ve also reduced the width and height on 10% to create some space.</p><pre>    .asset-box {<br>        width: 33%;<br>        align-items: center;<br><br>        img {<br>            width: 90%;<br>            height: 90%;<br><br>            padding: 10px 0;<br>            border-radius: 200em;<br>            background: linear-gradient(<br>                to bottom, <br>                var(--alternate), <br>                transparent<br>            );<br>        }<br>    }</pre><p>After including that the result should be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFjCg9X5NbZ5N5nJbps1iw.png" /><figcaption>End result</figcaption></figure><p>So, wrapping things up on this chapter 3. We have created an about me section for our portfolio with a free asset from <a href="https://undraw.co/">https://undraw.co/</a>. It displays some personal info about ourselves to let people visiting our portfolio who we are.</p><p>Below that section we’re displaying our work experience.</p><p>In the next chapter we will create a footer with our RRSS. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9d64264168" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to: React portfolio deployed into AWS — Part 2]]></title>
            <link>https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-2-169e31992826?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/169e31992826</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Fri, 18 Nov 2022 08:59:39 GMT</pubDate>
            <atom:updated>2022-11-18T09:02:45.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to: React portfolio deployed into AWS — Part 2</h3><p>In this second chapter of the serie I will be explaining how to create this block to display your work experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUsMEhsp5zmJsX3dRf_1VQ.png" /><figcaption>End result</figcaption></figure><p>In the <a href="https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-1-92ab8bc37b44">first chapter</a> we learned how to create the header. Now we’re placing a block to display our work experience. So, let’s get to work.</p><p>First of all, we will be placing a “span” so we can keep the content centered and correctly padded, so we go to the App.tsx file and include this:</p><pre>const StyledContent = styled.span`<br>    width: 80%;<br>    display: flex;<br>    flex-direction: column;<br>    align-self: center;<br>    max-width: 1560px;<br>    padding-bottom: 100px;<br>`</pre><p>This way we can be sure the content will be well placed in the screen, centered and separated from the borders. The max-width we’re placing is to prevent the content to be wider than desired when displayed ultra-wide screens. I’m not going deep into responsiveness as I’m leaving that for later episodes of the serie. The padding-bottom clause is to create some space between the last item in our content and the end of the page.</p><p>Our App function should look like this now:</p><pre>function App() {<br>    return (<br>        &lt;StyledApp&gt;<br>            &lt;Header /&gt;<br>            &lt;StyledContent&gt;<br>                ...HERE WE ARE PLACING OUR COMPONENTS...<br>            &lt;/StyledContent&gt;<br>        &lt;/StyledApp&gt;<br>    );<br>}</pre><p>Now we can create — and import — our new component. For that we will create Experience.tsx file under <strong><em>components/</em></strong>.</p><p>There we can place this</p><pre>const StyledExperience = styled.span`<br>    display: flex;<br>    flex-direction: column;<br><br>    .title {<br>        color: var(--dark);<br>        width: 100%;<br>        border-bottom: var(--dark) solid 1px;<br><br>        margin-bottom: 0px;<br>    }<br><br>    gap: 20px;<br>`;<br><br>...<br><br><br>export const Experience: React.FC&lt;any&gt; = () =&gt; {<br><br>    return (<br>        &lt;StyledExperience&gt;<br>            &lt;h2 className=&#39;title&#39;&gt;Experience&lt;/h2&gt;<br>        &lt;/StyledExperience&gt;<br>    );<br>}</pre><p>I’m creating a basic Card component that will fill all the width.</p><p>I tend to start creating the component with “static” info. We will create a card with a title, which will be like: <strong><em>Position</em></strong><em> [ </em><strong><em>Company</em></strong><em> ]</em>. Then we will place a description of the position and some small circles containing the icons of the languages / technologies we worked with.</p><pre>const StyledStack = styled.span`<br>    display: flex;<br>    flex-direction: row;<br>    gap: 15px;<br><br>    .circle {<br>        display: flex;<br>        width: 50px;<br>        height: 50px;<br>        border-radius: 200em;<br><br>        background-color: black; /* this will be removed in the next step */<br>    }<br>`<br><br>const StyledCard = styled.span`<br>    display: flex;<br>    flex-direction: column;<br>    padding: 25px;<br>    max-width: 100%;<br>    min-width: max-content;<br><br>    max-height: min-content;<br><br>    * {<br>        margin: 0;<br>    }<br><br>    background-color: var(--brighter);<br><br>    h3 {<br>        border-bottom: var(--dark) solid 1px;<br>    }<br><br>    h4 {<br>        margin-bottom: 10px;<br>    }<br><br>    .stack {<br>        width: calc(33% - 50px);<br>        min-width: max-content;<br>    }<br>`<br><br>const StyledCardBody = styled.span`<br>    display: flex;<br>    flex-direction: row;<br>    margin-top: 10px;<br><br>    gap: 50px;<br>`<br><br>export const Card: React.FC&lt;any&gt; = () =&gt; (            <br>    &lt;StyledCard&gt;<br>        &lt;h3&gt;Position [ Company ]&lt;/h3&gt;<br>        &lt;StyledCardBody&gt;<br>            &lt;span className=&quot;stack&quot;&gt;<br>                &lt;h4&gt;Stack&lt;/h4&gt;<br>                &lt;StyledStack&gt;<br>                    &lt;span className=&#39;circle&#39;&gt;<br>                    &lt;/span&gt;<br>                    &lt;span className=&#39;circle&#39;&gt;<br>                    &lt;/span&gt;<br>                    &lt;span className=&#39;circle&#39;&gt;<br>                    &lt;/span&gt;<br>                    &lt;span className=&#39;circle&#39;&gt;<br>                    &lt;/span&gt;<br>                &lt;/StyledStack&gt;<br>            &lt;/span&gt;<br>            &lt;span className=&quot;description&quot;&gt;<br>                &lt;h4&gt;Description&lt;/h4&gt;<br>                &lt;p&gt;In this position I was just stealing someother devs code.&lt;/p&gt;<br>            &lt;/span&gt;<br>        &lt;/StyledCardBody&gt;<br>    &lt;/StyledCard&gt;<br>);</pre><p>This should make your page look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJgr7iLrwaGlXHO1Aj72TA.png" /></figure><p>Once we’re here I tend to start working on passing some properties. For that we will create an interface, called CardProps which will contain all the info we want to display.</p><p>Let’s also remove the <strong><em>background-color: black; </em></strong>under <strong><em>.circle </em></strong>so we can see what’s going on there. We will end with something like this.</p><pre>interface CardProps {<br>    position: string;<br>    company: string;<br>    description: string;<br>    assets?: any[];<br>}<br><br>export const Card: React.FC&lt;CardProps&gt; = ({position, company, description}) =&gt; (<br>    &lt;StyledCard&gt;<br>        &lt;h3&gt;{`${position} [ ${company} ]`}&lt;/h3&gt;<br>        &lt;StyledCardBody&gt;<br>            &lt;span className=&quot;stack&quot;&gt;<br>                &lt;h4&gt;Stack&lt;/h4&gt;<br>                {assets ? &lt;StyledStack&gt;<br>                    { assets.map((asset, index) =&gt; (&lt;img src={asset} className=&#39;circle&#39; alt=&#39;asset&#39; key={index}/&gt;)) }<br>                &lt;/StyledStack&gt; : null}<br>            &lt;/span&gt;<br>            &lt;span className=&quot;description&quot;&gt;<br>                &lt;h4&gt;Description&lt;/h4&gt;<br>                &lt;p&gt;{description}&lt;/p&gt;<br>            &lt;/span&gt;<br>        &lt;/StyledCardBody&gt;<br>    &lt;/StyledCard&gt;<br>);</pre><pre>&lt;Card position=&#39;Full Stackoverflow&#39; <br>  company=&#39;Beginners&#39; <br>  description=&#39;In this position I was just stealing someother devs code.&#39; <br>  assets={[typescript, csharp, azure ]}<br>/&gt;</pre><p>I’ve included some new assets under the assets folder and imported them. I got them from: <a href="https://www.flaticon.com/">https://www.flaticon.com/</a></p><p>Once you include the assets your screen will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUsMEhsp5zmJsX3dRf_1VQ.png" /></figure><p>So, that’s it for this part 2. Next episode we will be creating an About Me section displayed before the Experience one.</p><p>Wrapping up, part 2 was about creating an Experience section with a Card. That card will allow you to pass some props to fill the content, so, for each new position you get you will be able to easily create the card and display your experience. In the next few chapters we will be updating this card to allow us to reuse it in different parts of the page.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=169e31992826" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to: React portfolio deployed into AWS — Part 1]]></title>
            <link>https://currosoriaf.medium.com/how-to-react-portfolio-deployed-into-aws-part-1-92ab8bc37b44?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/92ab8bc37b44</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Fri, 28 Oct 2022 16:25:40 GMT</pubDate>
            <atom:updated>2022-10-28T16:25:40.744Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to: React portfolio deployed into AWS — Part 1</h3><p>In this serie I will be explaining how to create and publish your own portfolio using React, AWS and Google Domains.</p><p>First of all, we will be starting with the React App. As this is intended to be a beginner friendly guide I will be explaining this at a low level, from how to create the SPA from scratch to the deployment on AWS.</p><p>In this first delivery of the serie I will be just going through the creation of the SPA and placing the header — so, let’s get to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UM-ogtFvLQTMlxUcqsC4vQ.png" /><figcaption>This is what we will build in part 1</figcaption></figure><h4>Creating the SPA</h4><p>For this you will need to install Node (you can get this <a href="https://nodejs.org/en/">here</a>, LTS will work). I’m also using VSCode — you can get it <a href="https://code.visualstudio.com/">here</a> — but feel free to pick your favourite code editor. Once you got Node installed and your code editor ready we can go for it.</p><p>Following the React docs you will find <a href="https://create-react-app.dev/docs/adding-typescript/">here</a> the next command.</p><pre>npx create-react-app <strong><em>portfolio </em></strong>--template typescript </pre><p>This should create a new React App with Typescript — I’ve replaced the “my-app” part of the original command for our use case. After this you will end up with a newly created folder with the React project in it, ready to be started. You can type:</p><pre>cd portfolio<br>npm start</pre><p>By this point we got our project ready and setted up. Before moving forward we will include some modifications on our package.json — this can also be done by pulling each dependency with “npm i <em>package-name</em>” but I prefer this way.</p><pre>&quot;dependencies&quot;: {<br>  &quot;@testing-library/jest-dom&quot;: &quot;5.14.1&quot;,<br>  &quot;@testing-library/react&quot;: &quot;13.0.0&quot;,<br>  &quot;@testing-library/user-event&quot;: &quot;13.2.1&quot;,<br>  &quot;@types/jest&quot;: &quot;27.0.1&quot;,<br>  &quot;@types/node&quot;: &quot;16.7.13&quot;,<br>  &quot;@types/react&quot;: &quot;18.0.0&quot;,<br>  &quot;@types/react-dom&quot;: &quot;18.0.0&quot;,<br>  &quot;@types/styled-components&quot;: &quot;5.1.25&quot;,<br>  &quot;babel-plugin-macros&quot;: &quot;^3.1.0&quot;,<br>  &quot;react&quot;: &quot;18.1.0&quot;,<br>  &quot;react-dom&quot;: &quot;18.1.0&quot;,<br>  &quot;react-scripts&quot;: &quot;5.0.1&quot;,<br>  &quot;styled-components&quot;: &quot;5.3.5&quot;,<br>  &quot;typescript&quot;: &quot;4.4.2&quot;,<br>  &quot;web-vitals&quot;: &quot;2.1.0&quot;<br> }</pre><p>Include the missing ones in your package.json dependencies and then just go:</p><pre>npm install // or just npm i</pre><p>We’re using <strong><em>styled-components </em></strong>for the component styles so we can specify the css in each component and even use params to define properties on the css.</p><p>As we’re only pulling styled-components we can alternatively go:</p><pre>npm i styled-components &amp;&amp; npm i @types/styled-components</pre><p>Now the project is ready to work, let’s go with the next step.</p><h4>Folder structure and clean up the project</h4><p>Before starting, this is the way I like to organise the folders, there’re are other ways to do the same I just find this convenient and makes it easier for me to find whatever I’m looking for in each moment. Feel free to create your own way of organising files and code — I just recommend you to find one and stick to it to keep everything in place.</p><p>I always start by creating some folders under <em>src</em>:</p><pre>src<br> |-- App.tsx<br> |-- App.css<br> |-- index.tsx<br> |-- components<br> |-- <strong><em>pages</em></strong>*<br> |-- assets<br>...</pre><p>I tend to remove index.css — this will require you to remove also the references to that file you will find in <strong><em>index.tsx </em></strong>— and to define the css variables in App.css — of course in :root. There are other recomendations around this from styled-components such as creating a <a href="https://styled-components.com/docs/api#createglobalstyle">GlobalStyle</a> but I find this easier for simple projects.</p><p>(*) For this project I won’t be using a “pages” folder as we only have one page. Instead I’ll be placing components on App.tsx.</p><h4>Setting the color palette</h4><p>We will set our color palette on CSS vars so we can keep a consistent style. You can pick the palette from wherever you want, I will go with <a href="https://coolors.co/">Coolors</a>.</p><p>Finally my App.css looks like this:</p><pre>:root {<br>    --dark: #351E29;<br>    --detail: #A13D63;<br>    --alternate: #1F5673;<br>    --bright: #F1E4E8;<br>    --transparent-bright: #F1E4E8BF;<br>    --brighter: #F2F5EA;<br>}</pre><pre>body {<br>    <em>margin</em>: 0; <br>    <em>font-family</em>: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, &#39;Roboto&#39;, &#39;Oxygen&#39;, &#39;Ubuntu&#39;, &#39;Cantarell&#39;, &#39;Fira Sans&#39;, &#39;Droid Sans&#39;, &#39;Helvetica Neue&#39;, sans-serif;<br>    <em>-webkit-font-smoothing</em>: antialiased;<br>    <em>-moz-osx-font-smoothing</em>: grayscale;<br>}</pre><pre>code {<br>    <em>font-family</em>: source-code-pro, Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace;<br>}</pre><p>I simply copied the content of the index.css to the App.css and then included the variables in :root so we can take them from anywhere in our app. Include some colors with lower opacity so you can play with transparencies.</p><p>So, once this is ready, let’s go creating some components.</p><h4>Creating the StyledApp styled-component</h4><p>Once we got our CSS variables ready let’s use them. We will remove all the code in App.tsx — except the function declaration and the default export.</p><p>Then we will create an StyledApp component like the code below.</p><pre>import styled from &#39;styled-components&#39;;<br>import &#39;./App.css&#39;;</pre><pre><em>const</em> StyledApp = styled.div`<br>    display: flex;<br>    flex-direction: column;</pre><pre>    min-height: 100vh;</pre><pre>    background-color: var(--bright);<br>`</pre><pre><em>function</em> App() {<br>    return (&lt;<em>StyledApp</em>&gt;&lt;/<em>StyledApp</em>&gt;);<br>}</pre><pre>export default App;</pre><p>This will force the StyledApp to stack the elements as a column and to be full screen size — min-height.</p><p>Let’s now place a Header.</p><h4>Creating a Header</h4><p>This will be a quick guide on how to create a simple header as in future posts I will be showing how to create different kinds of components and how to upgrade the current ones I got in <a href="https://juansoria.dev/">my portfolio</a>.</p><p>We will create a new file Header.tsx under components folder. I tend to import the component so I can see it in the screen while building it. So, let’s place some code like this:</p><pre>import React from &#39;react&#39;;</pre><pre>export <em>const</em> Header: React.FC&lt;<em>any</em>&gt; = () <em>=&gt;</em> {<br>    return &lt;&gt;&lt;/&gt;<br>}</pre><p>This will allow you to import the component in App.tsx like this:</p><pre>...<br>import { Header } from &#39;./components/Header&#39;;<br><em>...<br>function</em> App() {<br>    return (<br>        &lt;<em>StyledApp</em>&gt;<br>            &lt;<em>Header</em> /&gt;<br>        &lt;/<em>StyledApp</em>&gt;<br>    );<br>}</pre><pre>export default App;</pre><p>Now we can work in our component and see the changes. We can start putting some styles, so we will create an “StyledHeader” styled component.</p><pre><em>const</em> StyledHeader = styled.span`<br>    display: flex;<br>    flex-direction: column;<br>    align-items: center;<br>    justify-content: center;</pre><pre>    height: 350px;</pre><pre>    background-color: var(--dark);<br>`</pre><p>This will make the Header background to have the “dark” color we selected for our palette. Let’s add some fantasy.</p><p>I’m using this <a href="https://pattern.monster/japanese-pattern-2/">pattern</a>, but you can choose your own one, just make sure you click in the CSS button on the bottom of the page to copy the SVG as CSS and include it in yours. It should end like this:</p><pre><em>const</em> StyledHeader = styled.span`<br>    display: flex;<br>    flex-direction: column;<br>    align-items: center;<br>    justify-content: center;</pre><pre>    height: 350px;</pre><pre>    background-color: var(--dark);<br>    background-blend-mode: soft-light;<br>    background-image: <strong><em>*SVG_CODE_HERE*</em></strong>;<strong><em><br></em></strong>`</pre><p>Now let’s include a container to display your name and a image. For the image I’m using <a href="https://unsplash.com/">Unplash</a>, indeed, this <a href="https://unsplash.com/es/fotos/HD8KlyWRYYM">one</a>.</p><p>Make sure you work a bit with the image to have the appropriate size / proportions, I’ve made mine square. Then I’ve saved it under <strong><em>src/assets/propic.png</em></strong>. That way is ready to be imported from my file.</p><pre><em>const</em> StyledContainer = styled.span`<br>   width: 50%;<br>   height: 150px;<br>   max-height: 150px; <br>   display: flex;<br>   flex-direction: row;<br>   background-color: var(--transparent-bright);<br>   border-radius: 200px;<br>`</pre><p>This way we set the container where we will be placing the name and our profile pic. Then we go:</p><pre>import propic from &#39;../assets/propic.png&#39;</pre><pre>    ...</pre><pre>&lt;<em>StyledContainer</em>&gt;<br>    &lt;img alt=&#39;pro-pic&#39; src={propic} /&gt;<br>    &lt;span&gt;<br>        &lt;h1&gt;Juan Soria&lt;/h1&gt;<br>        &lt;p&gt;Full Stack Developer&lt;/p&gt;<br>    &lt;/span&gt;<br>&lt;/<em>StyledContainer</em>&gt;</pre><p>Including some styles for the img and title the StyledContainer should look like…</p><pre><em>const</em> StyledContainer = styled.span`<br>    <br>    ...</pre><pre>gap: 125px; // so we get some space between img and title<br>   <br>    img {<br>        border-radius: 200px;<br>        width: 150px;<br>        height: 150px;<br>        transform: scale(1.6);<br>        margin-top: -5px;<br>        margin-left: 40px;<br>        border: var(--transparent-bright) solid 5px;<br>    }</pre><pre>    span {<br>        display: flex;<br>        flex-direction: column;<br>        align-items: center;<br>        padding-top: 30px;<br>        <br>        * {<br>            color: var(--dark);<br>            margin: 0;<br>        }<br>    }<br>`</pre><p>You should end up with something like this — the image you’ve seen at the start of the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UM-ogtFvLQTMlxUcqsC4vQ.png" /><figcaption>You should end up with this</figcaption></figure><p>That’s it for this part 1. Next chapter will be creating some other components to display your work experience. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92ab8bc37b44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exception Handling]]></title>
            <link>https://currosoriaf.medium.com/exception-handling-85527ac2dfca?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/85527ac2dfca</guid>
            <category><![CDATA[exception-handling]]></category>
            <category><![CDATA[try-catch]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 09:05:14 GMT</pubDate>
            <atom:updated>2021-04-13T09:05:14.362Z</atom:updated>
            <content:encoded><![CDATA[<p>Exceptions are part of the day-to-day talk in software development teams. Getting more into details, <strong>an exception is a response from the system to prevent it to get into an unexpected state</strong>.</p><p>Bad exception handling in a project would lead development directly to a hole where logs are tremendously hard to read and performance poor.</p><p>How to deal with an exception is what we would talk about here. I love to explain this by talking about it as “its natural behavior”.</p><p>We should differentiate <strong>two kinds</strong> here. Exceptions that I as a developer throw and the ones that get raised by the execution of the program.</p><p>Let’s talk about the first one. <strong>Why should I throw an exception? </strong>Simple. <strong>Throwing an exception will stop your process</strong>. If you have a complex process that will need input with certain properties. Why not check it and, if it doesn’t pass this validation, throw an exception and <strong>prevent future problems</strong>?<br>By taking this decision — validate the input — we would save resources and time. In addition, we also can respond with a message showing where the problem is.</p><p>This, in addition, could lead clients to know what-to-do. For example, if I’m responding from an API “503 SERVICE UNAVAILABLE” the client could establish that will try later.</p><p>Talking about the second ones — the ones that occur due to problems while executing — here <strong>we should think about the nature of this failure and how to deal with it</strong>. I think the best way to deal with this problem is to let the exception propagate so we can check the log in the future and know what went wrong. We could also talk about one scenario where data isn’t consistent and is causing problems. You can deal with it by validating that data before the process starts as we pointed out in the last paragraph.</p><p>As you can see at this point, I’m not a big fan of try-catch blocks, in fact, I like that structure but I’m truly careful of where to use it.</p><p><strong>Try-catch blocks are a powerful tool but also dangerous</strong>. You should beware of where to use them. <strong>We should stand and think about if it’s worth using it before just rushing it thinking that try-catch makes your code error-proof</strong>.</p><p>Try-catch just help your system deal with situations where an exception is raised, but <strong>there’s no magic in this structure</strong>, <strong>your program has already failed</strong> and if it’s a needed element in the process, you can not manage to continue with it, so, <strong>what’s the point on making it still work when you know perfectly that the process failed?</strong></p><p>Is helpful to make certain parts of your code error-proof in order to <strong>make your system able to recover after a non-critical fail</strong>. But, <strong>there’s no point in forcing your code to deal with situations where you cannot assume an execution problem</strong>. It could — in fact — lead you to a bigger problem.</p><p><strong>Exceptions are part of the development ecosystem, you should not be afraid of them</strong>. Having a good relationship with exceptions and exception handling will give you development superpowers, reducing future problems and avoiding anti-patterns.</p><p>Part of a clean code is to correctly use exceptions that allow the program to act when an unwanted situation arrives with <strong>efficiency and giving the client information about what went wrong.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85527ac2dfca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BDD — How, Who & When]]></title>
            <link>https://currosoriaf.medium.com/bdd-how-who-when-16c00124967d?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/16c00124967d</guid>
            <category><![CDATA[specflow]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[bdd]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 06:53:26 GMT</pubDate>
            <atom:updated>2021-02-07T11:56:43.161Z</atom:updated>
            <content:encoded><![CDATA[<h3>BDD — How, Who &amp; When</h3><h3>Introduction</h3><p><strong>Firstly</strong>, <strong>let’s introduce BDD</strong> and give a definition for it so we all are starting at the same place.</p><p><strong>Behavior Driven Design </strong>were born from <strong>TDD</strong> and way over technical implementation, which we will discuss later, directly implies communication between the development team, QA, and non-technical participants.</p><p>Mainly it plays the role of a <strong>fluent implementation</strong> of user interface automation tests driven by a non-technical description of the <strong>user interaction </strong>with the software and the development team indications and collaboration.</p><p>In this context emerges the necessity of specifying a clear language so communication is possible with no misunderstood. This problem could be solved through specifications, which offer a place where this three-party can synchronize following a simple schema.</p><p><strong>Features</strong> should be sliced into <strong>scenarios</strong> matching the schema of <strong><em>“Given, When, Then”</em></strong>. Let’s give an example.</p><blockquote><strong>Given I am at “home page”<br>When I click at the “first card”<br>Then I go to it’s “card details”.</strong></blockquote><p>You also can configure scenarios like that:</p><blockquote><strong>Given I am at “home page”<br>When I click at “Account” button<br>And I click at “My Account” in the dropdown<br>Then I go to “my account” details.</strong></blockquote><p>With this you can configure complex <strong>scenarios</strong> to <strong>implement</strong> some complex <strong>user actions</strong>. Giving it a <strong>second look</strong> you can notice that <strong>language </strong>and<strong> schema</strong> are <strong>flexible </strong>enough so <strong>anyone</strong> <strong>can read</strong> a scenario and know what it’s talking about. It should offer a <strong>place of meeting</strong> for a <strong>fluent </strong>and clear <strong>conversation</strong> between our three agents.</p><p>Getting it to the <strong>technical field</strong>. Solutions like <strong>Cucumber</strong> for Java or <strong>Specflow </strong>for .NET are great ways to attack that space and get a place to <strong>fluently transform schemas into code</strong>.</p><p>Implemented through <strong>Selenium</strong>, these <strong>tests</strong> verse about a <strong>recreation </strong>of<strong> user interaction</strong> with the <strong>software</strong>. So, our intention is to keep it as <strong>real </strong>as we can, because you want to ensure users can do whatever they are supposed to can be doing.</p><h4><strong>Keywords</strong></h4><p>Given that presentation. Let’s go over some <strong>keywords</strong>. We had been talking about <strong>translating users’ interactions</strong> with the <strong>product </strong>into <strong>mandatory</strong> <strong>requirements </strong>for the <strong>development</strong>. A common fight with <strong>Test-Driven Development</strong>. The <strong>Specifications </strong>are the <strong>support </strong>where the <strong>development</strong> <strong>team, QA, </strong>and <strong>non-technical participants</strong> can <strong>be understood with clarity</strong>. Through the technical field, <strong>Specflow </strong>and <strong>Cucumber </strong>together with <strong>Selenium </strong>play the role of turning the Specifications into a <strong>recreation of user interaction</strong> with the <strong>product</strong>.</p><h3>What to beware of?</h3><p>At this point, you should be noticing that we implicitly had been walking through the “<strong>How</strong>” and the “<strong>Who</strong>”, but <strong>nothing </strong>has been said of the “<strong>When</strong>”.</p><p>Well. To talk about the “<strong>When</strong>”, we should go <strong>under the hood</strong>. Perhaps getting user interaction like a mandatory requirement in the development from the start is a valuable card, but, <strong>really possible?</strong></p><p>Development environments are <strong>development environments</strong>, which means they’re in <strong>constant change</strong>. No matter which technique or work schema you use, you should <strong>expect changes</strong>.</p><p><strong>Selenium</strong> is a quite <strong>sensible </strong>tool, anyone one who had used it can tell. <strong>Problems </strong>like <strong>charge times</strong>, development bugs, deployments, <strong>service instability</strong> will be <strong>weight over</strong> the tests development.</p><p>Trying to <strong>express complex functionality</strong> with a <strong>simple language</strong> sometimes ends up with <strong>lots of texts</strong> that hardly can be <strong>rewritten to match a pattern</strong>. Remembering <strong>it should be turned into code</strong>, you want the text to be as <strong>standardized</strong> as possible.</p><p>Focusing on the specifications. Too <strong>complex specifications</strong>, <strong>too many features</strong>, or focusing on things that will <strong>probably be in change</strong> will become <strong>stones over your roof</strong>. You should beware of them. If a specification is too complex, given it’s a sensible environment it will have a great rate of fail.</p><p>Also, needs to be over the table the next fact. BDD, like TDD, implies a <strong>slower development</strong>, given it puts quality over the rush. Not taking those facts into account could probably lead to a fragile structure in the implementation forcing developers to make not the best decisions but the fastest due to avoid high impact changes.</p><h3>How to manage this?</h3><p>Nevertheless, there are ways to minimize and manage the impact. Unsurprisingly, those ways start with planning. From my experience, I can tell there are two ways of implementing BDD avoiding, at least, most of the time.</p><p>First one. <strong>Taking BDD from the start of the project</strong>, defining responsibility clearly, and choosing carefully the technologies to use. If your development would be in some JavaScript framework or library, requesting from an API, you would probably choose to implement this in JavaScript also. This way you would have all the utilities needed to manage problems that for sure will appear.</p><p>Getting a plan where, from the start, you standardize and document all the decision making, <strong>creating a structure or pattern</strong> where next time the team is facing the same problem would no need to think the best way to proceed. Also, it leads to a fluent implementation and no need to rework or readjust the previous developments, at least, minimizes the need. Most important, it makes predictable the state tests will be when new specifications come up, what, in other scenarios would be a headache.</p><p>Second one. <strong>Getting the same team to write front-end and tests</strong>. One of the biggest problems doing tests like that is the mismatch between non-technical members’ expectations (represented by specifications) and technical implementation. Makes no sense to involve people that have no knowledge of behavior to make behavior-driven development. <strong>How would you know if you’re doing great if you don’t know what you are doing?</strong> Here is where the problems start. Making some developers only take care of tests, in a development environment will lead to lots of misunderstood: not knowing if the test or development is wrong, inability to negotiate with non-technical members about how to solve a problem or modify a test because of lack of knowledge of technical implementations are some of the problem derived from this strategy.</p><p>Furthermore, <strong>non-technical members probably know less than desired or even nothing of test principles</strong>, what or how to test correctly, leading to non-sense tests. It’s normal, technical members are there to bring that knowledge, and is expected from them to guide the three-party to useful and sense-making tests. Negotiating, with a plan and knowledge about implementation technical details should save a lot of time and problems.</p><h3>Conclusion</h3><p>To sum up, <strong>BDD is a powerful software development process</strong> when well implemented. On the other hand, not taking into account the <strong>complexity</strong> and <strong>costs in time and effort required</strong> could take team into a rush where — like any software project — the product will not achieve quality standards and will not be usable and scalable. This problems could be solved by <strong>planning</strong>, <strong>defining responsibility clearly</strong>, and <strong>creating a well-documented procedure</strong> to <strong>sustain collaboration</strong> between the development team, QA, and non-technical participants.</p><p>A simple way to solve it is to <strong>get all specifications before starting the development</strong> — as if it is part of the requirement engineering — so the teams can <strong>make analysis and get a plan</strong> of how to implement and generalize solutions, avoiding getting a partial view of the problem.</p><p>Just in case, I must say it loud and clear. <strong>BDD is not the place where non-technical participants throw change requests</strong>. If BDD starts to be a way to force the development team to commit changes not specified before, this will end up badly. My advice is if this starts to happen, make a <strong>red line</strong> here and say it clear. <strong>Forcing via test to make changes is not the way to proceed</strong>. As it has been said, the <strong>behavior should be clear before BDD</strong> can start if not, there’s no BDD, just UI tests that will not match the real software behavior and responsibility will land in nobody-land until defined.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16c00124967d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test-Driven Development & the 4-step-rule]]></title>
            <link>https://currosoriaf.medium.com/test-driven-development-the-4-step-rule-77a15312f9a1?source=rss-124165ece79e------2</link>
            <guid isPermaLink="false">https://medium.com/p/77a15312f9a1</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <dc:creator><![CDATA[Curro Soria Ferrer]]></dc:creator>
            <pubDate>Fri, 24 Jul 2020 06:42:00 GMT</pubDate>
            <atom:updated>2020-11-18T07:29:12.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*un6xrPulLvT-UOF-" /><figcaption>Photo by <a href="https://unsplash.com/@kellybritostudio?utm_source=medium&amp;utm_medium=referral">J. Kelly Brito</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>What’s TDD and why is so important to teach software developers to follow this approach?</p><p>The fact is that prioritizing tests over code implementation leads to testable code that directly translates into a more maintainable software product. This control over the code ends improving team efficiency to detect any bug or irregularity in features behavior and fix it. Also implies that you ensure to meet client expectations and criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*__U8_k0jOVlPlUkH" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank?utm_source=medium&amp;utm_medium=referral">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>How is that?</h4><p>Your team translate the acceptance criteria into tests and watch after the code is able to accomplish the requirements from the client. If then you develop trying to meet the expectations of those tests, you end it up making sure that your product will get client needs.</p><p>So, how to apply it? When I’m under TDD I use <strong>the 4-step-rule</strong>:<br>1. Write the tests (obvious)<br>2. Write the code<br>3. Complete the tests<br>4. Refactor that mess</p><p><strong>1. Write the test</strong><br>I strongly recommend following “Testing on the Toilet” practices and his principles.</p><p>Concretely “<a href="https://testing.googleblog.com/2018/06/testing-on-toilet-keep-tests-focused.html"><em>Keep Test Focused</em></a>” and “<a href="https://testing.googleblog.com/2019/12/testing-on-toilet-tests-too-dry-make.html"><em>DAMP</em></a>”.</p><p>You must write the test thinking that code is already done. Here is where you will really declare your variables. You will be watching your task description while you’re developing your code so you make sure it will be doing whatever it should do.</p><p><strong>2. Write the code</strong><br>Make the thing. You just need to fill the gaps, following the clues that the tests left.</p><p><strong>3. Complete the tests</strong><br>There will be things that you cannot test until you had developed the feature. Make sure all your tests still passing, even those that are not yours.</p><p><strong>4. Refactoring</strong><br>Now you got to solve that mess. Leave it clean and smooth again, or even better if you can. I recommend using <a href="https://www.sonarqube.org/">Sonarqube </a>to make sure your code is healthy. Remember, getting a top-quality and easy-to-maintain product is our principal goal.</p><p><strong>In addition</strong>, Test-Driven Development makes a perfect marriage with Agile.</p><p>Think about it. Combining TDD with the daily meeting where your team can adjust details to the client’s needs and translating that into more specific tests.</p><p>Seems like <strong>the magic formula</strong>.</p><p>Despite all, <strong>TDD is not paradise</strong>. The same old villain lurks over TDD. <strong>Bad practices</strong>. You will reduce it drastically by checking Sonarqube but you still will need to make sure to watch out to manage it.</p><p>TDD is more of a mindset. TDD puts maintenance and quality of code over speed and anxiety in the developing process. TDD implies efficiency and healthy code. Also drives the team to a constant relationship with code and his health while refactoring. That teaches them good practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77a15312f9a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>