<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Federico Roman</title>
    <description>The latest articles on DEV Community by Federico Roman (@dashpy).</description>
    <link>https://dev.to/dashpy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F821386%2F13db4c04-bb62-4a53-a064-6fdc1aa361e2.jpeg</url>
      <title>DEV Community: Federico Roman</title>
      <link>https://dev.to/dashpy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dashpy"/>
    <language>en</language>
    <item>
      <title>🚀 Send WhatsApp Messages via API with 2Chat</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Wed, 05 Feb 2025 14:09:11 +0000</pubDate>
      <link>https://dev.to/dashpy/send-messages-to-whatsapp-via-api-using-2chat-510p</link>
      <guid>https://dev.to/dashpy/send-messages-to-whatsapp-via-api-using-2chat-510p</guid>
      <description>&lt;p&gt;This quick tutorial will guide you through sending messages via WhatsApp using the 2Chat API.&lt;/p&gt;

&lt;p&gt;✅ Requirements&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A 2Chat account with a connected WhatsApp number.&lt;/li&gt;
&lt;li&gt;That’s it! You’re ready to go.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;📌 Steps&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a 2Chat account and connect your WhatsApp number in the Channel section.&lt;/li&gt;
&lt;li&gt;Grab your API Key from here.&lt;/li&gt;
&lt;li&gt;Now, let’s send a message using Python!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🐍 Sending a WhatsApp Message with Python&lt;/p&gt;

&lt;p&gt;Imagine you have a sender number (+5959123123) and want to message a recipient (+59594545). Here’s how you do it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import json

url = "https://api.p.2chat.io/open/whatsapp/send-message"

payload = json.dumps({
  "to_number": "+59594545",
  "from_number": "+5959123123",
  "text": "Hi!",
})

headers = {
  'X-User-API-Key': 'your_api_key_here',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)

print(response.json())  # Check the response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎯 That’s It!&lt;/p&gt;

&lt;p&gt;With just a few lines of code, you’ve successfully sent a WhatsApp message via API. For more details and additional API functionalities, check out the official &lt;a href="https://developers.2chat.co/docs/API/WhatsApp/send-message" rel="noopener noreferrer"&gt;2Chat API Docs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>marketing</category>
      <category>howto</category>
      <category>whatsapp</category>
    </item>
    <item>
      <title>Technical Learnings after 1 month</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Thu, 06 Apr 2023 14:31:52 +0000</pubDate>
      <link>https://dev.to/dashpy/technical-learnings-after-1-month-2mhm</link>
      <guid>https://dev.to/dashpy/technical-learnings-after-1-month-2mhm</guid>
      <description>&lt;p&gt;After I few weeks of taking a breath I start a job as Software Engineer at a startup working remotly. I come from a fullstack background, previous to this job I work with php and JS/React.&lt;/p&gt;

&lt;p&gt;This project has a repo with submodules, a frontend application created with RCA using MUI and a backend with Python using FastAPI and mysql.&lt;/p&gt;

&lt;p&gt;I start in the frontend and later move to the backend for an implementation of a new feature, some of the mistakes that I made at the begining were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I didn't dedicate enough time to understanding the conventions of the translation files. Most of the elements started with feature_name_*, but I omitted the feature_name_ portion. I had a pending ticket to fix this.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the backend, I used camelCase notation instead of snake_case, which most of the code was written in. This took time to change, since my responses to the frontend were in camelCase. Changing the response in the backend to snake_case required updates to the frontend as well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Additionally, I didn't have a thorough understanding of the product, which caused delays in designing new components and experimenting with libraries for graphics.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I learn from this is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Always verify if a component already exists in the product and use it whenever possible. If the code is too specific to a certain use case, take the time to refactor it into a reusable component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's important to take the time to understand the conventions used in the codebase. While it may require an investment of time upfront, following established conventions will save time in the long run and make the codebase more maintainable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What am I working now, as this is a startup we don't have too much time for improvements or try new things so in my free time I'm including tests with cypress, doing a refactor in the frontend base on this &lt;a href="https://react.dev/learn/you-might-not-need-an-effect?s=35" rel="noopener noreferrer"&gt;article&lt;/a&gt; and making a migration from CRA to Vite.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Configure multiple ssh credentials with git</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Fri, 03 Mar 2023 22:49:09 +0000</pubDate>
      <link>https://dev.to/dashpy/configure-multiple-ssh-credentials-with-git-2k38</link>
      <guid>https://dev.to/dashpy/configure-multiple-ssh-credentials-with-git-2k38</guid>
      <description>&lt;p&gt;If you wish to configure multiple SSH keys on your computer because you use it for both work and personal projects, you need to set up different users in your repository. &lt;/p&gt;

