<?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 Natalie P on Medium]]></title>
        <description><![CDATA[Stories by Natalie P on Medium]]></description>
        <link>https://medium.com/@codingspaghetti?source=rss-47779e69fa96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RX4kSs8B_HeHI_DS_DWDTw.jpeg</url>
            <title>Stories by Natalie P on Medium</title>
            <link>https://medium.com/@codingspaghetti?source=rss-47779e69fa96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 02:38:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codingspaghetti/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[Why Do You Keep Going Back To Your Ex?]]></title>
            <link>https://medium.com/not-too-crazy/why-do-you-keep-going-back-to-your-ex-c6bc60eadf46?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6bc60eadf46</guid>
            <category><![CDATA[cognitive-dissonance]]></category>
            <category><![CDATA[relationships]]></category>
            <category><![CDATA[breakups]]></category>
            <category><![CDATA[dating]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 06:34:44 GMT</pubDate>
            <atom:updated>2024-08-15T06:34:44.699Z</atom:updated>
            <content:encoded><![CDATA[<h4>How cognitive dissonance keeps forcing our behaviors and thoughts to align</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbUFhF2mZzPPX1_8L35gEQ.png" /></figure><blockquote>Originally published <a href="https://soulkisf.substack.com/p/why-do-you-keep-going-back-to-your">https://soulkisf.substack.com/p/why-do-you-keep-going-back-to-your</a></blockquote><p>I know that I myself have struggled with letting go of relationships and partners that weren’t ideal for me. As someone who has been engaged twice and never married, I can say I luckily escaped relationships that weren’t a good fit, but obviously stuck around a little longer necessary.</p><p>In 1957, Leon Festinger introduced the concept of cognitive dissonance in his groundbreaking book, explaining how the discomfort of holding two conflicting thoughts drives us to seek resolution. When our beliefs or attitudes clash, it creates stress and even physical discomfort. Initially, we might cope by ignoring the conflict or through <strong>selective exposure</strong>, focusing only on information that doesn’t intensify the dissonance.</p><p>As the dissonance grows, however, we become increasingly motivated to resolve it, often in one of four ways — each progressively more challenging:</p><ol><li><strong>Trivializing the Dissonance (Minimizing the Conflict)</strong></li><li><strong>Adding Justifications (Introducing New Thoughts)</strong></li><li><strong>Changing Thoughts</strong></li><li><strong>Changing Behavior</strong></li></ol><h3>Cognitive Dissonance in Relationships</h3><p>In the context of relationships, cognitive dissonance can occur when someone we once admired no longer behaves in ways that align with our values or expectations.</p><p>If you don’t recognize this behavior in yourself, you’ve likely had a friend who started day dreaming about their new date as the partner of their dreams, but only to be disappointed, yet can’t seem to let them go.</p><p>Here’s how one might deal with this dissonance:</p><h4>1. Selective Exposure</h4><ul><li><strong>Avoidance</strong>: We might avoid conversations or situations that highlight the gap between our admiration for the person and their conflicting behaviors, preferring not to confront the issue. If you’re the friend giving hard core truths, you may notice your friend no longer talking to you about their date/partner.</li><li><strong>Passive-Aggressive Behavior</strong>: Rather than addressing the dissonance directly, we may express dissatisfaction indirectly, avoiding open communication while harboring unresolved feelings. Example you might say, “You always call me last minute don’t you? Haha” and play it off as you’re only teasing them.</li></ul><h4>2. Trivializing the Dissonance</h4><ul><li><strong>Withdrawal or Emotional Numbing</strong>: To minimize the impact of the person’s behavior, we might emotionally distance ourselves from the relationship, downplaying its significance.</li><li><strong>Denial</strong>: We might refuse to acknowledge the problematic behavior or its consequences, choosing to ignore rather than confront it.</li></ul><h4>3. Adding Justifications (Introducing New Thoughts)</h4><ul><li><strong>Rumination</strong>: We might obsessively think about the situation, searching for excuses or justifications for the person’s behavior to ease the discomfort of dissonance.</li><li><strong>Seeking Reassurance</strong>: We could seek validation from others, looking for external justification or support to explain or excuse the behavior, thereby reducing our internal conflict. “It’s not that bad right?”</li></ul><h4>4. Changing a Thought</h4><ul><li><strong>Letting Go of the Idealized View</strong>: We might adjust our beliefs about the person, accepting that they may not be as perfect or admirable as we once thought, thereby aligning our perception with reality. For some changing our initial view we had may be extremely hard especially if we were attached to that version of reality. We’ll do all the other steps before we ever get to this point. For others, we might be on the other extreme and are too quick to judge. We’ll let go of someone as soon as we see a sign they might not be the one, making certain behaviors equating to red flags when they’re not such.</li></ul><h4>5. Changing a Behavior</h4><ul><li><strong>Overcompensation</strong>: In an effort to convince ourselves that the relationship is still valuable, we might put in extra effort, even when it’s not reciprocated, to mask the dissonance. For the anxiously attached, we may be chasing after the relationship and doing nice things to try and get them to also change their behavior.</li><li><strong>Self-Sabotage</strong>: We might unconsciously create conflict or distance within the relationship, justifying our negative feelings by triggering or exacerbating issues. We may pick fights and for an avoidantly attached, we might just pull away.</li><li><strong>Reducing Contact</strong>: Gradually decreasing interaction with the person, which requires changing both our beliefs and behaviors, can be a challenging but effective way to resolve the dissonance.</li></ul><p>With all these strategies for managing cognitive dissonance, it’s no wonder relationships can be so challenging. Understanding why you do things is the first step needed to make conscious relationship choices.</p><p>What behaviors do you recognize doing in your dating or romantic relationships? What does this bring up for you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6bc60eadf46" width="1" height="1" alt=""><hr><p><a href="https://medium.com/not-too-crazy/why-do-you-keep-going-back-to-your-ex-c6bc60eadf46">Why Do You Keep Going Back To Your Ex?</a> was originally published in <a href="https://medium.com/not-too-crazy">Not Too Crazy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Abundance Mindset: How to Develop One and When Does it Work?]]></title>
            <link>https://medium.com/not-too-crazy/abundance-mindset-how-to-develop-one-and-when-does-it-work-534f5cb0fc63?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/534f5cb0fc63</guid>
            <category><![CDATA[karma]]></category>
            <category><![CDATA[success]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[abundance]]></category>
            <category><![CDATA[empowerment]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Mon, 27 May 2024 08:17:05 GMT</pubDate>
            <atom:updated>2024-05-28T22:56:36.527Z</atom:updated>
            <content:encoded><![CDATA[<p>Many of you may be familiar with the 1968 Stanford Marshmallow Experiment. In this study, children were given a choice: they could eat one marshmallow immediately or wait 15 minutes to receive two marshmallows. Follow-up studies suggested that the children who were able to delay gratification and wait for the second marshmallow generally performed better in various life outcomes, such as academic success and emotional resilience.</p><p>In 2012, researchers conducted the same experiment but also played with trust by having the researcher promise to return to the room if the child pressed a bell. For one group, the researcher kept this promise, while for the other group, the researcher broke the promise by not returning as stated. The group where trust was not broken was able to wait (12 minutes) 4 times longer for the second marshmallow compared to the broken-promise group.</p><p>In the book <a href="https://amzn.to/4by3aUl">Dopamine Nation</a>, the author, Anna Lembke states being around reliable and honest people, enables us to feel confident about our world. It gives a sense of safety and predictability giving us the ability to have an abundance or plenty mindset. Versus being around people who lie to us makes the world dangerous and creates the need to be in survival mode. In this case we will favor short-term vs long-term gains.</p><p>She quotes an experiment done by Warren Bickel where one group participants read a passage about being promoted and having abundance of options, where as in the other the passage one is fired and financially strained. Participants who had the abundant passage were more likely to delay gratification for a monetary reward vs the later wanted the reward immediately.</p><p>Therefore if you want to have an abundant mindset, you need to create a sense of safety first. You can do this by surrounding yourself with stable and reliable, trustworthy people. Additionally, building confidence and trust in your own ability to manage uncertainty is crucial. The more you trust — in both yourself and the people around you — the more freely you can think with an abundance mentality. I know it’s easier said than done.</p><p>Another question I’ve considered is when an abundant mindset actually benefits us. While some might view abundance through a karmic lens, I prefer to ground my understanding in tangible evidence. My hypothesis is that for those of us not burdened by basic survival needs like shelter, food, and safety, adopting an abundant mindset offers numerous advantages. It’s a privilege afforded to our generation. By generously giving to others, we foster a sense of community. This generosity is often reciprocated, enhancing our lives through shared knowledge and resources. Thus, the abundant mindset not only enriches our own lives but also strengthens the bonds within our communities.</p><p>In the book <a href="https://amzn.to/4dZ9YM8">Give and Take: Why Helping Others Drives Our Success</a>, Adam Grant classifies individuals into three types: givers, takers, and matchers. Givers are those who give more than they get, always helping others, sharing knowledge, and making connections without expecting anything in return. Takers like to get more than they give, prioritizing their own interests over the needs of others. Matchers operate on a principle of fairness and reciprocity, willing to give as long as they get something equivalent in return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUP_XpBxs6fNjMClbDbTDg.png" /></figure><p>Grant’s argument in <a href="https://amzn.to/3WWIRLB">Give and Take</a> highlights that while takers may find short-term success, givers often achieve greater success in the long run. This intriguing observation is backed by research across various industries and job roles. This aligns with the idea that survival instincts drive short-term gains, but a more sustainable approach involves giving.</p><p>Delving deeper, adopting the role of a giver — someone who embodies an abundant mindset — proves beneficial when done strategically. It’s crucial to give thoughtfully rather than indiscriminately to avoid being exploited. Grant discusses the importance of being discerning about when, how, and to whom you give, ensuring that this generosity translates into long-term advantages. This strategic approach helps maintain a balance where one can be generous without being taken advantage of, ultimately securing a position of strength.</p><blockquote>If you enjoyed the article and want to buy the book, please use: <a href="https://amzn.to/4by3aUl">Dopamine Nation</a> or <a href="https://amzn.to/3WWIRLB">Give and Take</a> above. As an Amazon Associate, I earn from qualifying purchases 🙏</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=534f5cb0fc63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/not-too-crazy/abundance-mindset-how-to-develop-one-and-when-does-it-work-534f5cb0fc63">Abundance Mindset: How to Develop One and When Does it Work?</a> was originally published in <a href="https://medium.com/not-too-crazy">Not Too Crazy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Https Namecheap Subdomain Pointing to an Azure AKS using Automatic Ingress TLS with LetsEncrypt]]></title>
            <link>https://medium.com/coding-spaghetti/https-namecheap-subdomain-pointing-to-an-azure-aks-using-automatic-ingress-tls-with-letsencrypt-3e4c57540a35?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e4c57540a35</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Wed, 15 May 2024 14:52:38 GMT</pubDate>
            <atom:updated>2024-05-15T14:52:59.071Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: The article might be missing some steps at the end. I wrote it a while back and didn’t have time to look back. The content at the beginning can still get you quite far in the process.</em></p><p>If you haven’t setup kubernetes deployment yet see: <a href="https://medium.com/coding-spaghetti/setting-up-servers-on-kubernetes-via-azure-fa1c847abb0f">https://medium.com/coding-spaghetti/setting-up-servers-on-kubernetes-via-azure-fa1c847abb0f</a></p><p>I will be building on top of it.</p><p>Ensure you cli has access to the cluster</p><pre>RESOURCE_GROUP=scoop-dev-rg<br>CLUSTER_NAME=scoop-dev-cluster<br>az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME</pre><p>In your kubernetes cluster create a namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3VrhNSB4XEx7BhbogdGGw.png" /></figure><p>To know which cluster you’re working with</p><pre> kubectl config current-context</pre><p>Select the cluster you want to work with</p><pre>CLUSTER_NAME=facets-dev-cluster<br><br>kubectl config use-context $CLUSTER_NAME</pre><h3>Installing Certificate</h3><p>Check the latest version of cert-manager <a href="https://github.com/cert-manager/cert-manager/releases">https://github.com/cert-manager/cert-manager/releases</a></p><p>Install cert-manager: Ensure that cert-manager is installed on your cluster. You can do this using Helm or directly with kubectl applying the cert-manager YAML manifests. Here&#39;s how you can install it using Helm:</p><pre># Add the Jetstack Helm repository<br>helm repo add jetstack https://charts.jetstack.io<br><br># Update your local Helm chart repository cache<br>helm repo update<br><br># Install the cert-manager Helm chart<br>helm install cert-manager jetstack/cert-manager \<br>  --namespace cert-manager \<br>  --create-namespace \<br>  --version v1.5.3 \<br>  --set installCRDs=true</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ya_4wkRcTABOj9JJPyxZYQ.png" /></figure><p>Verify CRD Installation: After installation, you can verify that the CRDs have been installed successfully by running the following command:</p><pre>kubectl get crd | grep &#39;cert-manager.io&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_gzWmOD15DF-3T8G8hozQ.png" /></figure><p>Open the bash terminal and create a file at the</p><pre>vi letsencrypt-clusterissuer.yaml</pre><p>update the following with your <strong>email</strong> and paste it into the terminal</p><pre>apiVersion: cert-manager.io/v1<br>kind: ClusterIssuer<br>metadata:<br>  name: letsencrypt<br>spec:<br>  acme:<br>    # The ACME server URL for Let&#39;s Encrypt&#39;s production environment<br>    # Use &quot;https://acme-staging-v02.api.letsencrypt.org/directory&quot; for the staging environment<br>    server: https://acme-v02.api.letsencrypt.org/directory<br><br>    # Email address used for ACME registration<br>    email: your_email@gmail.com<br><br>    # Name of a secret used to store the ACME account private key<br>    privateKeySecretRef:<br>      name: letsencrypt<br><br>    # Enable the HTTP-01 challenge provider<br>    solvers:<br>    - http01:<br>        ingress:<br>          class: nginx<br>          podTemplate:<br>            spec:<br>              nodeSelector:<br>                &quot;kubernetes.io/os&quot;: linux</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMZzNu4USgvnfRLfVe0T4A.png" /></figure><p>control+c to exit :wq to keep changes</p><p>Run the following after replacing with your own namespace that match the namespace you will host your services in</p><pre>NAMESPACE=facets-services-namespace<br>kubectl apply --namespace $NAMESPACE -f letsencrypt-clusterissuer.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Kb3zNtFcrdfXYZSuXcfsw.png" /></figure><p>If you need to undo changes for whatever reason you can use</p><pre>kubectl delete --namespace $NAMESPACE -f letsencrypt-clusterissuer.yaml</pre><p>You can check your certificate using</p><pre>kubectl get clusterissuer.cert-manager.io -n $NAMESPACE</pre><p>You can delete using where the last prop is the metadata name</p><pre>kubectl delete clusterissuer.cert-manager.io letsencrypt</pre><p>To get services in the namespace:</p><pre>kubectl get svc -n $NAMESPACE</pre><p>Setup file for domains using the ssl certificate</p><pre>vi facets-tls-ingress.yaml</pre><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: facets-ssl-tls-ingress<br>  annotations:<br>    cert-manager.io/cluster-issuer: letsencrypt<br>    nginx.ingress.kubernetes.io/websocket-services: &quot;chat-service&quot;<br>    nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot; # Allow unlimited size, or set a specific size like 50m<br>spec: <br>  ingressClassName: nginx<br>  tls:<br>  - hosts:<br>    - chat.facets.one<br>    - backend.facets.one<br>    - fileservice.facets.one<br>    secretName: facets-cert<br>  rules:<br>  - host: chat.facets.one<br>    http:<br>      paths:<br>      - path: /<br>        pathType: Prefix<br>        backend:<br>          service:<br>            name: chat-service<br>            port: <br>              number: 7200<br>  - host: backend.facets.one<br>    http:<br>      paths:<br>      - path: /<br>        pathType: Prefix<br>        backend:<br>          service:<br>            name: backend-service<br>            port: <br>              number: 4000<br>  - host: fileservice.facets.one<br>    http:<br>      paths:<br>      - path: /<br>        pathType: Prefix<br>        backend:<br>          service:<br>            name: fileservice-service<br>            port: <br>              number: 4040</pre><p>control+c to exit :wq to keep changes</p><pre>kubectl apply --namespace $NAMESPACE -f facets-tls-ingress.yaml</pre><p>kubectl get ingress facets-ssl-tls-ingress — namespace $NAMESPACE</p><h3>Verify your domain with LetsEncrypt</h3><p><a href="https://letsencrypt.org/docs/challenge-types/">Challenge Types</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e4c57540a35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coding-spaghetti/https-namecheap-subdomain-pointing-to-an-azure-aks-using-automatic-ingress-tls-with-letsencrypt-3e4c57540a35">Https Namecheap Subdomain Pointing to an Azure AKS using Automatic Ingress TLS with LetsEncrypt</a> was originally published in <a href="https://medium.com/coding-spaghetti">coding spaghetti</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have Shame and/or Triggers? Tools to Conquer Your Inner Demons so you can Love Yourself]]></title>
            <link>https://medium.com/not-too-crazy/have-shame-and-or-triggers-tools-to-conquer-your-inner-demons-so-you-can-love-yourself-1574f68d185c?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/1574f68d185c</guid>
            <category><![CDATA[coaching]]></category>
            <category><![CDATA[empowerment]]></category>
            <category><![CDATA[shame]]></category>
            <category><![CDATA[self-love]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Mon, 13 May 2024 00:04:25 GMT</pubDate>
            <atom:updated>2024-05-13T00:21:06.603Z</atom:updated>
            <content:encoded><![CDATA[<p>We all have things about ourselves that we don’t want anyone to know. We might worry that if someone found out these things, they wouldn’t love us or want to be around us anymore.</p><p>We feel shame when we there’s a difference between who we think we should be and where we’re at. There’s two ways you can decrease this gap: from the top down or from the bottom up. Lower your expectations (top down), reframe the beliefs you have about yourself or self improve (bottom up). Easier said than done, but realizing this made me less hard on myself (decrease the gap by lowering expectations), which allowed me to have space to self improve (decrease the gap by increasing self assessment).</p><p>While it’s good to have high standards, if your high standards aren’t serving you, it’s time to readjust so they aren’t paralyzing you. Remember you can always adjust them back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDK1ksbXDF4y4EIkPPnJNA.png" /></figure><p>When we give ourselves hard timelines and goals to reach or compare ourselves to others, we aren’t managing our expectations of ourselves and it can be a downward spiral.</p><p>Catching our thoughts and being self-aware is the first step to stopping destructive thoughts. Self-awareness is important because its linked to having happier relationships, being more successful, and living happier lives.</p><p>We might also have limiting beliefs that are holding us back. Maybe we think we’re not that smart, not that technical, too selfish, too bossy… Whatever it is we need to find evidence to disprove that. Often just pausing and asking ourselves, ‘<em>Is that true</em>?’ might be enough to get us out of our heads. Listing out reasons that counter our limiting beliefs is a great way to prove ourself wrong. If we’re extra stubborn, getting a friend or having a coach (aka <a href="http://www.nottoocrazy.com/">me 🙋</a>!), can help us break out our our beliefs can be more convincing than ourselves.</p><p>Last taking actions that build love in ourselves will show ourselves we are who we want ourselves to be. Richard C. Schwartz, Phd, creator of Internal Family Systems, and author of <a href="https://amzn.to/44GntMG">No Bad Parts</a> believes when we are healed of our traumas we are self-led, and we will move with compassion, creativity, curiosity, calm, confidence, clarity, courage, and connectedness. I believe that proactively moving in that manner also helps us love ourselves.</p><p>Sometimes deep rooted shame from traumas from our past and the exercises from above might not be enough. This is where inner child work, shadow work, parts work or internal family systems comes in. They’re all generally covering the same thing. How do we love the parts about ourselves we shame? More to come in future posts!</p><blockquote>If you enjoyed the article and want to buy the book, please use my <a href="https://amzn.to/44GntMG">‘link’</a> above. As an Amazon Associate, I earn from qualifying purchases 🙏</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1574f68d185c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/not-too-crazy/have-shame-and-or-triggers-tools-to-conquer-your-inner-demons-so-you-can-love-yourself-1574f68d185c">Have Shame and/or Triggers? Tools to Conquer Your Inner Demons so you can Love Yourself</a> was originally published in <a href="https://medium.com/not-too-crazy">Not Too Crazy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have fears you can’t explain? It might be epigenetics from two generations ago!]]></title>
            <link>https://medium.com/not-too-crazy/have-fears-you-cant-explain-it-might-be-epigenetics-from-two-generations-ago-523c9409d560?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/523c9409d560</guid>
            <category><![CDATA[trauma]]></category>
            <category><![CDATA[fear]]></category>
            <category><![CDATA[epigenetics]]></category>
            <category><![CDATA[hypersensitivity]]></category>
            <category><![CDATA[anxiety]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Thu, 09 May 2024 22:02:08 GMT</pubDate>
            <atom:updated>2024-05-09T22:02:08.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8AxidDW2CfvIx7lW04mlg.png" /></figure><blockquote>Epigenetics is the study of how your behaviors and environment can cause changes that affect the way your genes work. Unlike genetic changes, epigenetic changes are reversible and do not change your DNA sequence, but they can change how your body reads a DNA sequence. —<a href="https://www.cdc.gov/genomics/disease/epigenetics.htm#:~:text=Epigenetics%20is%20the%20study%20of,body%20reads%20a%20DNA%20sequence.">Centers for Disease Control and Prevention</a></blockquote><p>In the book <a href="https://amzn.to/4aYEDaF"><em>‘It Didn’t Start With You’</em></a>, Mark Wolynn quotes studies done by professor Rachel Yehuda of psychiatry and neuroscience at Mount Sinai School of Medicine in New York. Holocaust survivors, war veterans, pregnant mothers during the World Trade Center attacks with PTSD produced less cortisol. Interestingly, their children also did too. If your parents had PTSD symptoms you were three times more likely to suffer from anxiety and depression. Yehuda believes generational PTSD is inherited instead of through the exposure of our parents’ stories. I believe we’re biologically made to pass down hypersensitivity to our children so they can be attuned to dangers. Similarly neurodivergents (ex: people with ADHD) are also hypersensitive and are more prone to anxiety and depression. My belief is that until you learn to hone your superpower (ex: hypersensitivity) it can create problems for you. I don’t necessarily see it as a bad thing, but a gift with responsibilities.</p><p>Studies done on mice showed similar results. Mice were taught to fear the smell of cherry blossoms by zapping their feet. Their offspring who had no social exposure to their parents and never experienced the zapping also feared cherry blossom smells. Epigenetic markers showed up on the mice’s sperm specifically on the gene responsible for detecting cherry blossoms. You can read more about it <a href="https://news.emory.edu/stories/2013/12/smell_epigenetics_ressler/campus.html">here</a>.</p><p>Your deep seeded fears may not have come from you! In the example given in the book <a href="https://amzn.to/4aYEDaF">‘<em>It Didn’t Start With You’</em></a>, a 19 year suddenly began to suffer from insomnia fearing that if he fell asleep he would die. He later discovered that he had a uncle who died in a blizzard while installing cable wires at the age of 19! Knowing where this fear originated from, and was not a real threat enabled him to eventually overcome his conditioning. Based on the readings above, I hypothesize that his father’s traumatic experience of his brother’s death caused DNA alteration in his sperm that got passed down to his son.</p><p>All of us have deep seeded traumas. If you are curious about squashing some of your fears I recommend reading <a href="https://amzn.to/4aYEDaF"><em>‘It Didn’t Start With You’</em></a><em>.</em></p><blockquote>If you enjoyed the article and want to buy the book, please use my <a href="https://amzn.to/4aYEDaF">‘links’</a> above. As an Amazon Associate, I earn from qualifying purchases 🙏</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=523c9409d560" width="1" height="1" alt=""><hr><p><a href="https://medium.com/not-too-crazy/have-fears-you-cant-explain-it-might-be-epigenetics-from-two-generations-ago-523c9409d560">Have fears you can’t explain? It might be epigenetics from two generations ago!</a> was originally published in <a href="https://medium.com/not-too-crazy">Not Too Crazy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have Anxiety Around Money? Learn To Improve Your Money EQ]]></title>
            <link>https://medium.com/not-too-crazy/have-anxiety-around-money-learn-to-improve-your-money-eq-3bea2503f843?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bea2503f843</guid>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[anxiety]]></category>
            <category><![CDATA[money-mindset]]></category>
            <category><![CDATA[money-management]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Wed, 01 May 2024 20:26:34 GMT</pubDate>
            <atom:updated>2024-05-01T20:37:24.024Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-FJxx8Yx8VaR4OKBwGbUiA.png" /></figure><p><a href="https://kenhonda.com/about-ken/">Ken Honda</a> the bestseller of <a href="https://amzn.to/4bn8J7H">Happy Money</a> interviewed a bunch of rich Japanese billionaires to understand how they perceived money. He coined the term “Money EQ” (Emotional Intelligence). According to Honda, Money EQ emphasizes the relationship and mindset one has towards money vs financial literacy (Money IQ).</p><p>In his research he became aware that money is energy, and the way we perceive money affects to way we deal with it.</p><p>There are three money types personalities.</p><h3>Three Money Personality Types</h3><ol><li><strong>Controlling</strong> — Uses money to control their emotions.</li><li><strong>Indifferent </strong>— A person who can make decisions irrelevant of money.</li><li><strong>Fear </strong>— Believes that money is bad / evil and therefore avoids money.</li></ol><h4>Control Money Type</h4><p>Each money type has their own subtypes. Within the Control Money group there are:</p><ul><li><strong>Saver</strong> — someone who uses money to reduce fear and increase sense of security</li><li><strong>Spender</strong> — someone who uses money to feel good</li><li><strong>Money Maker </strong>— someone who gets enjoyment out of making money</li></ul><p><strong>Fun fact</strong>: money savers and spenders is that they are often attracted to each other. The psychology around this is that savers want to be around spenders because they’re fun, exciting, and generous. They use money to have experiences and get joy out of life. Spenders like to be around savers because deep down they know they’re too careless with money, and want to be more grounded. In romantic relationships this often leads to arguments. Ken Honda, has said that the realization that a couple has different money types has helped them accept one another and reolve arguments.</p><h4>Indifferent Money Type</h4><p>People who are indifferent to money can choose a life path that isn’t influenced by money. Since they can focus on what gives them purpose they are generally happy. The only downside is that if they can’t do their purpose to earn money, they generally don’t know what to do.</p><h4>Fear Money Type</h4><p>Within the Fear Money group there are also three subtypes:</p><ul><li><strong>Hippie</strong> — has resentment towards money and avoids capitalism</li><li><strong>The Gambler </strong>— will take big risks around money and uses it for thrill seeking</li><li><strong>The Spender-Splurger </strong>— will save money but then can’t hold onto it and will spend it all</li><li><strong>The Worrier </strong>— actions (over control) or paralysis (avoidance) are driven anxiety and concern with worry of not having enough or fear of loss</li></ul><p><strong>Fun fact:</strong> The Gambler may be a reaction to growing up in an overly stable household. The need for excitement leads to self sabbotage to create the ups and downs in life.</p><p>We may be on a spectrum of the different money types with a domination personality. Trying on a different personality is a great way to calibrate your relationship to money.</p><h3>Money EQ</h3><p>Key concepts around money EQ include:</p><p><strong>Emotional Relationship:</strong><br>Money EQ addresses one’s emotional connection to money, including attitudes, beliefs, and feelings that shape how they manage finances.</p><p><strong>Healthy Mindset:</strong><br>It stresses the importance of having a positive and healthy mindset towards money, moving away from negative emotions such as fear, guilt, or greed, which can hinder financial well-being.</p><p><strong>Money and Happiness:</strong><br>Honda’s teachings emphasize the connection between financial habits and overall happiness, advocating for a balanced and joyful relationship with money.</p><p><strong>Spending with Joy:</strong><br>He encourages spending and managing money in ways that bring joy, suggesting that emotional well-being and financial decisions are interconnected.</p><p><strong>Practical Applications:</strong><br>Money EQ involves integrating positive emotional responses with practical financial strategies, guiding decisions around earning, saving, and investing.</p><p>To read more about it buy the book or audible <a href="https://amzn.to/4dm2rH2">here</a></p><blockquote><em>If you enjoyed the article and want to buy the book, please use my </em><a href="https://amzn.to/4dm2rH2"><em>link</em></a><em>. As an Amazon Associate, I earn from qualifying purchases.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bea2503f843" width="1" height="1" alt=""><hr><p><a href="https://medium.com/not-too-crazy/have-anxiety-around-money-learn-to-improve-your-money-eq-3bea2503f843">Have Anxiety Around Money? Learn To Improve Your Money EQ</a> was originally published in <a href="https://medium.com/not-too-crazy">Not Too Crazy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Next JS Web App using Docker and Github Actions in Azure]]></title>
            <link>https://medium.com/coding-spaghetti/deploying-next-js-web-app-using-docker-and-github-actions-in-azure-2d5cc28d6705?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d5cc28d6705</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[azure-web-app]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Tue, 21 Nov 2023 22:21:19 GMT</pubDate>
            <atom:updated>2023-11-22T00:20:41.100Z</atom:updated>
            <content:encoded><![CDATA[<p>We will create a web app, enable access to your repo, and create a github actions workflow. Later we will add code to dockerize your code base and have it deploy to the web app.</p><p>This took me hours to figure you since there were so many azure setup options. Even though you may have added docker login credentials to your github workflow yaml, it doesn’t mean your web app has access to the repo. Therefore configurations needed to be set to get everything working. I’m showing you a flow that makes as much of this setup automatic. There are other ways of doing this and/or you can create a web app via command line. This is just one way.</p><ol><li>First make sure yarn build &amp; yarn start works locally. This will save you from debugging deployment if this is the reason your build is failing.</li><li>Create a web app</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bLO4Oq1wOYBkj_7SdoxaA.png" /></figure><p>2. Set a resource group. Give your app a name &amp; select Docker Container as the Publish option. Select the region that closest/cheapest to your users. Press review + create button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5NCR-UcNKWmmLLUlmj4Jg.png" /></figure><p>3. In the Docker Tab select your image source. In my case I had the docker image of my repo pushed to Azure. Therefore I only needed to select where the location of the image.</p><p>The advantage of already having an image pushed to your Azure container registry, is that it will preset the configurations to access docker for you. So you won’t need to manually put variables: DOCKER_REGISTRY_SERVER_URL , DOCKER_REGISTRY_SERVER_PASSWORD , DOCKER_REGISTRY_SERVER_USERNAME .</p><p>It doesn’t matter which image you select, as long as it’s an image from the registry you want access to.</p><p>If you don’t have an image yet, then you can skip this for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYh967lcPwKy6l_d_s3xRA.png" /></figure><p>4. I enabled logging and then went to <em>review + create</em> tab and create the web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*377gXu5N1Sl-HfCOkYJPiA.png" /></figure><p>5. Once created goto the configuration tab on the left menu. Choose + New application setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aUkhKYW-ZtkwTcNesc6fPA.png" /><figcaption>Azure Web App Configuration View</figcaption></figure><p>If you had selected a docker image then the docker values would have been filled DOCKER_REGISTRY_SERVER_URL , DOCKER_REGISTRY_SERVER_PASSWORD , DOCKER_REGISTRY_SERVER_USERNAME.</p><p>Add the docker values if you didn’t select a repo above. This enables</p><p>You should also see WEBSITES_ENABLE_APP_SERVICE_STORAGE as false. If you don’t add it.</p><p>Also add WEBSITES_CONTAINER_START_TIME_LIMIT as 1800. Since it takes time to build the next js app, you will get a timeout error if you don’t do this.</p><p>6. Next go to the Deployment Center tab and select Github Actions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJxGCRdai6luoYQW5tYa2A.png" /></figure><p>Grant access to your github repository by logging in with an owner account if your repo belongs to an organization.</p><p>Make sure workflow option, ‘add workflow’ is choosen. This will push a github workflow yml file that will run on the predefined branch and repo. What’s nice is that is will auto link the workflow with access credentials to the webapp.</p><p>7. Now goto your github repo &amp; pull the to get the recent commit generated by the above.<br>Under <em>.github/workflows/{branch}_{app_name}.yml</em> you should see something similar to the this:</p><pre># Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy<br># More GitHub Actions for Azure: https://github.com/Azure/actions<br><br>name: Build and deploy container app to Azure Web App - facets-feedback-docker<br><br>on:<br>  push:<br>    branches:<br>      - main<br>  workflow_dispatch:<br><br>jobs:<br>  build:<br>    runs-on: &#39;ubuntu-latest&#39;<br><br>    steps:<br>    - uses: actions/checkout@v2<br><br>    - name: Set up Docker Buildx<br>      uses: docker/setup-buildx-action@v2<br><br>    - name: Log in to registry<br>      uses: docker/login-action@v2<br>      with:<br>        registry: https://scoopdevcontainerregistry.azurecr.io/<br>        username: ${{ secrets.AzureAppService_ContainerUsername_7bb27a47a29b4c55a0946cf147f2b74a }}<br>        password: ${{ secrets.AzureAppService_ContainerPassword_487e2a7c48c1428d9aee7922945def04 }}<br><br>    - name: Build and push container image to registry<br>      uses: docker/build-push-action@v3<br>      with:<br>        push: true<br>        tags: scoopdevcontainerregistry.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_7bb27a47a29b4c55a0946cf147f2b74a }}/feedback:${{ github.sha }}<br>        file: ./Dockerfile<br><br>  deploy:<br>    runs-on: ubuntu-latest<br>    needs: build<br>    environment:<br>      name: &#39;production&#39;<br>      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}<br><br>    steps:<br>    - name: Deploy to Azure Web App<br>      id: deploy-to-webapp<br>      uses: azure/webapps-deploy@v2<br>      with:<br>        app-name: &#39;facets-feedback-docker&#39;<br>        slot-name: &#39;production&#39;<br>        publish-profile: ${{ secrets.AzureAppService_PublishProfile_af0528bd03f643298d541dab7b23e028 }}<br>        images: &#39;scoopdevcontainerregistry.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_7bb27a47a29b4c55a0946cf147f2b74a }}/feedback:${{ github.sha }}&#39;</pre><p>You should see<em> docker/login-action@v2 </em>with username and password setup for you. As well as the url and the publish-profile (credentials to publish), and the docker image you want to push. It will tag any commit made from a push with the github commit identifier github.sha</p><p>8. The only thing we need to do now is set any env vars we want and create a Dockerfile.</p><p>I updated the workflow yml &amp; I created env section with any environmental variables my code base needed. I then added build-args to the docker section to pass these variables in. I also removed username as to where the image was being stored and deployed from.</p><pre># Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy<br># More GitHub Actions for Azure: https://github.com/Azure/actions<br><br>name: Build and deploy container app to Azure Web App - facets-feedback-docker<br><br>on:<br>  push:<br>    branches:<br>      - main<br>  workflow_dispatch:<br><br>env:<br>  NODE_VERSION: &quot;18&quot;<br>  PORT: ${{ vars.PORT_DEV }}<br>  NEXT_PUBLIC_BACKEND_URL: ${{ vars.NEXT_PUBLIC_BACKEND_URL }}<br><br>jobs:<br>  build:<br>    runs-on: &quot;ubuntu-latest&quot;<br><br>    steps:<br>      - uses: actions/checkout@v2<br><br>      - name: Set up Docker Buildx<br>        uses: docker/setup-buildx-action@v2<br><br>      - name: Log in to registry<br>        uses: docker/login-action@v2<br>        with:<br>          registry: https://scoopdevcontainerregistry.azurecr.io/<br>          username: ${{ secrets.AzureAppService_ContainerUsername_7bb27a47a29b4c55a0946cf147f2b74a }}<br>          password: ${{ secrets.AzureAppService_ContainerPassword_487e2a7c48c1428d9aee7922945def04 }}<br><br>      - name: Build and push container image to registry<br>        uses: docker/build-push-action@v5<br>        with:<br>          context: .<br>          platforms: linux/amd64,linux/arm64<br>          push: true<br>          tags: |<br>            scoopdevcontainerregistry.azurecr.io/feedback:${{ github.sha }}<br>            scoopdevcontainerregistry.azurecr.io/feedback:latest<br>          file: ./Dockerfile<br>          build-args: |<br>            PORT=${{ env.PORT }}<br>            NEXT_PUBLIC_BACKEND_URL=${{ env.NEXT_PUBLIC_BACKEND_URL }}<br><br>  deploy:<br>    runs-on: ubuntu-latest<br>    needs: build<br>    environment:<br>      name: &quot;production&quot;<br>      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}<br><br>    steps:<br>      - name: Deploy to Azure Web App<br>        id: deploy-to-webapp<br>        uses: azure/webapps-deploy@v2<br>        with:<br>          app-name: &quot;facets-feedback-docker&quot;<br>          slot-name: &quot;production&quot;<br>          publish-profile: ${{ secrets.AzureAppService_PublishProfile_af0528bd03f643298d541dab7b23e028 }}<br>          images: &quot;scoopdevcontainerregistry.azurecr.io/feedback:${{ github.sha }}&quot;</pre><p>9. In my Dockerfile set at the root of my codebase I passed in my build arguments. I echo my variables so I could see if they were passing through, but I recommend not printing sensitive data.</p><p>Read: <a href="https://nextjs.org/docs/pages/building-your-application/deploying#docker-image">https://nextjs.org/docs/pages/building-your-application/deploying</a> to see what you need to deploy</p><p>make sure your next.config.js contains <em>output:standalone</em></p><pre>module.exports = {<br>  output: &#39;standalone&#39;,<br>}</pre><p>In my code base I used yarn instead of npm, therefore I needed to COPY yarn.lock instead of package-lock.json.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RdxrcgKuaJadziKLdwFuw.png" /></figure><pre>FROM node:18-alpine AS base<br><br># Install dependencies only when needed<br>FROM base AS deps<br># Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.<br>RUN apk add --no-cache libc6-compat<br>WORKDIR /app<br><br># Install dependencies based on the preferred package manager<br>COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./<br>RUN \<br>  if [ -f yarn.lock ]; then yarn --frozen-lockfile; \<br>  elif [ -f package-lock.json ]; then npm ci; \<br>  elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm &amp;&amp; pnpm i --frozen-lockfile; \<br>  else echo &quot;Lockfile not found.&quot; &amp;&amp; exit 1; \<br>  fi<br><br><br># Rebuild the source code only when needed<br>FROM base AS builder<br>WORKDIR /app<br>COPY --from=deps /app/node_modules ./node_modules<br>COPY . .<br><br># Next.js collects completely anonymous telemetry data about general usage.<br># Learn more here: https://nextjs.org/telemetry<br># Uncomment the following line in case you want to disable telemetry during the build.<br># ENV NEXT_TELEMETRY_DISABLED 1<br><br>RUN yarn build<br><br># If using npm comment out above and use below instead<br># RUN npm run build<br><br># Production image, copy all the files and run next<br>FROM base AS runner<br>WORKDIR /app<br><br>ENV NODE_ENV production<br># Uncomment the following line in case you want to disable telemetry during runtime.<br># ENV NEXT_TELEMETRY_DISABLED 1<br><br># Build the application<br>ARG NEXT_PUBLIC_BACKEND_URL<br><br># Print environment variables during build<br>RUN echo &quot;NEXT_PUBLIC_BACKEND_URL: $NEXT_PUBLIC_BACKEND_URL&quot;<br><br># Set environment variables<br>ENV NEXT_PUBLIC_BACKEND_URL=$NEXT_PUBLIC_BACKEND_URL<br><br><br>RUN addgroup --system --gid 1001 nodejs<br>RUN adduser --system --uid 1001 nextjs<br><br>COPY --from=builder /app/public ./public<br><br># Set the correct permission for prerender cache<br>RUN mkdir .next<br>RUN chown nextjs:nodejs .next<br><br># Automatically leverage output traces to reduce image size<br># https://nextjs.org/docs/advanced-features/output-file-tracing<br>COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./<br>COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static<br><br>USER nextjs<br><br>EXPOSE 3000<br><br>ENV PORT 3000<br># set hostname to localhost<br>ENV HOSTNAME &quot;0.0.0.0&quot;<br><br># server.js is created by next build from the standalone output<br># https://nextjs.org/docs/pages/api-reference/next-config-js/output<br>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p>10. Commit and push your changes. Follow the success of the build under your repo’s actions. If anything fails in the actions build you can click in and debug the logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvSWITmGvoCc2dC0jnLe_w.png" /></figure><p>11. If everything is successful you can test if the url works. If you need to debug anything head back to the Deployment Center and read through the logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzX-of92iqAY5mc2U27nuw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d5cc28d6705" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coding-spaghetti/deploying-next-js-web-app-using-docker-and-github-actions-in-azure-2d5cc28d6705">Deploying Next JS Web App using Docker and Github Actions in Azure</a> was originally published in <a href="https://medium.com/coding-spaghetti">coding spaghetti</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up Servers on Kubernetes via Azure]]></title>
            <link>https://medium.com/coding-spaghetti/setting-up-servers-on-kubernetes-via-azure-fa1c847abb0f?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa1c847abb0f</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[static-public-ip]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 07:51:21 GMT</pubDate>
            <atom:updated>2023-11-02T20:17:06.196Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m completely new to <a href="https://kubernetes.io/">kubernetes</a>. A friend had suggested it when I used up all my startup AWS credits too quickly. Motivated by seeing other startup founders just pull through and get stuff out the door, I was motivated to crush my self-limiting belief that I’m not technical enough. So I decided to tackle this. Probably the wrong choice, since it took me a little too long get stuff out the door, but at least I’ve come out the other side more confident.</p><p><a href="https://www.microsoft.com/en-us/startups">Microsoft for startups</a> recently launched, and I able to easily get 5k in credits along with access to other perks like GitHub Enterprise, OpenAI…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-GyHqsDBhPJYWncPgGp5g.png" /></figure><p>Once you’ve created an account for azure create a <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal">resource group</a>. Resource groups are easy ways for you to group things easily for so you can easily deploy, update, and delete them as a group and manage permissions.</p><p>I divided based on environments: prod and dev. If you have a larger project with multiple subprojects you may want group things differently.</p><h4>Naming Resources</h4><p>Since there are so many resources you can create, I know I wouldn’t be able to distinguish or remember what each thing is so I used a naming convention: <strong>{name}-{resource-group}-{name of resource}</strong></p><p>Consideration is that some resources only take camelCase, therefore if you’re OCD about consistency you may want to just name your resources with camelCase.</p><p>ex: scoop-dev-rg</p><p>Benefits:</p><ul><li>Since some resources get auto generated by Azure when you create a resource, I knew I didn’t create it, when they didn’t follow my naming convention. Adding name was a differentiator, you can also choose something like a company name or project name.</li><li>For <strong>resource-group</strong> I used my environment: prod vs dev. Therefore when I saw a bunch of resources I new which ones worked together and didn’t.</li><li>Name of the resource, allowed me to recognize what I was creating. While azure has icons to represent this, I honestly can’t remember which one represents which. Having the resource name made this so much easier. I usually avoid shorthand, but that’s because I have terrible memory, so feel free to use shorthand ex: ‘resource group’ might be ‘rg’</li></ul><h3>Creating the Resource Group in Azure</h3><p>Search for resource group in the search bar if you don’t already see it on the main screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXw4_g6H-JY0bKzTKuUIiQ.png" /></figure><p>Hit the create button on the top left.</p><p>Choose your subscription plan you want your group to charge to.</p><p>Name your resource group. Note it needs to be in camelCase. Example I created scoop-dev-rg and scoop-prod-rg.</p><p>Choose your Region</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgoXIrqiN4NMq7HtnNd48w.png" /></figure><p>I didn’t need to set any of the other settings, therefore feel free to just hit Review + Create and then Create, or Next until you hit the end, and hit Create. Note: creating resource groups is free, so don’t be shy on hitting the create button.</p><p>You’ll be brought to the resource group dashboard, where you can see all of your resource groups along with your new resource group!</p><p>When you click in you’ll be able to see all the resources you assign to this group. At the moment this will be empty.</p><h3>Creating the Kubernetes Cluster in Azure</h3><p>Similarly search and select Kubernetes services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*keFb5l_S_qxPVDaOiYSI4g.png" /></figure><p>Click createon the top right, select Create a Kubernetes cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hRe5csva-S-4xEMGAfaMQ.png" /></figure><p>Select the resource group the cluster belongs to.</p><p>Select cluster preset configuration details. This affects cost. If you’re just playing around use test/dev.</p><p>Name your cluster. Following my convention mind was scoop-dev-cluster.</p><p>I choose the defaults for the rest and hit the Review + Createbutton and then Create</p><p><em>Note: that Azure moved away from </em><strong><em>service principles </em></strong><em>as a way to manage permissions to resources and now uses </em><strong><em>managed identity</em></strong></p><ol><li><strong>Service Principal</strong>: This is the older method where you manually create and manage the Azure AD application and associated service principal that the AKS cluster uses.</li><li><strong>Managed Identity</strong>: This is a newer and recommended method where Azure manages the identity for you, providing an identity for the AKS cluster automatically in the background.</li></ol><h4>To use the terminal:</h4><p>You can download tooling so you can access azure, on your own terminal with the service principle we’re about to create, or you can use their cloud terminal.</p><p>I just use to the cloud terminal for simplicity which can be accessed: <a href="https://portal.azure.com/#cloudshell/">https://portal.azure.com/#cloudshell/</a> or by clicking the terminal icon on the top right of your azure screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9umoZLaTWfuoRDtzYmzTKA.png" /></figure><p>You will need to login to the terminal az login</p><p>You will get instructions:</p><blockquote>A web browser has been opened at <a href="https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize.">https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize.</a> Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login — use-device-code`.</blockquote><p>Follow the instructions that open up on the browser.</p><p>az account set--subscription {subscription-id} make sure you set your account to the subscription you want charged. If you only have one it will be set to the default one.</p><h3>Setting up Network Contributor role</h3><p>The Network Contributor role in Azure is a built-in role that grants permissions to manage networking resources, but not access to them. This role is typically assigned to users who need to manage network resources, which can include virtual networks, subnets, network interfaces, and several other network-related services.<br><a href="https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#network-contributor">https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#network-contributor</a></p><pre>RESOURCE_GROUP=scoop-dev-rg<br>SUBSCRIPTION_ID=$(az account show --query id -o tsv) #note only if you set your subscription id before else put it manually<br>az ad sp create-for-rbac --name facets-github-service-principle --role contributor --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP --json-auth</pre><pre>CLUSTER_NAME=scoop-dev-cluster<br>RESOURCE_GROUP=scoop-dev-rg<br>SUBSCRIPTION_ID=$(az account show --query id -o tsv)<br>MANAGED_IDENTITY_PRINCIPAL_ID=$(az aks show --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --query identity.principalId -o tsv)<br>az role assignment create --assignee $MANAGED_IDENTITY_PRINCIPAL_ID --role &quot;Network Contributor&quot; --scope /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP</pre><pre>RESOURCE_GROUP=scoop-dev-rg<br>CLUSTER_NAME=facets-cluster<br>REGISTRY_NAME=scoopDevContainerRegistry<br>RESOURCE_ID=$(az acr show --name $REGISTRY_NAME --query id --output tsv)<br>MANAGED_IDENTITY_PRINCIPAL_ID=$(az aks show --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --query identity.principalId -o tsv)<br><br># Create the role assignment<br>az role assignment create --assignee $MANAGED_IDENTITY_PRINCIPAL_ID --scope $RESOURCE_ID --role AcrPull<br>az role assignment create --assignee $MANAGED_IDENTITY_PRINCIPAL_ID --scope $RESOURCE_ID --role AcrPush</pre><h3>Azure Login Credentials</h3><p><a href="https://github.com/Azure/login#configure-deployment-credentials">GitHub - Azure/login: Connect to Azure</a></p><pre>NAME=myApp<br>RESOURCE_GROUP=scoop-dev-rg<br>SUBSCRIPTION_ID=$(az account show --query id -o tsv)<br>#note only if you set your subscription id before else put it in manually<br><br>az ad sp create-for-rbac --name $NAME --role contributor \<br>                            --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP \<br>                            --json-auth</pre><p>Output should look like</p><pre> {<br>   &quot;clientId&quot;: &quot;&lt;GUID&gt;&quot;,<br>   &quot;clientSecret&quot;: &quot;&lt;STRING&gt;&quot;,<br>   &quot;subscriptionId&quot;: &quot;&lt;GUID&gt;&quot;,<br>   &quot;tenantId&quot;: &quot;&lt;GUID&gt;&quot;,<br>   &quot;resourceManagerEndpointUrl&quot;: &quot;&lt;URL&gt;&quot;<br>   (...)<br> }</pre><p>Save it the full json object into github actions. I created a secret named AZURE_CREDENTIALS_DEV</p><p>Assign it network contribution role</p><pre>CLIENT_ID=&lt;enter clientId value&gt;<br>az role assignment create --assignee $CLIENT_ID --role &quot;Network Contributor&quot; --resource-group $RESOURCE_GROUP</pre><h3>Public IP addresses</h3><p>If you want the service to always deploy to the same IP address you will need to create a static IP for your service. Store it as a github secret.</p><p>I named mine scoop-dev-backend-ip it will show up in the dns name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7p-tM694WB-SZ3dOizEKA.png" /></figure><p>You can use the command line to create a static public ip address as well.</p><pre>NAME=scoop-dev-backend-ip<br>RESOURCE_GROUP=scoop-dev-rg<br><br>az network public-ip create \<br>    --resource-group $RESOURCE_GROUP \<br>    --name $NAME \<br>    --allocation-method static</pre><p>You will use it later as a setting in your github k8.yml</p><pre>type: LoadBalancer<br>loadBalancerIP: ${AZURE_PUBLIC_IP}</pre><p><strong><em>Please note</em></strong><em>: if you need a https IP address you will need to setup an ingress controller. The type will be ClusterIP instead of LoadBalancer. Additional settings for an SSL certificate will also be needed, which is not covered in this tutorial.</em></p><h3>Docker Repo</h3><p>We’ll be using docker to create an image (blueprint of your setup) of the service you want to deploy to kubernetes.</p><p>We will need:</p><ul><li>azure repo to store the images</li><li>docker credentials to use with github actions to enable auto deployment of the images to the repo</li></ul><p>Goto container registries, press the create button and create a registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmfMeu0Xe8rwhNGKcubS1g.png" /></figure><p>When the registry is done building goto Access keys on the right. Check off the admin user to get the login credentials you would need for <a href="https://github.com/Azure/docker-login">azure/docker-login@v1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HM7Ct3g14_luw2sc9DxEMg.png" /></figure><p>You will need to store login server, username and one of the passwords into github environment secrets for the repo to plan to deploy. It will eventually be added to a github actions yml like this.</p><pre>- uses: azure/docker-login@v1<br>  with:<br>      login-server: ${{ vars.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER_DEV }}<br>      username: ${{ vars.AZURE_CONTAINER_REGISTRY_USERNAME_DEV }}<br>      password: ${{ secrets.AZURE_CONTAINER_REGISTRY_PASSWORD_DEV }}</pre><p>Under your repositories settings for the codebase you want to serve using kubernetes add your variables and secrets. Once secrets are inserted you can’t read them again, vs variables are viewable. Note: store things you don’t want visible such as passwords as secrets. Port numbers, urls, usernames can be stored as variables and will be accessed via vars.{{variable_name}}. Secretes will be accessed via secrets.{{secret_name}}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etTsF6cED_Np88sgyopVtA.png" /></figure><h3>Auto deployment via Github Actions</h3><p>First store your environmental variables in github secrets and variables.</p><p>Under .github/workflows create a yaml file with deployment instructions.</p><h4>Cluster Namespace</h4><p>Note if you aren’t using default as the namespace to deploy your services to make sure to create it</p><pre>NAMESPACE=scoop-services-namespace<br>kubectl create namespace $NAMESPACE</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3R7Gve9lTOt1nLFn_x02TQ.png" /></figure><h4>Github Workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i0G5wrYtt3rkuq_fQrysAA.png" /></figure><pre><br>name: Build and deploy Node.js app to scoopDevContainerRegistry<br><br>on:<br>    push:<br>        branches:<br>            - workflow<br><br>env:<br>    NODE_VERSION: &#39;16&#39; # Define node version here to maintain consistency across jobs<br>    PYTHON_VERSION: &#39;3.x&#39; # Define python version here to maintain consistency across jobs<br>    DB_TYPE: ${{ vars.DB_TYPE_DEV }}<br>    DB_DATABASE: ${{ vars.DB_DATABASE_DEV }}<br>    DB_HOST: ${{ vars.DB_HOST_DEV }}<br>    DB_USERNAME: ${{ vars.DB_USERNAME_DEV }}<br>    DB_PORT: ${{ vars.DB_PORT_DEV }}<br>    DB_PASSWORD: ${{ secrets.DB_PASSWORD_DEV }}<br>    DB_SSL_CA_CERT: ${{ secrets.DB_SSL_CA_CERT_DEV }}<br>    JWT_SECRET: ${{ secrets.JWT_SECRET_DEV }}<br>    JWT_EXPIRES_IN: ${{ secrets.JWT_EXPIRES_IN_DEV }}<br>    PORT: ${{ vars.PORT_DEV }}<br>    FILESERVICE_PORT: ${{ vars.FILESERVICE_PORT_DEV }}<br>    BE_FILE_SERVER_URL: ${{ vars.BE_FILE_SERVER_URL_DEV }}<br>    REGISTRY_FOLDER: backend #folder name making it easier to find all docker images from same repo<br>    AZURE_CONTAINER_REGISTRY_LOGIN_SERVER: ${{ vars.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER_DEV }}<br>    AZURE_CONTAINER_REGISTRY_USERNAME: ${{ vars.AZURE_CONTAINER_REGISTRY_USERNAME_DEV }}<br>    AZURE_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.AZURE_CONTAINER_REGISTRY_PASSWORD_DEV }}<br>    AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS_DEV }}<br>    AZURE_PUBLIC_IP: ${{ vars.AZURE_PUBLIC_IP_DEV }}<br>    NAMESPACE: scoop-services-namespace<br>    RESOURCE_GROUP: scoop-dev-rg<br>    CLUSTER_NAME: scoop-dev-cluster<br><br>jobs:<br>    build:<br>        runs-on: ubuntu-latest<br>        permissions:<br>            contents: read<br>            packages: write<br><br>        steps:<br>            - name: Checkout repository<br>              uses: actions/checkout@v3<br>              with:<br>                  token: ${{ secrets.GITHUB_TOKEN }}<br><br>            - name: Setup Node.js<br>              uses: actions/setup-node@v3<br>              with:<br>                  node-version: ${{ env.NODE_VERSION }}<br><br>            - name: Login to Docker Registry<br>              uses: docker/login-action@v1<br>              with:<br>                  registry: ${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}<br>                  username: ${{ env.AZURE_CONTAINER_REGISTRY_USERNAME }}<br>                  password: ${{ env.AZURE_CONTAINER_REGISTRY_PASSWORD }}<br><br>            - name: Build and push Docker images<br>              uses: docker/build-push-action@v2<br>              with:<br>                  context: .<br>                  file: Dockerfile<br>                  build-args: |<br>                      DB_TYPE=${{ env.DB_TYPE }}<br>                      DB_DATABASE=${{ env.DB_DATABASE }}<br>                      DB_HOST=${{ env.DB_HOST }}<br>                      DB_USERNAME=${{ env.DB_USERNAME }}<br>                      DB_PORT=${{ env.DB_PORT }}<br>                      DB_PASSWORD=${{ env.DB_PASSWORD }}<br>                      DB_SSL_CA_CERT=${{ env.DB_SSL_CA_CERT }}<br>                      JWT_SECRET=${{ env.JWT_SECRET }}<br>                      JWT_EXPIRES_IN=${{ env.JWT_EXPIRES_IN }}<br>                      PORT=${{ env.PORT }}<br>                      FILESERVICE_PORT=${{ env.FILESERVICE_PORT }}<br>                      BE_FILE_SERVER_URL=${{ env.BE_FILE_SERVER_URL }}<br>                  push: true<br>                  tags: |<br>                      ${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}/${{ env.REGISTRY_FOLDER }}:${{ github.sha }}<br>                      ${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}/${{ env.REGISTRY_FOLDER }}:latest<br><br>    deploy:<br>        runs-on: ubuntu-latest<br>        needs: build<br>        permissions:<br>            contents: read<br>            id-token: write<br>            deployments: write<br><br>        steps:<br>            - name: Setup Node.js<br>              uses: actions/setup-node@v3<br>              with:<br>                  node-version: ${{ env.NODE_VERSION }}<br><br>            - name: Set up Python and Azure CLI<br>              uses: actions/setup-python@v2<br>              with:<br>                  python-version: ${{ env.PYTHON_VERSION }}<br><br>            - name: Login to Azure<br>              uses: azure/login@v1<br>              with:<br>                  creds: ${{ env.AZURE_CREDENTIALS }}<br><br>            - uses: azure/docker-login@v1<br>              with:<br>                  login-server: ${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}<br>                  username: ${{ env.AZURE_CONTAINER_REGISTRY_USERNAME }}<br>                  password: ${{ env.AZURE_CONTAINER_REGISTRY_PASSWORD }}<br><br>            - name: Setup kubectl<br>              uses: azure/setup-kubectl@v3<br>              with:<br>                  version: &#39;latest&#39;<br><br>            - name: Set up AKS context<br>              uses: azure/aks-set-context@v3<br>              with:<br>                  resource-group: ${{ env.RESOURCE_GROUP }}<br>                  cluster-name: ${{ env.CLUSTER_NAME }}<br><br>            - name: Checkout repository<br>              uses: actions/checkout@v3<br>              with:<br>                  token: ${{ secrets.GITHUB_TOKEN }}<br><br>            - name: Substitute environment variables in k8s config<br>              run: |<br>                  export PORT=${{ env.PORT }}<br>                  export IMAGE_TAG=${{ github.sha }}<br>                  export CONTAINER_REGISTRY=${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}<br>                  export PUBLIC_IP=${{ env.AZURE_PUBLIC_IP }}<br>                  export REGISTRY_FOLDER=${{ env.REGISTRY_FOLDER }}<br>                  touch k8/k8.yml<br>                  envsubst &lt; k8/k8.yml.template &gt; k8/k8.yml<br><br>            - name: Echo contents of k8.yml<br>              run: cat k8/k8.yml<br><br>            - name: Deploy to AKS<br>              id: deploy-aks<br>              uses: Azure/k8s-deploy@v4<br>              with:<br>                  namespace: ${{ env.NAMESPACE }}<br>                  images: ${{ env.AZURE_CONTAINER_REGISTRY_LOGIN_SERVER }}/${{ env.REGISTRY_FOLDER }}:${{ github.sha }}<br>                  manifests: |<br>                      k8/k8.yml</pre><p>k8.yml.template</p><pre>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: backend-deployment<br>  labels:<br>    app: backend<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: backend<br>  template:<br>    metadata:<br>      labels:<br>        app: backend<br>    spec:<br>      containers:<br>      - name: backend<br>        image: ${CONTAINER_REGISTRY}/${REGISTRY_FOLDER}:${IMAGE_TAG}<br>        imagePullPolicy: Always<br>        ports:<br>        - containerPort: ${PORT}<br><br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: backend-service<br>spec:<br>  selector:<br>    app: backend<br>  ports:<br>    - name: backend-port <br>      protocol: TCP<br>      port: ${PORT}<br>      targetPort: ${PORT}<br>  type: LoadBalancer<br>  loadBalancerIP: ${PUBLIC_IP}</pre><p>Docker file</p><pre># Specify the base image with Node.js version<br>FROM node:16.15.0<br><br># Set the working directory in the container<br>WORKDIR /app<br><br># Copy the package.json and yarn.lock files to the working directory<br>COPY package*.json yarn.lock ./<br><br># Install dependencies<br>RUN yarn install --production<br><br># Copy the rest of the application files to the working directory<br>COPY . .<br><br># Display the contents of the build context<br>RUN ls -a<br><br># Build the application<br>ARG DB_TYPE<br>ARG DB_DATABASE<br>ARG DB_HOST<br>ARG DB_USERNAME<br>ARG DB_PORT<br>ARG DB_PASSWORD<br>ARG DB_SSL_CA_CERT<br>ARG JWT_SECRET<br>ARG JWT_EXPIRES_IN<br>ARG PORT<br>ARG BE_FILE_SERVER_URL<br><br># Set environment variables<br>ENV DB_TYPE=$DB_TYPE<br>ENV DB_DATABASE=$DB_DATABASE<br>ENV DB_HOST=$DB_HOST<br>ENV DB_USERNAME=$DB_USERNAME<br>ENV DB_PORT=$DB_PORT<br>ENV DB_SSL_CA_CERT=$DB_SSL_CA_CERT<br>ENV DB_PASSWORD=$DB_PASSWORD<br>ENV JWT_SECRET=$JWT_SECRET<br>ENV JWT_EXPIRES_IN=$JWT_EXPIRES_IN<br>ENV PORT=$PORT<br>ENV BE_FILE_SERVER_URL=$BE_FILE_SERVER_URL<br><br># Build the application<br>RUN yarn build<br><br># Expose a port if your application needs to listen on a specific port<br>EXPOSE $PORT<br><br># Define the command to start your Node.js application<br>CMD [ &quot;yarn&quot;, &quot;start:prod&quot; ]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa1c847abb0f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coding-spaghetti/setting-up-servers-on-kubernetes-via-azure-fa1c847abb0f">Setting up Servers on Kubernetes via Azure</a> was originally published in <a href="https://medium.com/coding-spaghetti">coding spaghetti</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing A Styling Method with React]]></title>
            <link>https://medium.com/coding-spaghetti/choosing-a-styling-method-with-react-d8bb84ed5872?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8bb84ed5872</guid>
            <category><![CDATA[styling]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[css-modules]]></category>
            <category><![CDATA[styled-components]]></category>
            <category><![CDATA[emotions]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Wed, 30 Jan 2019 00:33:36 GMT</pubDate>
            <atom:updated>2019-01-30T00:35:27.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>Choosing A Styling Method with for my React based Design System</h3><p>There a bunch of new tools to add styles to your react component. Being relatively new to React, and getting an opportunity to create a design system, I started to scour the inter-webs for information.</p><h3>Methods to include styles:</h3><ul><li>css stylesheets (good old css, scss, sass, or less)</li><li>inline styles (css-in-js)</li><li><a href="https://github.com/css-modules/css-modules">css modules</a> (css, scss, sass, or less)</li><li>styled-components (css-in-js)</li></ul><p><em>This article does a great job of showing the differences: </em><a href="https://codeburst.io/4-four-ways-to-style-react-components-ac6f323da822"><em>Four ways to style react components</em></a></p><h3>Tools to Implement react Styling Methods:</h3><ul><li><a href="https://emotion.sh/">emotion</a></li><li><a href="https://github.com/styled-components/styled-components">Styled-components</a></li><li><a href="https://www.npmjs.com/package/classnames">classnames</a></li><li><a href="https://github.com/FormidableLabs/radium">Radium</a></li><li><a href="https://github.com/Khan/aphrodite">Aphrodite</a></li></ul><p><em>Note: these are just some of the tools out there</em></p><h3>My Design System Choice: Css Modules</h3><p>I personally opted for using <strong>css modules </strong>using scss.</p><p>Reasons included:</p><ul><li>it’s faster (see this <a href="https://medium.com/@swazza85/use-css-modules-instead-of-inlining-styles-in-react-fea247b97431">Use CSS Modules instead of inlining styles in React</a> they test the rendering of 10,000 squares)</li><li>less learning curve and abstraction</li><li>less code duplication (Generated code often create new css from merging styles to avoid naming conflicts. Traditional css just uses priority instead of generating new css for every combination use case.)</li><li>I don’t have to write css-in-js (The syntax is quite annoying, getting things like pseudo-element support sometimes isn’t supported. As well as the fact that if your IDE doesn’t have css-in-js autocomplete, it just slows you down)</li><li>it’s included in with react-create-app (see <a href="https://facebook.github.io/create-react-app/docs/adding-a-css-modules-stylesheet">here</a>)</li><li>lastly at the end of the day everything compiles down to css. By keeping things close to the basics, you know you can use the latest features. Tools might take time to be able to compile JavaScript into the new css.</li></ul><p><a href="https://medium.com/@gajus">Gajus Kuizinas</a>, the author of <a href="https://github.com/gajus/react-css-modules">react-css-modules</a> also mentions a bunch of reasons in <a href="https://medium.com/@gajus/stop-using-css-in-javascript-for-web-development-fa32fb873dcc">Stop using CSS in JavaScript for web development</a>.</p><p>At the end of the day there’s no wrong answer. If you can get a project up and running and it works for you do it.</p><p>Another thing about design systems is that your components are like a black-box. You can change the wiring from one tool set to another at anytime. If a better tool comes out, you can change to it. The users don’t care so long as it continues to work. Just make sure to test it, and not change the API for your component.</p><p>Ideally you shouldn’t need customize a design system component you imported into your code base. But that’s often not the case. Therefore, I try to design my components to be compatible with other tool sets I know we use. Ex: one project uses emotion’s css prop, therefore I made sure that the class name generated by emotion gets added to the classNames prop in the component. (note: things like position and margin should be applied to a wrapper around your component, things like style, that remain the same per use case should be coded into your design system)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8bb84ed5872" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coding-spaghetti/choosing-a-styling-method-with-react-d8bb84ed5872">Choosing A Styling Method with React</a> was originally published in <a href="https://medium.com/coding-spaghetti">coding spaghetti</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design System Advantages]]></title>
            <link>https://medium.com/coding-spaghetti/design-system-advantages-4404b407e095?source=rss-47779e69fa96------2</link>
            <guid isPermaLink="false">https://medium.com/p/4404b407e095</guid>
            <category><![CDATA[hologram]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[storybook]]></category>
            <dc:creator><![CDATA[Natalie P]]></dc:creator>
            <pubDate>Tue, 29 Jan 2019 22:34:26 GMT</pubDate>
            <atom:updated>2019-01-29T22:45:53.801Z</atom:updated>
            <content:encoded><![CDATA[<p>While working as a developer at Gap Inc. I initiated and led the first design system which was used in their point of sale system.</p><p>I learned a lot about the advantages of having a design system and recommend it for these reasons:</p><ul><li>consistency design</li><li>less code by reusing by using reusable components</li><li>consistency in code</li><li>faster development (copy-and-paste to get component look)</li><li>separation of coding design and coding implementation</li><li>easier maintenance and design updates</li></ul><p>The team I worked on consisted of mainly back-end developers who weren’t comfortable with css. By creating components, and having documentation that showed you what a component looked side-by-side with its code, it became very easy for developers to scroll through the published design system. They would find what they needed and just copy-and-paste the code. Css and styles were no longer a focus. They code focus on their strengths which was hooking up code logic.</p><p>This drastically reduced the amount of css we had. Prior to this every developer who needed a blue button coded it in their own way. The buttons never looked exactly the same. Different heights, widths, fonts, different blues were just an example of design and code inconsistencies.</p><p>Also when design wanted to change the blue used in our buttons, it only needed to be done in one place. The buttons would just inherit the change making it easier to maintain and update. Also if you tested the behavior of a button once and it worked across all your devices, you knew the tested behavior worked across all the buttons.</p><p>Another great thing about design systems, was that designers had to think through the use cases and the components they designed more. They became consolidated components so they could handle more use cases. By having less components and more consistency the user experience also became simpler.</p><p>A great video on design systems and advantages: <a href="https://www.youtube.com/watch?v=E2c183LS4lA&amp;t=598s">here</a></p><p>When I worked at the Gap we were using Angular, and I was able to use comments in our scss to create a design system that got published to github pages. I used <a href="https://github.com/trulia/hologram">hologram</a> as a tool that parsed through my scss. What was nice about this was that my documentation for my design system lived together with my code, so it was very easy to keep my documentation up-to-date with my code.</p><p>If everything in your app is in your design system, then at the end of the day, you shouldn’t have to write any custom css. If you just copy-and-paste your components, they will fall into the appropriate places. However, to start you can just aim to make your base components, the things you reuse over and over everywhere such as buttons a starting point.</p><p>Today, I’m at Creator Inc. working with a react code base and using <a href="https://storybook.js.org/">storybook</a> to create my design system. I loved this video <a href="https://www.youtube.com/watch?v=E2c183LS4lA&amp;t=598s">React Storybook Tutorial with Examples — Getting Started with React Storybook</a> posted by Fullstack Academy given by Gabrielle Sin. It goes over a lot of the advantages I spoke about and more.</p><p>There’s lots of examples of storybook design systems <a href="https://storybook.js.org/examples/">here</a>.</p><p><em>Note: storybook is compatible with non react code bases</em></p><h3>Quick Steps to Getting Design Systems</h3><ol><li>DESIGN</li></ol><ul><li>1.1 Get designs</li><li>1.2 Work with design and break things down to components, try and minimize the number of components, simplify and merge things that have similar functionality</li></ul><p>2. CODING THE DESIGN SYSTEM</p><ul><li>2.1 Choose a platform for you design system (ex: storybook, hologram…)</li><li>2.2 Code your constants/theme: colors, fonts, sizes…</li><li>2.3 Build your most basic components (ex: buttons, toggles, inputs) and add them to the design system</li><li>2.4 Build out the components that inherit other components (ex: form: which includes the button and input components) and add them to the design system</li></ul><p>3. USING IT IN YOUR CODE</p><ul><li>3.1 import your components into your project and start implementing logic</li></ul><p>Once you’ve started coding out some basic components you can start using them in your code base right away.</p><h3>Design System to Production Work Flow: What We Did in Reality</h3><ul><li>Design for the project were already made</li><li>The Product Management team wants FEATURE A out for the next iteration (JIRA tickets get made in the backlog)</li><li>We inform the design team that FEATURE A is coming up in the production pipeline</li><li>Designers start to review designs related to FEATURE A and make last minute changes (link final design specs to the JIRA tickets)</li><li>Iteration starts: components get coded in the design system code base</li><li>Designers check components once it’s coded (refine any unknown issues, and update code)</li><li>Component gets imported to project code base, hooked up, and tested</li></ul><p>A common work flow was that once we knew product management wanted a certain feature in the next few weeks, we would inform the design team.</p><p>Usually a design had been already done, but when they knew it was going to be in production soon, designers would re-review the designs in more detail and go over all edge cases. Usually there were last minute changes or new information or just visual changes they wanted.</p><p>Communicating to design early on, gave them enough time to finalize the designs, then the engineer would code the components out in the design system, review them with the designers, and the last step was to import them and hook up functionality in the project code base.</p><p>This work flow kept designers and engineers happy, because designers got the designs they wanted, and engineers rarely re-coded designs.</p><p>If any changes were made, it was done in one place, in the design system, and it just cascaded down. So long as the interface to the component didn’t change, the project code base didn’t need to change, it would just need to upload the latest design system code and it would just work. We created an npm package our of our design system. This made it was easy to import and update to the latest version.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4404b407e095" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coding-spaghetti/design-system-advantages-4404b407e095">Design System Advantages</a> was originally published in <a href="https://medium.com/coding-spaghetti">coding spaghetti</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>