<?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: Brix Mavu</title>
    <description>The latest articles on DEV Community by Brix Mavu (@brixmavu).</description>
    <link>https://dev.to/brixmavu</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%2F116311%2F047983aa-d064-46f0-b9c5-4a69a5811820.jpeg</url>
      <title>DEV Community: Brix Mavu</title>
      <link>https://dev.to/brixmavu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brixmavu"/>
    <language>en</language>
    <item>
      <title>The Battle of the Senior Dev: Why AI Gives You Wings But Only If You're Ready to Pilot</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Sat, 23 May 2026 07:19:10 +0000</pubDate>
      <link>https://dev.to/brixmavu/the-battle-of-the-senior-dev-why-ai-gives-you-wings-but-only-if-youre-ready-to-pilot-58kn</link>
      <guid>https://dev.to/brixmavu/the-battle-of-the-senior-dev-why-ai-gives-you-wings-but-only-if-youre-ready-to-pilot-58kn</guid>
      <description>&lt;p&gt;&lt;em&gt;The struggle of building solutions that actually hold up&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Forget factory tools and manufacturing jargon. The real struggle is this: AI can write code faster than you can think, but it can’t tell you what’s worth keeping. That’s where senior devs get their edge.&lt;/p&gt;

&lt;p&gt;Here’s how it works, using what actually happens in the trenches:&lt;/p&gt;




&lt;h3&gt;
  
  
  1. The Quality of Your Question Decides the Quality of Your Solution
&lt;/h3&gt;

&lt;p&gt;AI is a mirror. Ask it "my code doesn’t work" and you get garbage back. &lt;/p&gt;

&lt;p&gt;Good programmers do this instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Narrow the problem:&lt;/strong&gt; "Auth breaks after 10 min, only in Safari."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Give context:&lt;/strong&gt; Specify the framework, what you expect, and what’s actually happening.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Show what you tried:&lt;/strong&gt; "I checked the token expiry, tried &lt;code&gt;localStorage&lt;/code&gt;, but it still fails."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Share the error:&lt;/strong&gt; Paste the exact stack trace—don’t paraphrase it.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;State assumptions:&lt;/strong&gt; "I assume the session cookie is expiring."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Asking effective questions saves time, speeds up debugging, streamlines collaboration, and makes AI genuinely useful. Garbage in, garbage out. Question quality = answer quality.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Knowing When to Stop Coding Is the Real Skill
&lt;/h3&gt;

&lt;p&gt;Here’s the trap: &lt;em&gt;More code = more productivity.&lt;/em&gt; It feels true, but it’s backwards.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; More code = more maintenance. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every feature, abstraction, and layer you add is something you’ll have to debug at 2 AM six months from now. Experienced engineers know when to stop. &lt;/p&gt;

&lt;p&gt;The better solution is usually to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Remove complexity rather than adding it.&lt;/li&gt;
&lt;li&gt;  Delete logic you don't actually need.&lt;/li&gt;
&lt;li&gt;  Use a tool that already exists.&lt;/li&gt;
&lt;li&gt;  Reduce the number of moving parts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The shortest code that reliably solves the problem is almost always the easiest to maintain. Elegance isn’t about being clever; it’s about being boring in a good way.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Stay Calm When Everything’s On Fire
&lt;/h3&gt;

&lt;p&gt;Beginners panic when production goes down. They:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Change random files hoping something sticks.&lt;/li&gt;
&lt;li&gt;  Introduce three new bugs while trying to fix one.&lt;/li&gt;
&lt;li&gt;  Ignore the error message staring them in the face.&lt;/li&gt;
&lt;li&gt;  Make assumptions instead of checking facts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Skilled engineers have developed emotional discipline. Their debugging process is systematic:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Observe:&lt;/strong&gt; What exactly broke?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Reproduce:&lt;/strong&gt; Can you make it happen again locally?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Isolate:&lt;/strong&gt; What changed? Narrow down the delta.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Test assumptions:&lt;/strong&gt; Is the database actually down, or is it just the connection pool?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Verify:&lt;/strong&gt; Fix the issue, then confirm it’s actually resolved.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stress causes tunnel vision. Calm gets you to the root cause faster.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Naming Things Is Half the Job
&lt;/h3&gt;