&lt;p&gt;Assuming that the first key is referred to as a “personal_key” and the second is referred to as a “work_key," both of which have their own public files extensions, you can edit the config file (~/.ssh/config) to include the following details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host work-github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/work_key
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/personal_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once saved, go to the working folder where you are running this project from (for example home/dashpy/work) and use command git remote -v. This should bring up something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote -v
origin  git@github.com:dashpy/insight.git (fetch)
origin  git@github.com:dashpy/insight.git (push)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We want to change that and tell git that when I'm working in this work project use my work ssh key, so to do that we type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url origin git@work-github.com:Company/product.git

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which will tell Git that it should use your work SSH key when this particular working project is used.&lt;/p&gt;

&lt;p&gt;The end.&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>cli</category>
      <category>discuss</category>
      <category>integrations</category>
    </item>
    <item>
      <title>[Recommend] Tips for technical interviews</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Sat, 17 Sep 2022 23:01:47 +0000</pubDate>
      <link>https://dev.to/dashpy/recommend-tips-for-technical-interviews-1p5</link>
      <guid>https://dev.to/dashpy/recommend-tips-for-technical-interviews-1p5</guid>
      <description>&lt;p&gt;Which tips would you recommend for someone who is going to have an interview as a developer? &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>Run a node app into AWS lambda</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Tue, 06 Sep 2022 00:41:56 +0000</pubDate>
      <link>https://dev.to/dashpy/run-a-node-app-into-aws-lambda-1g07</link>
      <guid>https://dev.to/dashpy/run-a-node-app-into-aws-lambda-1g07</guid>
      <description>&lt;p&gt;I create this post because I didn't find any information on this when I needed it, or the information was dispersed around the web, so I hope this post helps someone. This is going to be straight and I'm assuming that you already have a private repository in AWS.&lt;/p&gt;

&lt;p&gt;Steps&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create your code and ensure that a handler exists.&lt;/li&gt;
&lt;li&gt;Setup &amp;amp; upload your Dockerfile with the right parameters.&lt;/li&gt;
&lt;li&gt;Configuring AWS.&lt;/li&gt;
&lt;li&gt;Close the rest of your browser tabs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you are reading this before you write any code make sure to check the repository of AWS and confirm the node version (Some of the node versions are not verified, you can find the supported versions here).&lt;/p&gt;

&lt;p&gt;Once you have your Node JS code you need to make sure that inside your main file exists a handler function this is a requisite for lambda functions no matter the programming language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const https = require('https')
let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" 

export.handler = async (event) =&amp;gt; {

  const promise = new Promise((resolve, reject) =&amp;gt; {
    https.get(url, (res) =&amp;gt; {
        resolve(res.statusCode)
      }).on('error', (e) =&amp;gt; {
        reject(Error(e))
      })
    })

  return promise

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you have all your logic we are going to create a container with docker. Your Dockerfile should be similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM public.ecr.aws/bitnami/node:14.20.0

COPY ./source .

RUN npm install --omit=dev


CMD [ "app.handler" ] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, we're using node:14.20 as an image (notice the repository), we install all the packages ignoring devs dependencies (we don't need linters or other tools into the container) and in the CMD we call the function handler.&lt;/p&gt;

&lt;p&gt;For testing purpose you can also use node -e 'require("./index").handler()' in CMD.&lt;/p&gt;

