<?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 Dayán Ruiz Riera on Medium]]></title>
        <description><![CDATA[Stories by Dayán Ruiz Riera on Medium]]></description>
        <link>https://medium.com/@dayanrr91?source=rss-e8dc0a43755c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*bH0xigKl46vCQddrVBjr2g.jpeg</url>
            <title>Stories by Dayán Ruiz Riera on Medium</title>
            <link>https://medium.com/@dayanrr91?source=rss-e8dc0a43755c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:44:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dayanrr91/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[Basic CRUD operations in Amazon S3 Buckets with .NET 6]]></title>
            <link>https://awstip.com/basic-crud-operations-in-amazon-s3-buckets-with-net-6-e7549af3a641?source=rss-e8dc0a43755c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7549af3a641</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[net6]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[net-core]]></category>
            <dc:creator><![CDATA[Dayán Ruiz Riera]]></dc:creator>
            <pubDate>Wed, 05 Jan 2022 00:16:23 GMT</pubDate>
            <atom:updated>2022-02-10T06:22:21.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>Basic CRUD operations in Amazon S3 Buckets with .NET 6</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Ql-JolrEyijmxo1eiY6gg.png" /></figure><p>AWS SDK for .NET simpliﬁes use of AWS Services by providing a set of libraries that are consistent and familiar for .NET developers. All AWS SDKs provide support for API lifecycle consideration such credential management, retries, data marshaling, and serialization. AWS SDK for .NET also supports for higher level abstractions such as the S3 Transfer Utility, Cognito Identity Provider, and AWS DyanamoDB Session State provider. Visit <a href="https://aws.amazon.com/sdk-for-net/">aws/dotnet Github</a> for more information on how AWS SDK works.</p><p>The idea of this article is to setup an API to do basic CRUD operations on s3 buckets.</p><p><em>You can find </em><a href="https://github.com/dayanrr91/aws-net-core-examples"><em>here the github repo of this project</em></a><em>!</em></p><p>For this tutorial we are going to use Visual Studio 2022 and .NET 6, also we need to install <em>aws-cli</em>.</p><p>1- Create an empty solution in this project we will call it <em>aws-net-core-examples</em>, later add an API project using c# and .NET 6.</p><p>2- Add the AwsS3BucketController:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*I0TP320fQs8ZdAXly5tgjw.png" /><figcaption>AwsS3BucketController.cs</figcaption></figure><p>3- Add a service to handle all the logic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMOBw1nc0MVe6m0CVLt_Ig.png" /><figcaption>AwsS3Service.cs</figcaption></figure><p>4- Interface for Dependency Injection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*aVxxgZfBBK8NhwdbLNmGxw.png" /><figcaption>IAwsS3Service</figcaption></figure><p>5- Model for the Aws Response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*ZBwnvWL7XwolAVcHxCNM2A.png" /></figure><p>6- Setting up the Program.cs to inject AwsOptions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*thJXeNytIravVYotD9k6lg.png" /></figure><p>7- Install Nuget Packages:</p><pre>Install-package AWSSDK.Extensions.NETCORE.Setup<br>Install-package AWSSDK.S3</pre><p>8- <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">Download and install the “aws-cli” tool</a>.</p><p>9- Check everything was installed correctly with “aws — version” command.</p><p>10- Open a cmd console and type: “aws configure”. Then put your credentials and region. After that in “C:\Users\YourUserName.aws” folder two files will be created, config with the region and credentials with your aws keys.</p><p><em>If you do not know where to get your secret credentials, please </em><a href="https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/"><em>read this article</em></a><em>.</em></p><p>11- Launch the Api project and read/play the swagger documentation.</p><p><em>You can find </em><a href="https://github.com/dayanrr91/aws-net-core-examples"><em>here the github repo of this project</em></a><em>!</em></p><p>Please contact me if you have any question related to the article.</p><p>Happy hardcoding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7549af3a641" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/basic-crud-operations-in-amazon-s3-buckets-with-net-6-e7549af3a641">Basic CRUD operations in Amazon S3 Buckets with .NET 6</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uploading image to amazon s3 with .NET Core]]></title>
            <link>https://medium.com/@dayanrr91/uploading-image-to-amazon-s3-with-net-core-ab60ce383ec8?source=rss-e8dc0a43755c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab60ce383ec8</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[bucket]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[upload]]></category>
            <category><![CDATA[net-core]]></category>
            <dc:creator><![CDATA[Dayán Ruiz Riera]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 21:04:12 GMT</pubDate>
            <atom:updated>2020-09-19T00:13:50.287Z</atom:updated>
            <content:encoded><![CDATA[<h3>Uploading images to amazon s3 with .NET Core</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*q4-r4ty3ejeDEsP6bzBFkw.png" /></figure><p><strong>Images are used for all kinds of reasons on the internet</strong>, to illustrate stories, to enhance websites, in ad displays, to present products or services, as stand-alone “a picture is worth a thousand words” meaning-rich tools, and sure, on social media.</p><p>If you have a personal blog, or you are trying to build something similar <strong>you are going to need a place to storage and access those images cheaply with high availability</strong>. A very good alternative for this is to use <strong>s3 buckets</strong> in Amazon.</p><p>According to their own <a href="https://aws.amazon.com/s3/"><strong>definition</strong></a>:</p><blockquote>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9’s) of durability, and stores data for millions of applications for companies all around the world.</blockquote><p><strong>We can either do the upload process manually</strong> or <strong>implement something to automate that process</strong>, in this example we will focus on the second one, and for that <strong>we will be using </strong><a href="https://dotnet.microsoft.com/download/dotnet-core"><strong>.NET Core</strong></a>.</p><p>First <strong>create a .Net Core Api project</strong> and <strong>install the nuget package AWSSDK.S3</strong>, after that follow the next steps:</p><p><strong>Create a controller method</strong> to test it from postman:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*LPc0Om_LeR6uusn_688t_g.png" /><figcaption>AmazonController.cs</figcaption></figure><p><strong>Create the interface</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*20IO5bqBlcpLPIMISJqa_g.png" /><figcaption>IAmazonService.cs</figcaption></figure><p><strong>Create the service</strong> with a public method to access the upload image functionallity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMZimLbY1307ibZ_lYDu2A.png" /><figcaption>AmazonService.cs — public method</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9y0ZYc9ZikWdaTZZRdeU9Q.png" /><figcaption>AmazonService.cs — private methods</figcaption></figure><p>We need to avoid duplicates, so create a file name dynamically and then generate the object request.</p><p>Now let’s setup our project configurations, <strong>create two models</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*reK4X7LAKMPMYWZbmmfVCA.png" /><figcaption>AmazonSettings.cs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*hf_xSbSbOP3G2BdWGrnYTw.png" /><figcaption>ImageItem.cs</figcaption></figure><p>This last item is the one that we are going to use to send from postman, and the first one if for the amazon settings. <strong>Your appsettings.json should have an AmazonSettings section</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*AluJHEJRTsn0OxDKXmrRqw.png" /><figcaption>appsettings.json</figcaption></figure><p>Go to<strong> Startup.cs</strong>, in <strong>ConfigureServices.cs</strong> and write this code, now we can use our settings from the service created before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUZ7Xr02SZpZ9BK54FaDUg.png" /><figcaption>Startup.cs</figcaption></figure><p><strong>Go to your amazon account</strong> and search for the s3 option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZYYh_IKXKVc8fmpLfI1zQ.png" /><figcaption>Amazon Console =&gt; S3 option</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSn7Da2I51AwsSOsxQBe_A.png" /><figcaption>Create the bucket</figcaption></figure><p><strong>Create a bucket</strong> with the name that you want, but <strong>the name must match with the located in appsettings.json</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9zLkg6CXNUeTkYY8c8M8w.png" /><figcaption>Type the name and choose the region you want.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EleRNB01eNFKTEdyEtxEIw.png" /><figcaption>S3 Bucket Permissions</figcaption></figure><p>Go to <strong>permissions settings</strong>, and <strong>uncheck the Block all public access option</strong>, if not, you will have and exception with the text: <strong><em>Access Denied.</em></strong></p><p>Let’s test that method, <strong>open postman and create a sample request</strong>, send something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*9iOFLj64UMy5b0CNvHPc4A.png" /><figcaption>HttpPost request with body data.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TzjiSG_OVIP7ku_7JFRdRQ.png" /><figcaption>File uploaded to s3</figcaption></figure><p><strong>Our file is successfully uploaded</strong>, you can check this code <a href="https://github.com/dayanrr91/upload-image-to-s3/"><strong>here</strong></a>.</p><p><strong>Feel free to contact me</strong> if you have any question related to this or any other topic. <strong>I really hope this helped to you</strong>.</p><p><strong>Happy Coding</strong> and <strong>always try to do something new</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab60ce383ec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting an angular/cli app in Github Pages for free]]></title>
            <link>https://medium.com/@dayanrr91/hosting-an-angular-cli-app-in-github-pages-for-free-ada12b1348cb?source=rss-e8dc0a43755c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ada12b1348cb</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[angular-cli]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[hosting]]></category>
            <dc:creator><![CDATA[Dayán Ruiz Riera]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 14:49:40 GMT</pubDate>
            <atom:updated>2020-08-31T17:07:58.045Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JMKP9eHQOLrW5SieIFgOKA.png" /></figure><p><a href="https://github.com/angular/angular"><strong>Angular</strong></a> is an application design framework and development platform for creating efficient and sophisticated single-page apps.</p><p><a href="https://github.com/angular/angular-cli"><strong>Angular CLI</strong></a> is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.</p><p>When the development process of the app is completed, we have several options for hosting them, In this article we will be talking specifically about <a href="https://pages.github.com/"><strong>Github Pages</strong></a><strong>.</strong></p><p>Github allow us to create private <em>(with some limitations)</em> and public repositories, if we select the second one we will have the opportunity to host it for free. In this example we will create an angular/cli app and then we will host it.</p><p>First of all we need to setup angular cli, run a command console as administrator and run the following command:</p><pre>npm install -g @angular/cli</pre><p>Later we need to install <a href="https://www.npmjs.com/package/angular-cli-ghpages?activeTab=readme">angular-cli-gh-pages</a>, this will make really easy to deploy our app to github pages, again, we need to be logged as admin user.</p><pre>npm install -g angular-cli-ghpages</pre><p>Now that we have installed those two packages globally <em>(-g option), </em>we are able to create our app, let’s run this command:</p><pre>ng new angular-cli-gh-pages</pre><p>First command <em>(ng new)</em> is for creating the app, the second one is the name of the app, it is up to you, but for this time let’s name it: <em>angular-cli-gh-pages. </em>Then you will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*BuZFzZU40AE6iTs4IWQYeQ.png" /><figcaption>Creating angular/cli in windows console</figcaption></figure><p>When the process is completed, it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*HDtCfNxXfNX-JFFjL0eKEw.png" /><figcaption>After creating an angular cli app you are ready to rock!</figcaption></figure><p>We are ready to test our application, go to the folder that was recently created and launch the server:</p><pre>cd angular-cli-gh-pages<br>ng serve</pre><figure><img alt="Our app working!" src="https://cdn-images-1.medium.com/max/1024/1*HEifENuv_552kzNM-qZLMQ.png" /><figcaption>Our app is up and running!</figcaption></figure><p>We can push our code now to github, for that, stop the server <em>(ctrl + C) </em>and follow github repo instructions step by step <em>(you should change your github user and repo, in my case is dayanrr91 and angular-cli-gh-pages)</em>:</p><pre>git add README.md   <br>git commit -m &quot;first commit&quot;  <br>git branch -M master             <br>git remote add origin https://github.com/dayanrr91/angular-cli-gh-pages.git<br>git push -u origin master</pre><p>Please note that we did not initialize the git repository locally, that is because <em>angular/cli</em> does it for us.</p><p>Let’s build our code to be ready to deploy in production:</p><pre>ng build --prod --base-href “angular-cli-gh-pages”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3klHRpReSDKwpyYsDyOm3w.png" /><figcaption>Our app is just built and ready to be deployed</figcaption></figure><pre>ngh --dir=dist/angular-cli-gh-pages --no-silent</pre><p>The deployment process is now completed, but we will have some issues with routing related to angular. If you go to the url with an “/” at the end or you try to refresh the website it will crash. I am going to suggest a workaround for this:<br>In your <em>app.module.ts,</em> you should add:</p><pre>import { AppRoutingModule } from &#39;./app-routing.module&#39;;</pre><p>after that we should include it in the providers:</p><pre>providers: [<br>   {provide: LocationStrategy, useClass:HashLocationStrategy}<br>],</pre><p>This add a “#” character to your url, but it avoids that the website throw some 404 errors.</p><p>You can visit the deployed app <a href="https://dayanrr91.github.io/angular-cli-gh-pages/angular-cli-gh-pages">here</a> and the github repository with the code <a href="https://github.com/dayanrr91/angular-cli-gh-pages">here</a>, but we didn’t modify anything in the code.</p><p>Feel free to contact me if you have any question related to this or any other topic. I really hope this helped to you.</p><p>Happy Coding and always try to do something new.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ada12b1348cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a create react app in Github Pages for free]]></title>
            <link>https://medium.com/@dayanrr91/host-a-create-react-app-in-github-pages-3ed4c866c786?source=rss-e8dc0a43755c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ed4c866c786</guid>
            <category><![CDATA[create-react-app]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Dayán Ruiz Riera]]></dc:creator>
            <pubDate>Tue, 21 Jan 2020 01:22:16 GMT</pubDate>
            <atom:updated>2020-09-19T01:47:16.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hosting a Create React App in Github Pages for free.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*dDn41Yb0EuUnV23KgqCQiw.png" /></figure><p><a href="https://github.com/facebook/react"><strong>React</strong></a> is a JavaScript library for building user interfaces, it is created and maintained by Facebook, right now it is one of the most popular frameworks, its community is very wide and it is growing every day.</p><p><a href="https://github.com/facebook/create-react-app"><strong>Create React App</strong></a> is a tool built by developers at Facebook to help us build React applications. It saves us a lot of time from setup and configuration. You can simply run one command and it will create an entire react app for us.</p><p>When the development process of the app is completed, we have several options for hosting, for this article we will be talking specifically about <a href="https://pages.github.com/"><strong>Github Pages</strong></a><strong>.</strong></p><p>Github allow us to create private (with limitations) and public repositories, if we select the second one we will have the opportunity to host it for free. In this example we will create a create react app and then we will host it. You can find this code <a href="https://github.com/dayanrr91/create-react-app-gh-pages">here</a>:</p><p>The first step is to locate the folder where we want to create the react app using the console and execute the following command:</p><pre>create-react-app create-react-app-gh-pages</pre><p>The first input is for creating the app, the second input is the name of the app, it is up to you, but for this time let’s name it: <em>create-react-app-gh-pages. </em>Then you will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*OqOq8YyujPFRHaRBGLx3jw.png" /><figcaption>Creating react app in windows console</figcaption></figure><p>When it finishes you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*m2GAWeBpCLeopX5tRNO8Tg.png" /><figcaption>After creating a create react app you are ready to rock!</figcaption></figure><p>We are ready to test our application, go to the folder that was recently created and we launch the server:</p><pre>cd create-react-app-gh-pages<br>npm start</pre><p>Next step is to open your <em>package.json</em> file in the project folder, and we should add this line at the beginning:</p><pre>“homepage”: “http://[your-github-id].github.io/[your-github-repo]&quot;</pre><p>In my case it would be:</p><pre>“homepage”: “http://dayanrr91.github.io/create-react-app-gh-pages&quot;</pre><p>And in the scripts sections, please add:</p><pre>&quot;predeploy&quot;: &quot;npm run build&quot;,<br>&quot;deploy&quot;: &quot;gh-pages -d build&quot;</pre><p>Your <em>package.json</em> should look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*NXfC3kCEV7jJXgzZjwhVYQ.png" /></figure><p>Now that everything works fine, we are ready to create our github repo. Go to your github page and create an empty repository with the name <em>create-react-app-gh-pages. </em>We should get back to the folder of the app that we created before, then we execute:</p><pre>git add .<br>git commit -m &quot;first commit&quot;</pre><pre>#You need to replace the next line with your repository id</pre><pre>git remote add origin https://github.com/dayanrr91/create-react-app-gh-pages.git<br>git push -u origin master</pre><p>Please note that we did not initialize the git repository locally, that is because <em>create-react-app</em> does it for us.</p><p>The final part will be to deploy into github pages, this command will allow us:</p><pre>npm run deploy</pre><p>This command will create a branch named gh-pages, this branch host your app using the homepage property you created in package.json file. You can open the branch settings, then scroll down to GitHub Pages section and you will see this message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*7hqroPgqtRiyVC4oro8F0Q.png" /></figure><p>You can visit the deployed app <a href="https://dayanrr91.github.io/create-react-app-gh-pages/">here</a> and the github repository with the code <a href="https://github.com/dayanrr91/create-react-app-gh-pages">here</a>.</p><p>I will be creating another article soon with an example of the same, but using react router and how it works with create-react-app and github pages.</p><p>Feel free to contact me if you have any question related to this or any other topic. I really hope this helped to you.</p><p>Happy Coding and always try to do something new.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ed4c866c786" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>