&lt;p&gt;There’s a classic computer science joke for a reason: &lt;em&gt;"There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors."&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Hard to read, raises cognitive load&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;processThing&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good names remove confusion, cut onboarding time, reduce bugs, and save valuable mental effort:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Intent is immediately clear&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;customerProfile&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;invoiceTotal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateMonthlyRevenue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code is read 10x more than it’s written. If you can’t tell what &lt;code&gt;processThing()&lt;/code&gt; does without opening it up and reading its internals, you’ve already lost. Clear names matter more than clever algorithms.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Manage Your Energy, Not Just Your Time
&lt;/h3&gt;

&lt;p&gt;Programming is mentally expensive. You can work an 8-hour day and get absolutely nothing done if you are distracted, sleep-deprived, or context-switching every five minutes. Time management is completely useless if your brain is fried.&lt;/p&gt;

&lt;p&gt;Consider the difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Developer A:&lt;/strong&gt; Distracted, sleep-deprived, context-switching constantly. &lt;strong&gt;Result:&lt;/strong&gt; 8 hours worked, 0 progress.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Developer B:&lt;/strong&gt; Focused, rested, working in protected deep work blocks. &lt;strong&gt;Result:&lt;/strong&gt; 4 hours worked, high-quality features shipped.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Elite devs don't just manage calendars; they manage cognitive capacity. They protect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Sleep and physical health.&lt;/li&gt;
&lt;li&gt;  Focus and deep work periods.&lt;/li&gt;
&lt;li&gt;  Strategic breaks (knowing when to walk away from a screen).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Burnout destroys productivity faster than a lack of knowledge ever will. AI won’t fix this for you. If you’re fried, you'll just use AI to generate more garbage, faster.&lt;/p&gt;




&lt;h4&gt;
  
  
  💡 So How Does AI Fit Into This?
&lt;/h4&gt;

&lt;p&gt;AI gives you wings, but only if you’re already a pilot. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Use it to narrow problems:&lt;/strong&gt; &lt;em&gt;"Here’s the error, here’s what I tried, what am I missing?"&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use it to stop over-coding:&lt;/strong&gt; &lt;em&gt;"Is there a simpler way to do this?"&lt;/em&gt; Let it challenge your abstractions.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use it to stay calm:&lt;/strong&gt; Paste the error and ask, &lt;em&gt;"Walk me through debugging this step-by-step."&lt;/em&gt; Let it be the calm voice in a crisis.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use it to name things:&lt;/strong&gt; &lt;em&gt;"Give me 5 better names for this function that explain what it does."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use it to save energy:&lt;/strong&gt; Let it write the repetitive boilerplate, basic tests, and documentation so you can spend your brainpower on the hard architecture decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The struggle of creating a worthy solution isn’t writing more code. It’s knowing what to delete, when to stop, and how to think clearly when everything is broken. AI can’t do that for you. But if you’ve got those skills, AI makes you 10x faster at executing them.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Break Giant Problems Into Tiny Pieces
&lt;/h3&gt;

&lt;p&gt;Junior devs see "Build an e-commerce platform" and freeze. Experienced devs shrink the scope immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  User Authentication&lt;/li&gt;
&lt;li&gt;  Product Model &amp;amp; Schema&lt;/li&gt;
&lt;li&gt;  Cart Functionality&lt;/li&gt;
&lt;li&gt;  Payment Gateway Integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Programming is, at its core, decomposition. Huge, complex systems are just collections of tiny, solved problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With AI:&lt;/strong&gt; Don't ask it to "build me an e-commerce platform." Ask it to "write a localized cart reducer in TypeScript with unit tests." Small chunks lead to better AI output and lightning-fast feedback loops.&lt;/p&gt;




&lt;h3&gt;
  
  
  7. Understanding Human Behavior Is an Engineering Skill
&lt;/h3&gt;

&lt;p&gt;Software is built for people, but many developers only think about machines. &lt;/p&gt;

&lt;p&gt;Understanding human behavior helps you predict:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Common user mistakes.&lt;/li&gt;
&lt;li&gt;  Confusing user interfaces.&lt;/li&gt;
&lt;li&gt;  Team communication bottlenecks.&lt;/li&gt;
&lt;li&gt;  Evolving product expectations.&lt;/li&gt;
&lt;li&gt;  Customer frustrations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technical skill without human understanding creates systems that are mathematically correct but practically unusable. &lt;strong&gt;Empathy is an engineering skill.&lt;/strong&gt; AI can write code, but it can’t tell you if a user will actually find your layout intuitive. That’s on you.&lt;/p&gt;