&lt;p&gt;Then build the container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t &amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt; .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Push the files to your AWS private repository using the CLI of AWS (be aware that the following are just dummy data, you need to replace them with your values).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag  &amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt; 123456789012.dkr.ecr.us-east-1.amazonaws.com/&amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt;
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/&amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lambda is going to run this every time that is being invoked. Now you need to create a repository inside AWS.&lt;/p&gt;

&lt;p&gt;After you push your files go into lambda and select create a lambda container function, once there just pick the container from your repository, and set the correct permissions. Once finish the process try to invoke the test, you can place an API Gateway layer so your function can be called from an endpoint.&lt;/p&gt;

&lt;p&gt;Some other helpful resources:&lt;/p&gt;

&lt;p&gt;AWS Node Lambda container &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html"&gt;documentation&lt;/a&gt;.&lt;br&gt;
Sample of the code inside my personal &lt;a href="https://github.com/dashpy/node-container-lambda"&gt;repo&lt;/a&gt;&lt;br&gt;
This one is a &lt;a href="https://www.youtube.com/watch?v=23fE57EFRK4"&gt;video tutorial&lt;/a&gt; for python&lt;/p&gt;

</description>
      <category>aws</category>
      <category>node</category>
      <category>docker</category>
    </item>
    <item>
      <title>The one thing that you found hard to scale is?</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Tue, 22 Mar 2022 17:03:44 +0000</pubDate>
      <link>https://dev.to/dashpy/the-one-thing-that-you-found-hard-to-scale-is-3g0h</link>
      <guid>https://dev.to/dashpy/the-one-thing-that-you-found-hard-to-scale-is-3g0h</guid>
      <description></description>
      <category>startup</category>
      <category>productivity</category>
      <category>career</category>
      <category>react</category>
    </item>
    <item>
      <title>Would you rather be a 10x dev or one with imagination?</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Sun, 20 Mar 2022 19:26:16 +0000</pubDate>
      <link>https://dev.to/dashpy/would-you-rather-be-a-10x-dev-or-one-with-imagination-4pl</link>
      <guid>https://dev.to/dashpy/would-you-rather-be-a-10x-dev-or-one-with-imagination-4pl</guid>
      <description></description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>Managing unexpected scenarios</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Wed, 02 Mar 2022 23:42:46 +0000</pubDate>
      <link>https://dev.to/dashpy/managing-unexpected-scenarios-1ncb</link>
      <guid>https://dev.to/dashpy/managing-unexpected-scenarios-1ncb</guid>
      <description>&lt;p&gt;When we develop a product we are aware that often bugs can happen, or unpredictable events can affect the product when the customer is using it. I'm sure that no one wants to get a bad review or a call from an angry customer telling them that the platform that he/she is using is not working correctly. The worst scenario for every team is that one of the critical functionality isn't working. &lt;/p&gt;

&lt;p&gt;This is an approach for a small team of developers, very often to keep the product up and running we need to move super fast, sometimes this means leaving things for later and moving on with the critical things.&lt;/p&gt;

&lt;p&gt;Scenario: The server is getting loaded with multiple requests from the application so it's throwing errors.&lt;/p&gt;