&lt;h3&gt;
  
  
  8. Learning to Estimate Work Accurately
&lt;/h3&gt;

&lt;p&gt;New devs often say, "That feature should take about an hour." &lt;/p&gt;

&lt;p&gt;They forget that actual delivery includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Writing the code.&lt;/li&gt;
&lt;li&gt;  Debugging and local testing.&lt;/li&gt;
&lt;li&gt;  Writing unit and integration tests.&lt;/li&gt;
&lt;li&gt;  Handling unexpected edge cases.&lt;/li&gt;
&lt;li&gt;  Preparing the deployment.&lt;/li&gt;
&lt;li&gt;  Addressing pull request revisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The actual time:&lt;/strong&gt; 8 hours.&lt;/p&gt;

&lt;p&gt;Good estimation builds trust with clients, product managers, and teammates. Experienced devs always build a buffer for uncertainty because they know things always break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Tip:&lt;/strong&gt; Before committing to an estimate, ask the AI: &lt;em&gt;"What are the hidden architectural gotchas or edge cases for this feature?"&lt;/em&gt; It will frequently surface things you forgot to account for.&lt;/p&gt;




&lt;h3&gt;
  
  
  9. Write Notes for Future-You
&lt;/h3&gt;

&lt;p&gt;Memory fails. Over time, "future-you" essentially becomes a stranger.&lt;/p&gt;

&lt;p&gt;Great programmers document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Why specific tradeoffs were made.&lt;/li&gt;
&lt;li&gt;  Architectural decisions (ADRs).&lt;/li&gt;
&lt;li&gt;  Non-obvious setup steps.&lt;/li&gt;
&lt;li&gt;  Debugging discoveries.&lt;/li&gt;
&lt;li&gt;  Workarounds for unusual legacy bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don’t document your work, you will spend hours re-learning what you already figured out last month. AI can easily help with this if prompted: &lt;em&gt;"Write a README section explaining why I chose library X over library Y here."&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  10. Recognizing Patterns Is Where Speed Comes From
&lt;/h3&gt;

&lt;p&gt;Programming eventually becomes an exercise in pattern recognition. &lt;/p&gt;

&lt;p&gt;With enough years of exposure, you instantly spot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Repeated architectural smells.&lt;/li&gt;
&lt;li&gt;  Common security vulnerabilities.&lt;/li&gt;
&lt;li&gt;  Performance bottlenecks.&lt;/li&gt;
&lt;li&gt;  Recurring bugs in standard flows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn’t magic; it's accumulated experience. When you've watched twenty authentication systems break the exact same way, you can diagnose the problem in 30 seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With AI:&lt;/strong&gt; AI can generate design patterns fast, but you are the gatekeeper who must say, &lt;em&gt;"Wait, I’ve seen this pattern cause a memory leak in high-concurrency environments."&lt;/em&gt; Reading and reviewing code is now a much more critical skill than simply generating it.&lt;/p&gt;




&lt;h3&gt;
  
  
  11. Know When Not to Reinvent Everything
&lt;/h3&gt;

&lt;p&gt;Developers love to rebuild tools—sometimes for learning, but often for ego. &lt;/p&gt;

&lt;p&gt;Common traps include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Writing custom cryptographic or auth packages.&lt;/li&gt;
&lt;li&gt;  Creating a bespoke database engine.&lt;/li&gt;
&lt;li&gt;  Building a custom frontend framework for a simple landing page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While building from scratch teaches you a lot, it can also waste weeks of valuable project time. Strong engineers ask: &lt;strong&gt;"Does this need to be custom, or does a mature, tested library already exist?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because AI makes generating custom code so effortless, this question is more critical than ever. Default to proven tools unless you have a highly specific, business-critical reason not to.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The pattern here:&lt;/strong&gt; Senior devs win because they manage their mental bandwidth, break problems down, empathize with users, estimate realistically, document for the future, and avoid unnecessary work. AI amplifies these habits, but it cannot replace them.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  12. Debugging Through Elimination, Not Guessing
&lt;/h3&gt;

&lt;p&gt;Beginners debug by guessing. They think, &lt;em&gt;"Maybe it’s the database?"&lt;/em&gt; and change five different configurations. When it remains broken, they’ve only succeeded in adding chaos to the system.&lt;/p&gt;

&lt;p&gt;Effective debugging is scientific detective work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Formulate hypotheses:&lt;/strong&gt; Is the DB connection failing? Is the API payload malformed? Is local state out of sync?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Isolate and eliminate:&lt;/strong&gt; Use tests, targeted logs, or breakpoints to test each hypothesis one by one until only the true cause remains.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Systematic elimination beats random experimentation every single time. AI is a fantastic brainstorming partner here—paste your logs and ask, &lt;em&gt;"What are 5 possible causes for this error?"&lt;/em&gt;—but you must still systematically verify them.&lt;/p&gt;




&lt;h3&gt;
  
  
  13. Communication Is a Programming Skill
&lt;/h3&gt;

&lt;p&gt;Many people picture coding as a solitary activity. In reality, modern software development is deeply collaborative. &lt;/p&gt;

&lt;p&gt;You communicate constantly through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Clear Pull Request descriptions.&lt;/li&gt;
&lt;li&gt;  Well-structured technical documentation.&lt;/li&gt;
&lt;li&gt;  Active participation in meetings.&lt;/li&gt;
&lt;li&gt;  Meaningful code comments.&lt;/li&gt;
&lt;li&gt;  Constructive code reviews.&lt;/li&gt;
&lt;li&gt;  Clear issue reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A developer who can explain complex ideas clearly will almost always outperform someone who is technically brilliant but impossible to collaborate with. &lt;strong&gt;Communication scales your technical expertise.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule of thumb:&lt;/strong&gt; If you can't explain your AI-generated code in a PR, you don't actually understand it. Delete it and try again.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  14. Focus on Fundamentals over Frameworks
&lt;/h3&gt;

&lt;p&gt;Technology moves fast. Frameworks evolve, languages shift, and hyped tools can disappear overnight. If you only learn the API surface of the latest trendy library, your knowledge has an expiration date.&lt;/p&gt;

&lt;p&gt;Strong engineers focus on the underlying fundamentals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  HTTP protocols, networking, and security basics.&lt;/li&gt;
&lt;li&gt;  Data structures, system design, and algorithmic thinking.&lt;/li&gt;
&lt;li&gt;  Clean architecture principles that transcend any single language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you understand how systems work at a fundamental level, transitioning from React to Svelte, or from Node to Go, becomes a minor syntax adjustment rather than a career crisis.&lt;/p&gt;




&lt;h3&gt;
  
  
  15. Master Meta-Learning (Learning How to Learn)
&lt;/h3&gt;

&lt;p&gt;The ultimate survival skill in tech is meta-learning. Eventually, every programmer hits a wall where there is no tutorial, no StackOverflow post, and no step-by-step guide for the problem at hand.&lt;/p&gt;

&lt;p&gt;To learn efficiently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Build projects, don't just watch videos:&lt;/strong&gt; Avoid the "tutorial purgatory" trap where you feel productive but cannot write code on a blank canvas.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Experiment often:&lt;/strong&gt; Break systems on purpose to see how they fail and how they behave under stress.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Build robust mental models:&lt;/strong&gt; Understand &lt;em&gt;why&lt;/em&gt; things work, not just &lt;em&gt;how&lt;/em&gt; to copy-paste them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI changes this game entirely. You can use it to explain complex concepts, generate scaffolded practice projects, and summarize dry documentation. But remember: &lt;strong&gt;AI cannot build the mental model for you.&lt;/strong&gt; You still have to do the hard cognitive work of learning.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Thoughts: The Real Upgrade
&lt;/h3&gt;

&lt;p&gt;The biggest career upgrades rarely come from memorizing syntax. They come from these invisible habits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Thinking clearly:&lt;/strong&gt; Breaking large, scary problems down.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Communicating well:&lt;/strong&gt; Making complex ideas understandable to anyone.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Simplifying systems:&lt;/strong&gt; Removing unnecessary complexity.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Controlling emotions:&lt;/strong&gt; Staying objective and calm when production is down.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Managing energy:&lt;/strong&gt; Ruthlessly protecting your focus and cognitive capacity.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Learning continuously:&lt;/strong&gt; Adapting quickly when the technical landscape shifts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Frameworks change every few years, but these core habits remain valuable for decades. They are what separate developers who merely write code from true software engineers. &lt;/p&gt;