&lt;p&gt;Possible solutions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Infra-side&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Scale horizontally&lt;/em&gt;&lt;br&gt;
If you have your servers on the cloud then add another server and configure your load balancer. The customer probably won't notice the delay, however, this means that we are going to pay something $$ for this unplanned scale.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Scale Vertical&lt;/em&gt;&lt;br&gt;
Again under the same premise of getting our servers in the cloud we can upgrade the characteristic of the machine (add more RAM, CPU, etc). Again the customer probably won't notice the delay, however, this means that we are going to pay something $$ for this unplanned scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server-side&lt;/strong&gt; &lt;br&gt;
Verify if your server has a configuration that is limiting the number of requests. In the case of using Nginx if the server is being overloaded with requests, it will start to throw the same response code. Make sure to use CDN for static content &amp;amp; cache strategies for files that are being served like jpg, js, mp3, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-level&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Add interceptors at frontend level&lt;/em&gt;&lt;br&gt;
This means that when the frontend receives a request indicating a memory issue the frontend is going to handle the request that is sent to the server. This means that we need to consider what are the critical functionalities that need to serve and what are the ones that can wait till the server gets fully recovered.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Verify your ORM connections&lt;/em&gt;&lt;br&gt;
Verify that you are not using (wrongly) transaction connection in your ORM at backend level, remember that you will block access to the DB if you are using a transaction code (e.g you have a GET endpoint some_domain/users/125, and for some reason, you are opening a transaction and store something in the DB, then close and return the response. This works great ... for at least 20 requests or at least, after the amount is being passed, let's say 30RPS the new requests are being queued, this means that a request that takes 2 seconds is taking 1 minute, and so on).&lt;/p&gt;

&lt;p&gt;The most important advice, use proper logs, test the scenario of your catch (in your try{ ...} catch(...) {...}), because of time we don't usually check this, and in the Merge request process is not simple to notice if the process to log is the proper one.&lt;/p&gt;

&lt;p&gt;This is everything, for now, let me know what you think and if you consider other tips that can be useful for the people who land in this post.&lt;/p&gt;

</description>
      <category>performance</category>
      <category>testing</category>
      <category>management</category>
      <category>career</category>
    </item>
    <item>
      <title>5 Career advice: Frontend</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Sat, 26 Feb 2022 20:59:28 +0000</pubDate>
      <link>https://dev.to/dashpy/4-career-advice-frontend-2olg</link>
      <guid>https://dev.to/dashpy/4-career-advice-frontend-2olg</guid>
      <description>&lt;p&gt;I'm almost 8 years old as a developer, start as QA, then went to frontend, backend, and then switch again to frontend, where I did my time focus in UX/UI. Currently, I found myself working as a frontend engineer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn to listen&lt;/strong&gt; &lt;br&gt;
During my career as a dev, the one thing it was hard to take at the beginning was the feedback. Over the time I work after-hours to try to improve my skills, some of the meetings end up in '... I like this, this and this, but could we improve on this or that ...', so don't take personally the things and work over that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do one time at the time&lt;/strong&gt; &lt;br&gt;
In my case multi-tasking never work, I became obsessed with the use of the board of Jira, I need to get everything in order there, what task was in progress, what needs to be done next, and what was the priority of the tasks so at the end of the day I wasn't too disperse in my head worrying about other tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn the basics&lt;/strong&gt; &lt;br&gt;
At the time I was trying to keep up with the trends, over time this become difficult, probably every day a new JS library pops out. At the same time that a new library comes I notice that it was really familiar to other libraries and if I get the principal concepts of the library/fw I will be able to make the code work. Go to the basics, learn JS, understand the differences between them, the holy bible is &lt;a href="https://github.com/getify/You-Dont-Know-JS"&gt;You don't know JS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't overestimate soft skills&lt;/strong&gt; &lt;br&gt;
Most of the devs/Engineers are really good in what they do, but they lack soft skills, be always conscious about that, remember that your career also includes building a reputation, if you had the reputation to be a hard people to work is going to be hard for you move in your company. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look for something else&lt;/strong&gt; &lt;br&gt;
Once you learn the basics I'll hardly recommend learning about performance and lastly about design, as devs we are always in the mindset of a developer, like, There should be a link here, and when the user clicks the routing should render the page; but we almost never put in the user seat, try to use your system/app with the mind in blank, like you don't know what happens if you click there, remember this "If the user doesn't understand your system is going to be afraid to use it".&lt;/p&gt;

&lt;p&gt;This is everything, for now, let me know what you think and if there is other advice that you should consider for the new ones.&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>What are you learning and why?</title>
      <dc:creator>Federico Roman</dc:creator>
      <pubDate>Thu, 24 Feb 2022 20:49:23 +0000</pubDate>
      <link>https://dev.to/dashpy/what-are-you-learning-and-why-294g</link>
      <guid>https://dev.to/dashpy/what-are-you-learning-and-why-294g</guid>
      <description>&lt;p&gt;What are you learning these days and why are looking into?&lt;/p&gt;

</description>
      <category>learning</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