&lt;p&gt;AI gives you speed, but these habits give you direction. And without direction, speed just gets you lost faster.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Getting Started with Hyperswitch, Nodejs, and Express for Payment Processing</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Fri, 11 Oct 2024 19:52:44 +0000</pubDate>
      <link>https://dev.to/brixmavu/getting-started-with-hyperswitch-nodejs-and-express-for-payment-processing-i3g</link>
      <guid>https://dev.to/brixmavu/getting-started-with-hyperswitch-nodejs-and-express-for-payment-processing-i3g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome to this step-by-step tutorial on using the Hyperswitch API with Express and Node.js! In this first part, we'll walk you through creating a basic app using Node.js and Express. Later, in part two, we’ll integrate multiple payment gateways with the help of Hyperswitch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Hyperswitch?&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;Hyperswitch allows you to connect to various payment processors and payment methods, making it easier to manage transactions. Meanwhile, Node.js enables you to run JavaScript on the server side, and Express simplifies the process of building web applications and APIs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;Before we start, make sure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js installed on your system&lt;/li&gt;
&lt;li&gt;Hyperswitch API keys&lt;/li&gt;
&lt;li&gt;A text editor (I’ll be using Vim on Termux, but feel free to use your favorite editor like VS Code)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Create a "Hello World" Application
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open your terminal.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg6wxe1e3au0fo08qb2m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg6wxe1e3au0fo08qb2m.jpg" alt="new terminal" width="720" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a new folder&lt;/strong&gt; for the project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;hyperswitch
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the folder:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;hyperswitch
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Initialize a Node.js project by running:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3j4ai74g206qyw72n1de.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3j4ai74g206qyw72n1de.jpg" alt="package json" width="720" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will generate a package.json file that manages your project’s dependencies and configurations.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a server file.&lt;br&gt;
You can create it using your text editor’s UI or in the terminal:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;app.js
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Since I’m using Vim, I’ll run:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim app.js
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;and paste the &lt;a href="https://expressjs.com/en/starter/hello-world.html" rel="noopener noreferrer"&gt;"Hello World"&lt;/a&gt; code from the Express documentation:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Example app listening on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save and exit the editor (in Vim, this would be :wq).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxntdfqqlzqetyr2a7qg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxntdfqqlzqetyr2a7qg.jpg" alt="vim in termux" width="720" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Express by running:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i express
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the app and open your browser at &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;. You should see "Hello World!" displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgh7uted7by2x9z280kgb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgh7uted7by2x9z280kgb.jpg" alt="app in browser" width="720" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 2: Connecting to Hyperswitch
&lt;/h2&gt;

&lt;p&gt;Now that you have a basic app running, let’s connect it to Hyperswitch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://app.hyperswitch.io/register" rel="noopener noreferrer"&gt;Sign up for Hyperswitch&lt;/a&gt;.&lt;br&gt;
For a smoother experience, it’s best to complete the sign-up process on a desktop or laptop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get your API key from the settings. This key will allow your app to interact with the Hyperswitch API.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: For this tutorial, we’ll paste the API key directly into our code. However, this is not recommended for production environments. We’ll cover a more secure method later.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update your code to &lt;a href="https://api-reference.hyperswitch.io/api-reference/customers/customers--create" rel="noopener noreferrer"&gt;create a customer&lt;/a&gt; through Hyperswitch. Replace the previous code in app.js with the following:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="cm"&gt;/* Fetching the API key from 
Hyperswitch to create a 
customer */&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;api-key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;api-key&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;guest@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt; 
&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://sandbox.hyperswitch.io/customers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Customer creation initiated.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`App listening on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Insert your API key by replacing  with the actual key from Hyperswitch:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;api-key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;snd_xxxxxxxxxxxxx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the changes to app.js and run the server:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refresh your browser and check the terminal. You should see your first customer entry logged!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmyrh592bql0gcc26wxm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmyrh592bql0gcc26wxm.jpg" alt="first entry" width="720" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;That’s it for part one! Now you’ve created a basic Express app and connected it to Hyperswitch to create customers. In the next part, we’ll dive deeper into handling payments and managing multiple gateways.&lt;/p&gt;

&lt;p&gt;Stay tuned!&lt;/p&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>hyperswitch</category>
      <category>paymentgateways</category>
    </item>
    <item>
      <title>Setting Up Termux and Node.js on Android for Web Development</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Fri, 22 Jul 2022 20:35:27 +0000</pubDate>
      <link>https://dev.to/brixmavu/setup-android-phone-for-web-dev-iae</link>
      <guid>https://dev.to/brixmavu/setup-android-phone-for-web-dev-iae</guid>
      <description>&lt;p&gt;Want to start web development on your Android phone? This guide will show you how to use Termux and Node.js to set up a web development environment and create your first project.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 1: Install Termux and Node.js
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download &lt;a href="https://f-droid.org/en/packages/com.termux/" rel="noopener noreferrer"&gt;Termux&lt;/a&gt;&lt;br&gt;
Termux is a powerful terminal emulator for Android. Download it from F-Droid, and make sure to get the latest APK file from the bottom of the page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update Termux&lt;br&gt;
Open the Termux app and run the following commands to update the package list:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pkg update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pkg upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Git&lt;br&gt;
Git is essential for version control. Install it by running:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Vim&lt;br&gt;
Vim is a popular text editor for developers. Install it by running:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Node.js&lt;br&gt;
Node.js is a JavaScript runtime that allows you to run JavaScript outside the browser. In this tutorial, we will use Node.js to run &lt;code&gt;http-server&lt;/code&gt; , a simple tool to serve your web projects locally. To install Node.js, run the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 2: Start Your First Project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set Up Storage Access&lt;br&gt;
To access your phone’s internal storage in Termux, run:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;termux-setup-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the Internal Storage&lt;br&gt;
After running the above command, you can navigate to the storage directory by typing:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;storage/shared
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a Project Folder&lt;br&gt;
Create a new directory for your project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;project
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;project
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create Your First Files&lt;br&gt;
Now, create the HTML and CSS files for your project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;index.html style.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 3: Writing Your First HTML Page in Vim
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the HTML File in Vim&lt;br&gt;
Use Vim to open and edit your index.html file:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;vim index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add Boilerplate HTML Code&lt;br&gt;
Copy and paste the following code into index.html:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My First Heading&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;My first paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./script.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add Some Basic Styling&lt;br&gt;
Next, open the style.css file and paste this CSS code to style your HTML elements:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 4: Serve Your Project Locally
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install HTTP Server&lt;br&gt;
To preview your project, you need to use a lightweight web server. You can run one easily using npx:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;storage/shared/project
&lt;span class="nv"&gt;$ &lt;/span&gt;npx http-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access Your Website&lt;br&gt;
After running the command, Termux will display a local address (e.g., &lt;a href="http://127.0.0.1:8080" rel="noopener noreferrer"&gt;http://127.0.0.1:8080&lt;/a&gt;). Open Chrome or any web browser and paste the address into the URL bar to see your website in action.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;You’ve successfully set up your Android phone for web development and created your first project! You can now experiment and build more complex websites using this setup.&lt;/p&gt;




</description>
      <category>android</category>
      <category>webdev</category>
      <category>termux</category>
      <category>node</category>
    </item>
    <item>
      <title>Day 5</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Mon, 04 Apr 2022 21:45:41 +0000</pubDate>
      <link>https://dev.to/brixmavu/day-5-3cf6</link>
      <guid>https://dev.to/brixmavu/day-5-3cf6</guid>
      <description>&lt;p&gt;Make use of templating engine - I will use Handlebars&lt;/p&gt;

&lt;p&gt;Introduce a generated base for quick development - &lt;a href="https://expressjs.com/en/starter/generator.html"&gt;express-generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reason for express generator we can't always built things from scratch the plan is to start from a base.&lt;/p&gt;

&lt;p&gt;In terminal run&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;npx express-generator --view=hbs --git day5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd day5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If problems arise just run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm audit --force&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Start server&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can check the command in package.json&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When server is running open browser and open :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;localhost:3000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;From day4 prject copy authenticate folder and files inside public folder&lt;/p&gt;

&lt;p&gt;style.css will be replace the one in /public/stylesheets&lt;/p&gt;

&lt;p&gt;script.js goes inside /public/javascripts&lt;/p&gt;

&lt;p&gt;add script tag inside /views/layouts.hbs file &lt;/p&gt;

&lt;p&gt;Inside /views/index.hbs file add html forms from day4/index.html &lt;/p&gt;

&lt;p&gt;Inside /views/index.hbs login form tag change action tag must be &lt;code&gt;action="users/login"&lt;/code&gt;&lt;/p&gt;

</description>
      <category>expressgenerator</category>
      <category>express</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 4</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Mon, 04 Apr 2022 06:19:00 +0000</pubDate>
      <link>https://dev.to/brixmavu/day-4-1akc</link>
      <guid>https://dev.to/brixmavu/day-4-1akc</guid>
      <description>&lt;p&gt;The idea is to make a simple login with express &lt;/p&gt;

&lt;p&gt;copy day3 folder into day4 folder&lt;/p&gt;

&lt;p&gt;moving just contents from one folder into next folder in same root folder in terminal&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;cp -r folder1/* folder2&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;create folder authenticate&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mkdir authenticate&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inside authenticate folder create new file login.js&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;touch login.js&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Paste this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const login = function (user,password) {
    if(user==="brix" &amp;amp;&amp;amp; password==="brix"){
        return true;
    }
    else{
        return false;
    }

}

module.exports = login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Edit
&lt;/h3&gt;

&lt;p&gt;You have to add the two lines below to start working with json in express&lt;br&gt;
&lt;code&gt;app.use(express.json());&lt;/code&gt;&lt;br&gt;
&lt;code&gt;app.use(express.urlencoded({ extended: false }));&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;app.js should look more like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const path = require('path')
const login = require('./authenticate/login')

const app = express()
const port = 3000

app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')))

app.get('/',(req,res) =&amp;gt; {
  res.sendFile(path.join(__dirname,'public/index.html'));
})

app.post('/login', function (req, res, next) {
    const user = req.body.username
    const pass = req.body.password
    let loginResult = login(user,pass)

    if(loginResult) {
      //show main content
      res.send('Hello World Again!')
    }else{
      //show error 
    }

})

app.listen(port, () =&amp;gt; {
  console.log(`Example app listening on port ${port}`)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>express</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Day 3</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Sun, 03 Apr 2022 11:08:29 +0000</pubDate>
      <link>https://dev.to/brixmavu/day-3-4d92</link>
      <guid>https://dev.to/brixmavu/day-3-4d92</guid>
      <description>&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;NodeJS installed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  To do
&lt;/h2&gt;

&lt;p&gt;Inside Workspace folder create folder day 3&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir day3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enter day3 folder&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd day3&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Running Express
&lt;/h3&gt;

&lt;p&gt;Run commands inside terminal to install express &lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;npm init -y&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;npm i express&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;touch app.js&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;copy and paste &lt;a href="https://expressjs.com/en/starter/hello-world.html"&gt;Hello World Example&lt;/a&gt; &lt;br&gt;
inside app.js file&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) =&amp;gt; {
  res.send('Hello World!')
})

app.listen(port, () =&amp;gt; {
  console.log(`Example app listening on port ${port}`)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside your terminal type&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node app.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In browser go localhost:3000&lt;/p&gt;

&lt;h3&gt;
  
  
  Static Files e.g. html, CSS and JavaScript
&lt;/h3&gt;

&lt;p&gt;Inside day3 folder - create new folder - public&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir public&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inside public paste project files from day 2.&lt;/p&gt;

&lt;p&gt;Files &lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;index.html &lt;/li&gt;
&lt;li&gt;style.css &lt;/li&gt;
&lt;li&gt;script.js&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inside app.js remove&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get('/', (req, res) =&amp;gt; {
  res.send('Hello World!')
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const path = require('path')
app.use('/', express.static(path.join(__dirname, 'public')))

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

&lt;/div&gt;



&lt;p&gt;Learn more about &lt;a href="https://expressjs.com/en/starter/static-files.html"&gt;express.static&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code should look more like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const path = require('path')

const app = express()
const port = 3000

app.use('/', express.static(path.join(__dirname, 'public')))

app.listen(port, () =&amp;gt; {
  console.log(`Example app listening on port ${port}`)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check again localhost:3000&lt;/p&gt;

</description>
      <category>node</category>
      <category>html</category>
      <category>css</category>
      <category>express</category>
    </item>
    <item>
      <title>Day 2</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Fri, 01 Apr 2022 06:03:25 +0000</pubDate>
      <link>https://dev.to/brixmavu/day-2-2621</link>
      <guid>https://dev.to/brixmavu/day-2-2621</guid>
      <description>&lt;p&gt;I will use &lt;a href="https://scrimba.com/"&gt;Scrimba&lt;/a&gt; please check out the platform if you want to learn programing interactively.&lt;/p&gt;

&lt;p&gt;Biggest reason  of using scrimba is it make playing with code easy.&lt;/p&gt;

&lt;p&gt;Check the banner to see coding in action&lt;/p&gt;

&lt;p&gt;Day 2 code on Scrimba &lt;a href="https://scrimba.com/scrim/canvzECW"&gt;Code&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Plan
&lt;/h3&gt;

&lt;p&gt;Copy code from day 1&lt;/p&gt;

&lt;p&gt;Make login and registration toggle using js &lt;/p&gt;

&lt;p&gt;Link *.js page to the index.html file&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;script src="./*.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inside *.js file create two functions next() and prev()&lt;/p&gt;

&lt;p&gt;The idea is to toggle between login interface and registration interface&lt;/p&gt;

&lt;p&gt;By default we see login interface when click event is clicked we see registration interface&lt;/p&gt;

&lt;p&gt;Just changing CSS propeties via JavaScript&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Currently in style.css&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#registration{
   display: none
}
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;JavaScript will dynamically add css style to #login and #registration&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#login{
   display: none
}

#registration{
   display: block
}
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The inverse happens when click event is clicked again&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  JavaScript code to achieve that
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function next() {
   document.getElementById('login').style.display = "none";
   document.getElementById('registration').style.display = "block";
}
function prev() {
   document.getElementById('registration').style.display = "none";
   document.getElementById('login').style.display = "block";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;In index.html we setup for the click event on the event on a new user&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;anchor tag inside Login form  add &lt;code&gt;onclick="next()"&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You don't have an account yet? Register Here&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;anchor tag inside Registration form  add &lt;code&gt;onclick="next()"&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You have an account already? Login Here&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 1</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Thu, 31 Mar 2022 16:18:41 +0000</pubDate>
      <link>https://dev.to/brixmavu/day-1-4ij6</link>
      <guid>https://dev.to/brixmavu/day-1-4ij6</guid>
      <description>&lt;h3&gt;
  
  
  Create Login and Registration page
&lt;/h3&gt;

&lt;p&gt;Souce code can be found on &lt;a href="https://github.com/brixmavu/100-Days-of-Code/tree/main/day1"&gt;github&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Technologies used
&lt;/h3&gt;

&lt;p&gt;Bash - HTML - CSS - JavaScript&lt;/p&gt;

&lt;p&gt;Create a project folder&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mkdir project&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enter project folder&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;cd project&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Create project files&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;touch index.html style.css script.js&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From code editor explorer open index.html&lt;/p&gt;

&lt;p&gt;Inside index.html file paste Sticky Footer code from &lt;a href="https://raw.githubusercontent.com/mdn/css-examples/main/css-cookbook/sticky-footer--download.html"&gt;mdn github repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rearrange code &lt;/p&gt;

&lt;p&gt;Add new heading :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;100 days of code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Add copyright to footer&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;© 2022&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Add login and registration forms inside index.html file &lt;a href="https://gist.github.com/brixmavu/fd3ed94769a0a788bd0525ca170251ab"&gt;forms&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have added a video check the banner which is audio-less it's due to the fact it got heavy on my PC. I'm using the xbox game bar app on Windows.  The focus is to show how I went about my solution in 8 minutes &lt;a href="https://youtu.be/xajheVmU1xk"&gt;Day 1. Session 1. YouTube&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>registration</category>
      <category>login</category>
    </item>
    <item>
      <title>100 Days of Code</title>
      <dc:creator>Brix Mavu</dc:creator>
      <pubDate>Thu, 31 Mar 2022 11:48:07 +0000</pubDate>
      <link>https://dev.to/brixmavu/100-days-of-code-24i8</link>
      <guid>https://dev.to/brixmavu/100-days-of-code-24i8</guid>
      <description>&lt;p&gt;Please join me on my journey of writing code for 100 days.&lt;/p&gt;

&lt;p&gt;As this is to motivate me or someone out there, I will try my best to write simple code.&lt;/p&gt;

&lt;p&gt;These are not tutorials, it just my comeback in writing code and showing off 😂 😂 😂 .&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Simplicity is the ultimate sophistication. ― Leonardo da Vinci&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;All the code will be available on &lt;a href="https://github.com/brixmavu/100-Days-of-Code"&gt;github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Countdown
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/brixmavu/day-1-4ij6"&gt;Day 1: Login and Registration interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/brixmavu/day-2-2621"&gt;Day 2: Make interface change&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Day 3: expressjs intro
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>freestyling</category>
    </item>
  </channel>
</rss>
