<?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 Filip Huhta on Medium]]></title>
        <description><![CDATA[Stories by Filip Huhta on Medium]]></description>
        <link>https://medium.com/@filip.huhta?source=rss-17e13caf7661------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*be4EEDV1mVgxx77qXBYtfg.jpeg</url>
            <title>Stories by Filip Huhta on Medium</title>
            <link>https://medium.com/@filip.huhta?source=rss-17e13caf7661------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:08:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@filip.huhta/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[Speed up your AI development with a smarter GitHub Copilot]]></title>
            <link>https://medium.com/if-tech/speed-up-your-ai-development-with-an-smarter-github-copilot-d82ceafa7f15?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/d82ceafa7f15</guid>
            <category><![CDATA[visual-studio]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[github-copilot]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 09:28:39 GMT</pubDate>
            <atom:updated>2026-03-16T15:01:52.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="An notebook with Copilot instructions in front of a computer and a coffee mug." src="https://cdn-images-1.medium.com/max/1024/1*bkkV9ixdYzT8JyLO3qz8_A.png" /><figcaption>An notebook with Copilot instructions in front of a computer and a coffee mug.</figcaption></figure><h3>I use <strong>GitHub Copilot</strong> daily in <strong>Visual Studio</strong>.</h3><p>At first, I used it like most people do.</p><ol><li>Type something.</li><li>See what it suggests.</li><li>Accept or rewrite question.</li></ol><p>It worked. Kind of…</p><p>But it did not felt as productive as I wanted to be. Suggestions were inconsistent — sometimes solid, sometimes slightly off. Sometimes completely ignoring the architecture of the solution.</p><p>That’s when I realized something. <a href="https://github.com/features/copilot">Copilot</a> was not the problem. The problem was that I had never told Copilot how my solution is structured and how I wanted the result.</p><p>So I found out there is possibilities to create instructions for Copilot. Which makes Copilots answers more accurate and follows the standards my team wants.</p><h3>What is Copilot instructions?</h3><p>Think of Copilot instructions like a project-level system prompt for your <strong>AI assistant</strong>.</p><p>By default, Copilot is a very capable generalist. It knows a lot about many stacks, patterns etc. But it doesn’t automatically know:</p><ul><li>How you structure your repository</li><li>Your preferred architectural patterns</li><li>Your naming standards</li><li>Your opinions on testing</li><li>How you want explanations written</li></ul><p>Copilot instructions let you define that context up front.</p><p>Instead of re-explaining your preferences in every prompt. You write them once in a file. From then on, Copilot adapts its suggestions to your rules. It becomes opinionated in the same way you are.</p><p>In practical terms, it’s a way to:</p><ul><li>Enforce consistency across a codebase</li><li>Align generated code with your architecture</li><li>Make Copilot feel less generic and more like a team member who understands your standards</li></ul><p>If you’re used to working with linters, formatters, this is the same idea but for AI behavior. You’re not just configuring tooling. You’re configuring how your AI assistant thinks and responds within your project.</p><h3><strong>Explain the architecture</strong></h3><p>Instead of hoping Copilot understands the structure, I describe it to Copilot.</p><p>Now when I ask it to implement something in the codebase, it understands where the logic belongs. It stops suggesting patterns that do not fit the structure of the repository.</p><pre># Solution overview<br>This repository contains a multi-project .NET solution, including:<br><br>- `ProjectName.Web` – Blazor Server app.<br>- `ProjectName.Application` – application logic.<br>- `ProjectName.Infrastructure` – external service integrations and data access.<br>- `ProjectName.Domain` – domain models.<br>- Several test projects under `Tests\ProjectName.*.Tests` (xUnit-style) covering Application, Web, and Infrastructure layers.<br><br>The solution targets modern .NET (currently `.NET 10`).</pre><h3><strong>Lock in framework and style preferences</strong></h3><p>I make language and framework expectations that I wan’t Copilot to use.</p><pre><br>### Language and framework preferences<br><br>Prefer C# and Blazor Server patterns.</pre><p>Simple. But effective to make Copilot not hallucinate.</p><p>Copilot now defaults to C# and Blazor Server instead of suggesting other patterns that do not belong in this solution.</p><h3><strong>Testing</strong></h3><p>This is where I saw the biggest improvement.</p><p>Instead of saying write unit tests, I give it concrete rules.</p><p>Before using Copilot instructions, Copilot would sometimes use other testing frameworks, mix assertion styles, or invent patterns not used in the solution. With the instructions, it generates tests that look like they were written by someone already familiar with the codebase.</p><p>This is a completely different experience for all developers in this repository.</p><pre>## Testing<br><br>- Use **xUnit** for tests (follow the patterns in existing test projects).<br>- For new features:<br>  - Add **unit tests** to the nearest logical test project (`ProjectName.Application.Tests`, `ProjectName.Infrastructure.Tests`, etc.).<br>- Follow the Arrange–Act–Assert pattern and the existing naming conventions for test methods and classes.<br>- When possible, declare test class constants and NSubstitute service fields at the top of the class (constants first, then substitute fields), before constructors and test methods.<br>- Use **Shouldly** fluent assertions (e.g., `ShouldBe`, `ShouldThrowAsync`) for test assertions.<br>- If possible, do not use reflection; use existing internal methods in the codebase for testing.</pre><h3><strong>Tell Copilot what not to do</strong></h3><p>I explicitly tell Copilot what it should avoid. This dramatically reduces creative suggestions that technically work but violate architectural rules in the repository.</p><pre>## What Copilot should avoid<br><br>- Do not introduce new frameworks or patterns without a clear reason.<br>- Do not bypass DI. Avoid instantiating services directly where dependency injection is available.<br>- Do not hard-code culture settings or role names. Use configuration, constants, or enums where they already exist.<br>- Do not remove existing comments without a clear reason.</pre><h3><strong>Control how it responds to questions</strong></h3><p>I also define how it should tackle user prompts.</p><p>I assume the repository is the primary context. Treat open files as authoritative. Prefer focused changes. I tell Copilot to briefly explain what was changed and why it fits.</p><p>Now Copilot does not just generate code. It behaves like a developer who understands the system.</p><pre>## How to respond to user prompts<br><br>- Assume the codebase in this repository is the primary context.<br>- When a file is open or quoted, treat it as the authoritative context for style and patterns.<br>- Prefer focused changes that integrate cleanly with the existing solution.<br>- Explain briefly:<br>  - What was changed or added.<br>  - Why it fits the existing architecture or patterns.</pre><h3><strong>Lesson learnt</strong></h3><p>Copilot reflects the <strong>clarity</strong> of your instructions. If you give it vague prompts, you get <strong>generic code.</strong></p><p>If you give it<strong> architectural context,</strong> <strong>boundaries</strong>, and<strong> testing rules</strong>, you get <strong>good </strong>and <strong>aligned output.</strong></p><p>You can read more about Copilot instructions here and find more examples:</p><p><a href="https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions">How to Configure Custom Instructions</a></p><p><a href="https://medium.com/r?url=https%3A%2F%2Fgithub.com%2Fgithub%2Fawesome-copilot%2Fblob%2Fmain%2Fdocs%2FREADME.instructions.md">Other Copilot instructions examples</a></p><h3><strong>Full example file</strong></h3><p>If you want to try this yourself, place the this file in your repository at: <strong>.github/copilot-instructions.md</strong></p><p>I use <a href="https://visualstudio.microsoft.com/github-copilot/"><strong>Visual Studio</strong></a> there could be things that needs to be changed for others <strong>IDE:s.</strong></p><p>Complete file from all steps explained in this article:</p><pre># Solution overview<br>This repository contains a multi-project .NET solution, including:<br><br>- `ProjectName.Web` – Blazor Server app.<br>- `ProjectName.Application` – application logic.<br>- `ProjectName.Infrastructure` – external service integrations and data access.<br>- `ProjectName.Domain` – domain models.<br>- Several test projects under `Tests\ProjectName.*.Tests` (xUnit-style) covering Application, Web, and Infrastructure layers.<br><br>The solution targets modern .NET (currently `.NET 10`).<br><br>---<br><br>## General guidelines for GitHub Copilot<br><br>### Language and framework preferences<br><br>- Prefer **C#** and **Blazor Server** patterns.<br><br>---<br><br>## Testing<br><br>- Use **xUnit** for tests (follow the patterns in existing test projects).<br>- For new features:<br>  - Add **unit tests** to the nearest logical test project (`ProjectName.Application.Tests`, `ProjectName.Process.Tests`, `ProjectName.Infrastructure.Tests`, etc.).<br>- Follow the Arrange–Act–Assert pattern and the existing naming conventions for test methods and classes.<br>- When possible, declare test class constants and NSubstitute service fields at the top of the class (constants first, then substitute fields), before constructors and test methods.<br>- Use **Shouldly** fluent assertions (e.g., `ShouldBe`, `ShouldThrowAsync`) for test assertions.<br>- If possible, do not use reflection; use existing internal methods in the codebase for testing.<br><br>---<br><br>## What Copilot should avoid<br><br>- Do not introduce new frameworks or patterns without a clear reason.<br>- Do not bypass DI. Avoid instantiating services directly where dependency injection is available.<br>- Do not hard-code culture settings or role names. Use configuration, constants, or enums where they already exist.<br>- Do not remove existing comments without a clear reason.<br><br>---<br><br>## How to respond to user prompts<br><br>- Assume the codebase in this repository is the primary context.<br>- When a file is open or quoted, treat it as the authoritative context for style and patterns.<br>- Prefer focused changes that integrate cleanly with the existing solution.<br>- Explain briefly:<br>  - What was changed or added.<br>  - Why it fits the existing architecture or patterns.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d82ceafa7f15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/if-tech/speed-up-your-ai-development-with-an-smarter-github-copilot-d82ceafa7f15">Speed up your AI development with a smarter GitHub Copilot</a> was originally published in <a href="https://medium.com/if-tech">If Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Powered Productivity: A Developer’s favorite tools]]></title>
            <link>https://medium.com/@filip.huhta/ai-powered-productivity-a-developers-toolkit-f20da9b0f999?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/f20da9b0f999</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[bard-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[warp]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 08:10:06 GMT</pubDate>
            <atom:updated>2023-12-10T10:32:34.516Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI Powered-Productivity: A Developer’s Favorite AI Tools</h3><p>As a developer, I’m always on the lookout for new tools and technologies that can help me be more productive and efficient. I’ve found that <strong>AI tools</strong> can be an <strong>invaluable resource</strong> for developers of all skill levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3kANT13H33Qs-E_b" /><figcaption>Photo of a robot taken by <a href="https://www.pexels.com/sv-se/@agk42/">Alex Knight</a> from Pexels</figcaption></figure><h3>ChatGPT:</h3><p><a href="https://chat.openai.com/">ChatGPT</a> is a large language model chatbot developed by <a href="https://openai.com/">OpenAI</a>. It can be used for a variety of tasks, including generating text, translating languages, writing different kinds of creative content, and answering your questions in an informative way. I’ve found ChatGPT to be particularly helpful for brainstorming ideas, writing code snippets, and debugging code. ⚙️</p><p><strong>Use cases:</strong></p><ul><li>I found it useful for brainstorming ideas and generating creative text formats. ChatGPT can help developers overcome writer’s block and generate new ideas for features and code snippets.</li><li>It can also help to understand complex technical concepts by breaking them down into simpler terms and providing examples.</li><li>Debugging and identifying potential errors: ChatGPT can analyze code and identify potential bugs, syntax errors, or logical inconsistencies. It can also suggest solutions and provide explanations for the errors, helping you save time and improve your code quality. 🙌</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsLRYCBBcoHuMDbLRRQMRA.png" /><figcaption>Start a new chat with ChatGPT at the website (<a href="https://chat.openai.com/">https://chat.openai.com/</a>)</figcaption></figure><h3>Bard:</h3><p><a href="https://bard.google.com/">Bard</a> is another large language model chatbot from Google. It is similar to ChatGPT in many ways, but I’ve found Bard to be better because its connected to the internet without paying 20 USD/month like ChatGPT. I use Bard for tasks such as researching technical topics, writing documentation, and generating code documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZAYVhLVVRLPTxX1A1iHdQ.png" /><figcaption>Bard official website</figcaption></figure><h3>Warp:</h3><p><a href="https://www.warp.dev/">Warp</a> is an AI-powered terminal that can help you write cmd commands faster and more efficiently. It uses a variety of features, like an AI chat and smart completion when writing cmd commands.</p><p><strong>Use cases:</strong></p><ul><li>AI chat directly in the terminal</li><li>Utilize the search function to quickly find and navigate through previous commands and outputs.</li><li>Customize Warp’s appearance and behavior to create a personalized development environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MrMto7h-kMivwmciIVRFQ.png" /><figcaption>Warp official website</figcaption></figure><h3>Cursor:</h3><p><a href="https://cursor.sh/">Cursor</a> is an AI-powered editor. It’s an editor that works the same as Visual Studio Code but with an integrated AI chat and editing directly in the editor. 🤖</p><p><strong>Use cases:</strong></p><ul><li>Chat directly in the editor</li><li>Let AI edit your code</li><li>Generate code from scratch</li><li>Spot and fix bugs with the edit mode</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBFn6MNNU8j4Y0Hu6B5tmA.png" /><figcaption>Cursor official website</figcaption></figure><h3>OverflowAI</h3><p><a href="https://stackoverflow.co/labs"><strong>OverflowAI</strong></a> combines traditional search functionality with AI-generated responses, enabling developers to ask questions and receive detailed answers. What truly sets this AI chatbot apart, however, is the transparency and reliability it brings to the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XrFQ3CiKlSzqhcGe.png" /><figcaption>Picture of a question to Overflow AI</figcaption></figure><p>When you interact with OverflowAI, you not only receive answers but also gain insights into the sources behind those answers. This transparency, represented by a gear icon (⚙️), ensures that developers can trust the information they receive. Here’s how OverflowAI’s transparency feature transforms the developer experience.</p><p><strong>Why I use OverflowAI instead of ChatGPT and Bard sometimes:</strong></p><ul><li>Source Verification (⛓️): Every answer provided by OverflowAI is backed by its source, allowing developers to check where the information comes from. This added layer of accountability ensures the reliability of the answers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9iEOXcXs8nIiz4EC.png" /><figcaption>Picture of Overflow AI sources for a question</figcaption></figure><ul><li>Community Validation (📖): Stack Overflow is renowned for its community-driven model, where answers receive upvotes and downvotes based on their quality. <strong>OverflowAI</strong> integrates this element, guaranteeing that the answers you receive have been validated and acknowledged by the developer community.</li><li>Interactive Learning (👨‍🏫): The interactive nature of OverflowAI means you can engage in follow-up conversations with the chatbot. If the initial answer doesn’t fully address your query, you can delve deeper into the topic, ensuring you get precisely the information you need.</li><li>Quality Control (💾): OverflowAI relies on data exclusively from Stack Overflow. This ensures that inaccurate or misleading answers are systematically removed or downvoted, preventing developers from being misled by erroneous information.</li></ul><p><strong>OverflowAI</strong> effectively minimizes the common pitfalls of online information, providing developers with a trustworthy resource that caters to their specific needs. The integration of AI into <strong>Stack Overflow’s platform </strong>ensures a swift and reliable solution to coding problems, all while maintaining the <strong>highest standards of quality</strong>.</p><h3>Grammarly:</h3><p><a href="https://www.grammarly.com/">Grammarly</a> is an AI-powered grammar checker that can help you improve your writing. It can identify and correct a variety of grammatical errors, as well as suggest improvements to your writing style. I use Grammarly to check all of my writing, including my code comments and documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K26Eyjlh7bN4kqa6d97mFQ.png" /><figcaption>Grammarly official website</figcaption></figure><h3>Tabnine:</h3><p><a href="https://www.tabnine.com/">Tabnine</a> is an AI-powered code completion tool that can help you write code faster and more accurately. It uses a variety of techniques, such as machine learning and natural language processing, to predict the code that you are likely to write next. I’ve found Tabnine to be a valuable tool, especially when I’m working on a new codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3uy-TDJ7XLMmQKkHzFdKDQ.png" /><figcaption>Tabnine official website</figcaption></figure><h3>Conclusion</h3><p>AI apps are a powerful tools that can help developers be more productive and efficient. By using the right AI apps, you can save time, improve your code quality, and write more effective documentation.</p><h4>Additional Tips for Using AI Apps ✨</h4><ul><li>Start small: Don’t try to use too many AI apps at once. Start with one or two apps and gradually add more as you get comfortable with them.</li><li>Be patient: It takes time to learn how to use AI apps effectively. Don’t get discouraged if you don’t see results immediately.</li><li>Use the right tools for the job: Not all AI apps are created equal. Make sure you are using the right app for the task at hand.</li><li>Don’t be afraid to experiment: There are many different AI apps available. Don’t be afraid to try out different apps to find the ones that work best for you.</li></ul><p>I hope this post has been helpful. If you have any questions, please feel free to leave a comment below or connect with me on <a href="https://www.linkedin.com/in/filip-huhta-77b1a01a5/">LinkedIn</a> where I share developer tips and other posts.🧑‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f20da9b0f999" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why OverflowAI is better than ChatGPT?]]></title>
            <link>https://medium.com/@filip.huhta/why-overflowai-is-better-than-chatgpt-bd6dcad6f0c6?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd6dcad6f0c6</guid>
            <category><![CDATA[stackoverflow]]></category>
            <category><![CDATA[overflow-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 14:05:23 GMT</pubDate>
            <atom:updated>2023-10-30T14:05:23.911Z</atom:updated>
            <content:encoded><![CDATA[<p>In a world where technology evolves at an astonishing pace, developers are constantly in search of tools that can <strong>simplify their tasks</strong>, provide <strong>reliable information</strong>, and help them <strong>solve complex problems efficiently</strong>. <a href="https://openai.com/chatgpt">ChatGPT</a> have been the new place for developers the past year. But what will happen to <a href="https://stackoverflow.com/">Stack Overflow</a>, the go-to platform for developers seeking answers to their coding conundrums?</p><p><a href="https://stackoverflow.com/">Stack Overflow</a> has now taken a monumental step in this direction of AI with the introduction of <a href="https://stackoverflow.blog/2023/07/27/announcing-overflowai/">OverflowAI</a>, an AI-powered chatbot designed to transform the developer experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KjPQBwvYRS5anh4_Vqqjg.png" /></figure><p>Just yesterday, I had the privilege to explore the prowess of <a href="https://stackoverflow.blog/2023/07/27/announcing-overflowai/">OverflowAI</a> in Alpha version, and the experience left me truly amazed! 🤩</p><p>The chatbot leverages a blend of cutting-edge AI technology and Stack Overflow’s vast repository of developer knowledge to offer a revolutionary approach to problem-solving. Think of it as the <a href="https://openai.com/blog/chatgpt">ChatGPT</a> as I think you’re already familiar with, but with a unique twist that sets it apart from the <strong>ChatGPT</strong>.</p><p><strong>OverflowAI</strong> combines traditional search functionality with AI-generated responses, enabling developers to ask questions and receive detailed answers. What truly sets this AI chatbot apart, however, is the transparency and reliability it brings to the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlqmLETp0vR_XZs1CWNtIw.png" /></figure><h3>Transparency at its Core</h3><p>When you interact with OverflowAI, you not only receive answers but also gain insights into the sources behind those answers. This transparency, represented by a gear icon (⚙️), ensures that developers can trust the information they receive. Here’s how OverflowAI’s transparency feature transforms the developer experience:</p><ul><li>Source Verification (⛓️): Every answer provided by OverflowAI is backed by its source, allowing developers to check where the information comes from. This added layer of accountability ensures the reliability of the answers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9su7VytJxQVaobZqCgi7w.png" /></figure><ul><li>Community Validation (📖): Stack Overflow is renowned for its community-driven model, where answers receive upvotes and downvotes based on their quality. <strong>OverflowAI</strong> integrates this element, guaranteeing that the answers you receive have been validated and acknowledged by the developer community.</li><li>Interactive Learning (👨‍🏫): The interactive nature of OverflowAI means you can engage in follow-up conversations with the chatbot. If the initial answer doesn’t fully address your query, you can delve deeper into the topic, ensuring you get precisely the information you need.</li><li>Quality Control (💾): OverflowAI relies on data exclusively from Stack Overflow. This ensures that inaccurate or misleading answers are systematically removed or downvoted, preventing developers from being misled by erroneous information.</li></ul><p><strong>OverflowAI</strong> effectively minimizes the common pitfalls of online information, providing developers with a trustworthy resource that caters to their specific needs. The integration of AI into <strong>Stack Overflow’s platform </strong>ensures a swift and reliable solution to coding problems, all while maintaining the <strong>highest standards of quality</strong>.</p><p>So, have you tried OverflowAI yet? If not, you’re in for an exceptional developer experience. This game-changing AI chatbot, by seamlessly blending traditional Stack Overflow search capabilities with advanced AI, is set to revolutionize the way developers approach their work. It empowers them with reliable, community-verified answers, making it an indispensable tool for anyone in the coding world.</p><p>As we move forward in the realm of AI and developer tools, <strong>OverflowAI</strong> sets a new benchmark for <strong>innovation</strong>, <strong>transparency</strong>, and <strong>user satisfaction</strong>. The future of <strong>Stack Overflow</strong> and the<strong> developer community</strong>, with <strong>OverflowAI</strong> at its forefront, is indeed bright and promising. Get ready to supercharge your developer experience with <strong>OverflowAI</strong> and embrace the next level of coding assistance. 🚀</p><p>What’s your thoughts about OverflowAI? 🧐</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd6dcad6f0c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build and publish your first NPM package in just 5 minutes!]]></title>
            <link>https://medium.com/@filip.huhta/npm-creating-your-first-hello-world-package-81adce69a8e?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/81adce69a8e</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Sun, 20 Aug 2023 14:35:17 GMT</pubDate>
            <atom:updated>2023-10-25T06:43:46.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qEkvtjWTq-DQjBmC.jpg" /></figure><p>Do you always wonder how <a href="https://www.npmjs.com/">npm</a> works in modern web applications? Creating your own npm package is a fantastic way to learn npm contribute to the open-source community and share your code with others. In this guide, I will walk you through the process of creating your <strong>very first npm package</strong>. Don’t worry if you’re new to this — I will start with the basics and provide a step-by-step example to help you understand the process better.</p><h3>Table of contents</h3><ol><li><strong>Introduction to npm</strong></li><li><strong>Prerequisites</strong></li><li><strong>Creating your first npm package</strong></li></ol><ul><li>Setting up your project</li><li>Use ECMAScript syntax</li><li>Writing package code</li><li>Publishing to npm</li></ul><p>4.<strong> Understanding </strong><strong>package.json</strong></p><p>5.<strong> Conclusion</strong></p><p>6.<strong> Stay connected</strong></p><h3>1. Introduction to npm</h3><p><a href="http://npmjs.com/">npm</a> (Node Package Manager) is a powerful tool used by developers to manage and distribute JavaScript packages. These packages contain reusable code that can be easily shared and integrated into other projects, saving you time and effort in your development journey.</p><h3>2. Prerequisites ⚙️</h3><p>Before you begin, make sure you have <strong>Node.js</strong> and <strong>npm</strong> installed on your system. You can download them from <a href="https://nodejs.org/">here</a>.</p><h3>3. Creating your first npm package</h3><h4>Setting Up Your Project</h4><p>First, create a new directory for your project and navigate into it using your terminal of choice. I prefer to use <a href="https://www.warp.dev/">Warp</a> as my terminal which you can download <a href="https://app.warp.dev/referral/444PN">here</a>.</p><pre>mkdir my-first-npm-package<br>cd my-first-npm-package</pre><p>Initialize your project with npm:</p><pre>npm init</pre><p>You’ll be prompted to provide information about your package. You can press Enter to accept the default values or modify them according to your preferences.</p><h4>Use ECMAScript syntax</h4><p><a href="https://nodejs.org/api/modules.html#modules-commonjs-modules">CommonJS</a> syntax is the default for Node.js on <strong>npm init</strong>. If you want to use <a href="https://nodejs.org/api/esm.html#modules-ecmascript-modules">ECMAScript</a> instead you could just modify your<strong> package.json</strong> file with the attribute <a href="https://nodejs.org/api/packages.html#type"><strong>type</strong></a><strong> </strong>to<strong> </strong>which you assign the value <strong>module. </strong>Which I will use in this guide.</p><pre>// package.json<br>{<br> &quot;name&quot;: &quot;my-first-npm-package&quot;,<br> &quot;version&quot;: &quot;1.0.0&quot;,<br> &quot;description&quot;: &quot;My first npm package tutorial&quot;,<br> &quot;main&quot;: &quot;index.js&quot;,<br> &quot;type&quot;: &quot;module&quot;,<br> // ....<br>}</pre><h4>Writing package code</h4><p>Now, let’s create a simple JavaScript function that we’ll include in our package. Create a file named index.js in your project directory and add the following code:</p><pre>// index.js<br>const greet = (name) =&gt; {<br>  return `Hello world from ${name}! I have created my first npm package!`;<br>};<br><br>export { greet };</pre><blockquote>index.js is the most common root for <strong>Node.js</strong> applications and where you begin writing your code.</blockquote><h4>Publishing to npm</h4><ol><li>If you don’t have an npm account, create one at <a href="https://www.npmjs.com/signup">npmjs.com</a>.</li><li>Log in to your npm account using the terminal:</li></ol><pre>npm login</pre><p><strong>Finally, publish your package to npm:</strong></p><pre>npm publish --access public</pre><p>Congratulations! You’ve just created and published your first public npm package that anyone can install with <strong>npm install. 🌍</strong></p><pre>npm install {your package name}</pre><p>Now you can import your package in any app that uses npm like this:</p><pre>// app.js<br><br>// Import the npm package<br>import { greet } from &#39;my-first-npm-package&#39;;<br><br>// Use the greet function from the package<br>const greeting = greet(&#39;Filip&#39;);<br>console.log(greeting);<br><br>// Console message: Hello world from Filip! I have created my first npm package!</pre><h3>4. Understanding package.json</h3><p>The package.json file is a key component of any <strong>npm package</strong>. It contains metadata about your package and its dependencies.</p><p>Here’s a breakdown of some important fields in package.json:</p><pre>// package.json<br>{<br> &quot;name&quot;: &quot;my-first-npm-package&quot;,<br> &quot;version&quot;: &quot;1.0.0&quot;,<br> &quot;description&quot;: &quot;My first npm package tutorial&quot;,<br> &quot;main&quot;: &quot;index.js&quot;,<br> &quot;type&quot;: &quot;module&quot;,<br> &quot;scripts&quot;: {<br> &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;<br> },<br> &quot;repository&quot;: {<br> &quot;type&quot;: &quot;git&quot;,<br> &quot;url&quot;: &quot;my-first-npm-package&quot;<br> },<br> &quot;keywords&quot;: [<br> &quot;tutorial&quot;,<br> &quot;npm&quot;<br> ],<br> &quot;author&quot;: &quot;Filip Huhta&quot;,<br> &quot;license&quot;: &quot;ISC&quot;<br>}</pre><ul><li><strong>name:</strong> This field specifies the name of your npm package. It should be unique and follow the guidelines for package naming. In this case, the package is named “<strong>my-first-npm-package</strong>”.</li><li><strong>version: </strong>The version field indicates the current version of your package. It follows Semantic Versioning (SemVer) conventions, which consist of three numbers separated by periods (e.g., “1.0.0”). The numbers represent major, minor, and patch versions, respectively.</li><li><strong>description</strong>: Here, you provide a brief description of what your npm package does. In this example, the description is “My first npm package tutorial”.</li><li><strong>main: </strong>This field specifies the entry point of your package. When someone imports your package, the file specified in the “main” field will be loaded. In this case, “index.js” is set as the entry point.</li><li><strong>scripts:</strong> The “scripts” field allows you to define custom scripts that can be executed using the npm command line. In this example, there’s a default “test” script that outputs an error message and exits with a status code of 1, which is the default if you just click enter.</li><li><strong>repository:</strong> This field contains information about the version control repository where your package’s source code is hosted. The “type” specifies the version control system (in this case, “git”), and the “url” should provide the <strong>URL</strong> to your repository not the package name in this example.</li><li><strong>keywords:</strong> Keywords are descriptive terms used to help users discover your package when searching on npm. In this instance, the keywords “tutorial” and “npm” have I chosen.</li><li><strong>author:</strong> You can attribute the authorship of your package using this field. Here, the author is mentioned as “Filip Huhta”.</li><li><strong>license: </strong>The “license” field specifies the licensing terms for your package. Different licenses dictate how others can use and distribute your code. In this example, the “ISC” license is chosen which is the default.</li></ul><h3>5. Conclusion</h3><p>Creating your first npm package is an exciting step towards becoming a more proficient web developer and learning the npm ecosystem. By sharing your code with the community, you’re contributing to the ecosystem and gaining valuable experience. Remember, open-source development is all about collaboration and learning from one another.</p><h3>6. Stay connected</h3><p>If you found this guide helpful and want to learn more, please connect with me on <a href="https://www.linkedin.com/in/filip-huhta-77b1a01a5/">LinkedIn</a>. I regularly share coding tips, tutorials, and insights that can help you on your coding journey. Don’t hesitate to follow me for more exciting content! 💡</p><p>Now it’s your turn to create and share your npm packages. Happy coding! 👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81adce69a8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Will ChatGPT become the new StackOverflow?]]></title>
            <link>https://medium.com/@filip.huhta/will-chatgpt-replace-stack-overflow-20d8baae1230?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/20d8baae1230</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[stackoverflow]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 09:04:37 GMT</pubDate>
            <atom:updated>2023-10-25T06:51:58.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/942/0*nB7LKrMxl2ZpK-2m" /></figure><h3>Introducing ChatGPT</h3><p>For over a decade, Stack Overflow has been developers’ go-to site for questions and answers about code. In the past months, there have been tons of articles, blogs, and posts on social media talking about ChatGPT, but what is <a href="https://openai.com/blog/chatgpt">ChatGPT</a>? Let’s ask ChatGPT to explain that to us.</p><p><em>“ChatGPT is a large language model developed by OpenAI. It uses artificial intelligence algorithms to understand and generate human-like language and can be used for a variety of tasks such as language translation, text summarization, and natural language processing. Trained on a massive dataset of text from the internet, books, and other sources, ChatGPT is constantly learning and updating its knowledge. It is designed to provide accurate and helpful responses to a wide range of questions, and to engage in natural, human-like conversation with users.” </em><strong>— ChatGPT</strong> 🤖</p><p>Lately, I have started using ChatGPT for lots of my repetitive coding tasks that I would normally do, as it makes it faster and more efficient. Let’s make up an example to explain it better to you. Here I use ChatGPT to compose an HTML file based on the variables I have in my code. I also want it to translate the output text into Swedish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/0*0oCD1mOrIEXkhPPh" /></figure><p>This was the response I got from ChatGPT on the task I gave it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*rZgK4bJ_zE_nUrXo" /></figure><p>Before ChatGPT I would write this code by myself. Using AI instead of filling this in manually brings me some advantages.</p><ul><li>I don’t have to write repetitive code 💻</li><li>No typos in the variables that should match the code ✅</li><li>It goes faster than me writing the code myself 💨</li></ul><p>While ChatGPT can be a useful tool, there are some risks associated with using it, particularly for more complex coding challenges. The answers provided may not always be correct or reliable, which can lead to frustration and wasted time for developers.</p><h3>The Value of Stack Overflow</h3><p>This is where the Stack Overflow community shines. But what is <a href="https://stackoverflow.com/">Stack Overflow</a> then? Instead of me explaining what Stack Overflow is let’s make it easy for me again and ask ChatGPT how it would explain what Stack Overflow is for you.</p><p><em>“Stack Overflow is an online platform where developers can ask and answer technical questions related to programming and software development. It’s a community-driven Q&amp;A website with a reputation and gamification system, designed to help developers find answers to their technical problems and improve their skills.”</em> <strong>— ChatGPT 🤖</strong></p><p>The answers on Stack Overflow are not only provided by experts in the field but are also reviewed by the community for accuracy and reliability. This means that when you find an answer on Stack Overflow, you can have confidence in its accuracy and trust that it has been reviewed by other experienced developers. Additionally, being a part of the Stack Overflow community comes with privileges that allow you to upvote and downvote answers, edit posts, and even moderate the site. This not only encourages engagement but also provides an opportunity to give back to the community by helping to ensure the site remains a valuable and accurate resource for developers worldwide.</p><p>The passion for sharing knowledge and helping others, the vast knowledge base, and the privileges that come with being part of the Stack Overflow community make it a unique and valuable resource for developers. It’s amazing to see how quickly a question can be answered and how someone can guide us when we’re stuck. The vast repository of knowledge available on Stack Overflow has been an invaluable resource that has helped me solve countless coding challenges. It’s a tool that has allowed me to continuously learn, grow, and improve my coding skills.</p><p>So, while ChatGPT can be useful for simple and concrete coding problems, there’s nothing like Stack Overflow for more complex challenges in my opinion. With its accurate and reliable answers, vast knowledge base, and engaged community, it’s the ultimate resource for developers looking to grow and improve their coding skills.</p><p>But who knows, maybe in five years or even earlier ChatGPT will be as accurate and reliable as Stack Overflow and will also be a competitor on the more complex coding challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20d8baae1230" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Pa11y Test Server with Node.js and Express]]></title>
            <link>https://medium.com/@filip.huhta/how-to-create-a-pa11y-test-server-with-node-js-and-express-99efedfed2ec?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/99efedfed2ec</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pa11y]]></category>
            <category><![CDATA[npm]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 13:58:00 GMT</pubDate>
            <atom:updated>2023-07-05T14:15:00.407Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDsB_SCRIin3BBjLhSjk6w.png" /></figure><p>In this tutorial, we will learn how to create a simple test server using <a href="https://nodejs.org/en">Node.js</a> and <a href="https://expressjs.com/">Express </a>to run <a href="https://pa11y.org/">Pa11y</a> accessibility tests against specified URLs. Pa11y is a powerful tool for automating web accessibility testing, and this server will provide a convenient way to run the tests.</p><h3>Prerequisites</h3><p>Before we get started, make sure you have the following installed:</p><ul><li>Node.js (version 18 or above)</li><li>npm (Node Package Manager)</li></ul><p>To see if you already have <strong>Node.js</strong> and <a href="https://www.npmjs.com/"><strong>npm</strong></a> installed and check the installed version, you can run the following commands:</p><pre>node -v</pre><pre>npm -v</pre><h3>Step 1: Set Up the Project</h3><p>Create a new directory for your project and navigate into it using your preferred command-line interface. Then, initialize a new Node.js project by running the following command:</p><pre>npm init </pre><p>This will generate a package.json file for your project, which will keep track of your project&#39;s dependencies and other configuration details.</p><h3>Step 2: Install Dependencies</h3><p>We need to install the necessary dependencies for our project. In this case, we require Express, dotenv, and Pa11y. Run the following command to install these dependencies:</p><pre>npm install express dotenv pa11y</pre><p>The express package is a popular web framework for Node.js, dotenv is used to load environment variables from a .env file, and pa11y is the package we&#39;ll use to run accessibility tests.</p><h3>Step 3: Create the Server Code (index.js)</h3><p>Next, create a new file called index.js and add the following code to set up our server:</p><pre>const express = require(&quot;express&quot;);<br>const path = require(&quot;path&quot;);<br>const helpers = require(&quot;./utils/helpers&quot;);<br>const app = express();<br>const port = 3000;<br>const data = require(&quot;./data.json&quot;);<br>// Serve static files from the &#39;public&#39; directory<br>app.use(express.static(path.join(__dirname, &quot;public&quot;)));<br><br>app.get(&quot;/&quot;, async (req, res) =&gt; {<br>  const results = await helpers.runTests(data);<br>  res.write(&#39;&lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;link href=&quot;css/style.css&quot; type=&quot;text/css&quot;  rel=&quot;stylesheet&quot;&gt;&lt;/head&gt;&#39;);<br>  res.write(&#39;&lt;div&gt;&lt;h1&gt;Pa11y runned Successfully!&lt;/h1&gt; &lt;/br&gt; &lt;p&gt;Results:&lt;/p&gt;&lt;/div&gt;&#39;);<br>  if (results &amp;&amp; results.length &gt; 0) {<br>    results.forEach((r) =&gt; {<br>      res.write(helpers.generateTableMarkup(r));<br>    });<br>  }<br>  res.end();<br>});<br>app.listen(port, () =&gt; {<br>  console.log(`Pa11y Test Server app listening on port ${port}!`);<br>});</pre><p>Let’s go through the code:</p><ul><li>We import the necessary modules (express, path, and helpers) and create an instance of the Express application.</li><li>We set the port variable to 3000, but you can change it to any other available port.</li><li>We use express.static middleware to serve static files from the public directory. This is where you can place any CSS or other static assets for your server.</li><li>We define a route for the root URL (“/”) using app.get(). Inside the route handler, we call the helpers.runTests() function to run the Pa11y tests using the data from data.json.</li><li>We write the HTML markup for the results of the response (res) using res.write(). This includes a basic HTML structure and the generated table markup for each result.</li><li>Finally, we call res.end() to end the response.</li></ul><p>Now, let’s go through the specific lines of code related to the CSS file in the public directory.</p><pre>app.use(express.static(path.join(__dirname, &#39;public&#39;)));</pre><p>This line of code sets up the middleware to serve static files from the public directory. The express.static function allows us to define a static file directory, and any files inside that directory can be accessed directly through the server. In our case, we&#39;re serving files from the public directory.</p><pre>res.write(&#39;&lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;link href=&quot;css/style.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt;&lt;/head&gt;&#39;);</pre><p>This line of code is inside the route handler for the root URL (“/”). It writes an HTML string to the response, including a &lt;link&gt; tag that references the CSS file. The href attribute specifies the path to the CSS file, which is &quot;css/style.css&quot;. This path is relative to the root of the server. It assumes that the CSS file is located in the public directory.</p><p>Now, let’s look at the CSS file content located at public/css/style.css:</p><pre>table {<br>  margin: 2rem;<br>  width: 90%;<br>  border-collapse: collapse;<br>}<br>th, td {<br>  padding: 1rem;<br>  text-align: left;<br>  border-bottom: 1px solid #ddd;<br>}<br>th {<br>  font-weight: bold;<br>}<br>div {<br>  justify-content: center;<br>  align-items: center;<br>  background-color: aliceblue;<br>  display: block;<br>}<br>h1 {<br>  font-size: 3rem;<br>  padding: 2rem;<br>}<br>p {<br>  font-size: 2rem;<br>  padding-left: 2rem;<br>}</pre><p>This CSS code provides styling rules for various HTML elements. For example, it defines styles for tables, table headers (th), table cells (td), div, h1, and p elements. You can customize these styles or add more CSS rules to match your desired design.</p><p>By serving the CSS file from the public directory and linking it in the HTML response, the browser will load the CSS file and apply the defined styles to the rendered content. This allows you to control the visual appearance of your Pa11y test server page and make it more visually appealing and user-friendly.</p><h3>Step 4: Implementing the Helper Functions (helper.js)</h3><p>To enhance the functionality of the Pa11y test server, we’ll implement the helper functions in the helper.js file. These functions provide support for generating the HTML table markup and running the Pa11y tests against the specified URLs. Here&#39;s an explanation of the code:</p><pre>const dotenv = require(&#39;dotenv&#39;);<br>const pa11y = require(&#39;pa11y&#39;);<br>dotenv.config();</pre><p>In this code snippet, we import the dotenv and pa11y modules. The dotenv module is responsible for loading environment variables from a .env file, while the pa11y module is the library we use to run the accessibility tests. The dotenv.config() function is called to load the environment variables from the .env file.</p><pre>module.exports = {<br>  generateTableMarkup: function (data) {<br>    // Code to generate the table markup based on the provided data<br> let tableString = `&lt;p&gt;${data.documentTitle}&lt;/p&gt; &lt;table&gt;&lt;tr&gt;`<br>    for (let column in data[0]) {<br>      tableString += `&lt;th&gt;${column}&lt;/th&gt;`<br>    }<br>    tableString += &quot;&lt;/tr&gt;&quot;<br>    data.issues.forEach(element =&gt; {<br>      tableString += &quot;&lt;tr&gt;&quot;<br>      for (let prop in element) {<br>        tableString += `&lt;td&gt;${element[prop]}&lt;/td&gt;`<br>      }<br>      tableString += &quot;&lt;/tr&gt;&quot;<br>    });<br>    tableString += `&lt;/table&gt;`;<br>    return tableString;<br>  },<br>  runTests: async function (data) {<br>    // Code to run Pa11y tests against the provided URLs<br> try {<br>      const userLogin = `${process.env.USERNAME}:${process.env.PASSWORD}`;<br>      const encodedCredentials = new Buffer.from(userLogin).toString(&#39;base64&#39;);<br>      const options = {<br>        log: {<br>          debug: console.log,<br>          error: console.error,<br>          info: console.log<br>        },<br>        standard: &#39;WCAG2AAA&#39;,<br>        includeWarnings: true,<br>        headers: {}<br>      };<br><br>      if (data.useBasicAuth) {<br>        options.headers.Authorization = `Basic ${encodedCredentials}`;<br>      }<br>      const urlPromises = data.urls.map(url =&gt; pa11y(url, options));<br>      // Run tests against all urls<br>      const results = await Promise.all(urlPromises);<br><br>      return results;<br>    } catch (error) {<br>      // Output an error if it occurred<br>      console.error(error.message);<br><br>    }<br>  }<br>};</pre><p>In this section, we export an object containing two functions: generateTableMarkup and runTests. These functions will be utilized in the main index.js file.</p><h3>generateTableMarkup function</h3><pre>generateTableMarkup: function (data) {<br>  // Code to generate the table markup based on the provided data<br>}</pre><p>The generateTableMarkup function takes a data object as input, which contains the test results. It is responsible for generating the HTML markup for a table based on the provided data. The function starts by initializing the tableString variable with an opening &lt;p&gt; tag containing the data.documentTitle and an opening &lt;table&gt; tag. Then, it iterates over the properties of the first object in the data array using a for...in loop to generate the table header cells (&lt;th&gt;) dynamically. After that, it iterates over the data.issues array to generate the table rows (&lt;tr&gt;) and the corresponding table cells (&lt;td&gt;) by iterating over the properties of each element object. Finally, it appends the closing &lt;/table&gt; tag and returns the generated tableString.</p><h3>runTests function</h3><pre>runTests: async function (data) {<br>  // Code to run Pa11y tests against the provided URLs<br>}</pre><p>The runTests function is an asynchronous function that takes an data object as input, which contains the URLs to be tested and additional configuration settings. This function is responsible for running the Pa11y tests against the specified URLs.</p><p>Within the function, we begin by setting up the necessary variables for authentication, options, and logging. If basic authentication is enabled (data.useBasicAuth is true), we construct the basic authentication string using the USERNAME and PASSWORD environment variables. Then, we create the options object that includes the standard, includeWarnings, and headers properties. If basic authentication is enabled, we add the Authorization header to the options object.</p><p>Next, we create an array of promises (urlPromises) by mapping over the data.urls array. For each URL, we call pa11y with the URL and the options object to run the Pa11y test asynchronously. The results of all the tests are collected using Promise.all and stored in the results variable.</p><p>If any errors occur during the process, the catch block is triggered, and the error message is logged to the console using</p><h3>Step 5: Create the data.json File</h3><p>Create a new file called data.json in the project directory. This file will contain the URLs that Pa11y should run tests against. You can customize this file according to your needs. Here’s an example:</p><pre>{<br>  &quot;urls&quot;: [<br>    &quot;https://github.com&quot;,<br>    &quot;https://google.com&quot;<br>  ],<br>  &quot;useBasicAuth&quot;: false<br>}</pre><p>In this example, we have two URLs to test: GitHub (https://github.com) and Google (https://google.com). The useBasicAuth property is set to false, indicating that basic authorization is not required for these URLs. If you need to use basic authorization for any of the URLs, set useBasicAuth to true and follow the next step.</p><h3>Step 6: Configure Basic Authorization (Optional)</h3><p>If you need to use basic authorization for any of the URLs in data.json, create a new file called .env in the project root and add the following lines:</p><pre>USERNAME=example@example.com<br>PASSWORD=XXXXXXXXX</pre><p>Replace the values with your actual username and password. The .env file is used by the dotenv package to load environment variables into the application.</p><h3>Step 7: Configure the package.json File</h3><p>Open the package.json file in your project directory and make sure it includes the following configuration:</p><pre>{<br>  &quot;name&quot;: &quot;pa11y-test-server&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;description&quot;: &quot;Test URLs locally with a Pa11y Node.js server&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;start&quot;: &quot;node index.js&quot;<br>  },<br>  &quot;repository&quot;: {<br>    &quot;type&quot;: &quot;git&quot;,<br>    &quot;url&quot;: &quot;pa11y-test-server&quot;<br>  },<br>  &quot;keywords&quot;: [<br>    &quot;pa11y&quot;,<br>    &quot;accessibility&quot;,<br>    &quot;node.js&quot;,<br>    &quot;JS&quot;<br>  ],<br>  &quot;author&quot;: &quot;Your Name&quot;,<br>  &quot;license&quot;: &quot;MIT&quot;,<br>  &quot;dependencies&quot;: {<br>    &quot;dotenv&quot;: &quot;^16.3.1&quot;,<br>    &quot;express&quot;: &quot;^4.18.2&quot;,<br>    &quot;pa11y&quot;: &quot;^6.2.3&quot;<br>  }<br>}</pre><p>Here’s what each field represents:</p><ul><li>name: The name of your project.</li><li>version: The version number of your project.</li><li>description: A brief description of your project.</li><li>main: The entry point of your application (in this case, index.js).</li><li>scripts: Defines scripts that can be executed using npm. In our case, we have a &quot;start&quot; script that runs the server using node index.js.</li><li>repository: Specifies the type and URL of your project&#39;s repository.</li><li>keywords: Keywords related to your project.</li><li>author: Your name or the name of the project&#39;s author.</li><li>license: The license under which your project is distributed (e.g., MIT, GPL).</li><li>dependencies: Lists the required packages and their versions. Ensure that dotenv, express, and pa11y are included.</li></ul><h3>Step 8: Start the Server</h3><p>Now that we have completed the setup and configuration, we can start the server. Run the following command in your project directory:</p><pre>npm start</pre><p>You should see a message in the console: “Pa11y Test Server app listening on port 3000!” This indicates that the server is running successfully.</p><h3>Step 9: Test your server</h3><p>Open a web browser and visit the address where the server is running: http://localhost:3000. You should see a page displaying the results of the Pa11y tests for the specified URLs.</p><p>Congratulations! You have successfully created a <strong>Pa11y</strong> test server with <strong>Node.js</strong> and <strong>Express</strong>.</p><p>You can find the source code <a href="https://github.com/filiphuhta/pa11y-test-server">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99efedfed2ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open source — A gateway to growth for developers]]></title>
            <link>https://medium.com/@filip.huhta/open-source-a-gateway-to-growth-for-developers-1f26c195e07f?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f26c195e07f</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 06:14:22 GMT</pubDate>
            <atom:updated>2023-07-04T06:14:22.592Z</atom:updated>
            <content:encoded><![CDATA[<h3>Open source — A gateway to growth for developers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VXA5SXcB7Ns1L5JI" /></figure><p>To all the aspiring developers out there, let me share with you a remarkable path for learning and growth in the world of software development to become a valuable developer for employers: open source projects. As an experienced developer who has benefited greatly from contributing to open source, I want to highlight how this journey can pave the way for your professional development. In this post, I’ll provide valuable insights and guidance on how you can get started with open source, combining it with third-party libraries or templates to amplify your learning experience. Additionally, I’ll showcase a real example of how I contribute with a pull request for the <a href="https://github.com/shuding/nextra">Nextra repository(opens in a new tab)</a>, explaining the significance of my contribution to enhancing accessibility.</p><h3>Why open source?</h3><p>Open source projects offer opportunities for developers to gain hands-on experience and learn from experienced developers. By working on real-world projects, you’ll encounter diverse challenges, gain exposure to different coding styles and techniques, and develop a deeper understanding of software development principles. The collaborative nature of open source fosters a supportive environment, where you can seek guidance from experienced contributors and receive valuable feedback on your code.</p><h3>Finding the right project</h3><p>Selecting the right project to contribute to is crucial. In this case, let’s consider the Nextra repository — a blog template that caught my attention of me when I was searching for a good portfolio template where a blog where included. The <a href="https://nextra.site/">Nextra(opens in a new tab)</a> repository boasts an active community, comprehensive documentation, and a codebase that is approachable for developers at various skill levels. So, I started to use the template which got me familiar with the codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VhyjIsZej8yBmTzi" /></figure><h3>Unveiling issues in the codebase</h3><p>When I was more familiar with the codebase and I released my first version of my portfolio, I decided to put the Nextra template to the test using <a href="https://pagespeed.web.dev/">Google PageSpeed(opens in a new tab)</a>, with a particular focus on accessibility. Google PageSpeed is a web performance tool provided by Google that measures and analyzes the speed and optimization of a website. It provides insights and recommendations to improve the performance, accessibility, and user experience of web pages, which was perfect for my particular case. During this evaluation, I discovered issues related to insufficient contrast between the background and text colors for certain elements, such as the &lt;p&gt;, &lt;time&gt;, and &lt;span&gt; tags in light mode. Recognizing the importance of accessibility, I embarked on rectifying these issues to provide an inclusive user experience.</p><h3>Contributing to the repository: Making an impact</h3><p>Driven by a passion for inclusive design, I proactively addressed the identified accessibility concerns. My pull request entailed two significant updates — one to the navbar in nav.tsx and the other to the text content and date of the posts in posts-layout.tsx.</p><p>In nav.tsx , the navbar underwent modifications aligned with the <a href="https://www.w3.org/WAI/WCAG2AA-Conformance">WCAG 2 (AA) standard(opens in a new tab)</a>, ensuring a more accessible experience for individuals with diverse needs. By incorporating changes that provided adequate contrast between the background and text colors, the developer enhanced the usability and readability of the navbar. Moving on to posts layout.tsx, I focused on the text content and the date of the posts. My updates, again in line with the WCAG 2 (AA) standard, resulted in improved accessibility for these elements. Through my thoughtful changes, I improved the rights of all users to access information without barriers both for my website but also for everyone using this version a further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6h-t1FIe13LB_Zey" /></figure><h3>The concrete impact of your contribution and understanding of a codebase</h3><p>My pull request to the Nextra repository exemplifies the impact one can have through open source contributions. The dedication to addressing accessibility concerns not only improved my own website but also enhanced the Nextra template for a wider audience. By adhering to industry-standard guidelines, such as the WCAG 2 (AA) standard, I made a meaningful contribution to promoting inclusivity and empowering users with diverse abilities to engage with the blog template seamlessly.</p><h3>But how could this help developers then?</h3><p>During an interview for example discussing your technical skills and knowledge, it&#39;s essential to provide tangible evidence of your abilities to understand programming languages and your ability to contribute to an existing codebase. Open source contributions precisely offer that — a concrete demonstration of your expertise. By showcasing the repositories, you have contributed to, you present potential employers with real examples of your coding abilities and problem-solving capabilities.</p><p>Contributing to open source projects also requires a deep understanding of existing code bases. It will showcase your ability to navigate complex code structures, grasp project architectures, and comprehend coding styles created by other developers. This aptitude for understanding and effectively working within established code bases is highly valued in professional development environments.</p><h3>Conclusion: Unlocking your potential through open source</h3><p>As a developer, diving into the realm of open source projects can be an exhilarating and transformative experience. By selecting the right projects and combining them with third-party libraries or templates, you can accelerate your learning journey.</p><p>Open source contributions have the potential to significantly enhance your employability as a developer. By showcasing the repositories, you have contributed to, you present concrete evidence of your understanding of code bases, your ability to complement existing projects with improvements, and your aptitude for collaboration. Open source projects not only offer valuable learning experiences but also serve as a stepping stone toward a successful career in software development. So, embrace the power of open source, contribute to impactful repositories, and unlock new opportunities on your path to professional growth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f26c195e07f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why to Use Google’s PageSpeed Tool for Accessibility in Your Development Process]]></title>
            <link>https://medium.com/@filip.huhta/accessibility-is-an-essential-aspect-of-web-development-as-it-ensures-that-everyone-regardless-of-cd710576bb5d?source=rss-17e13caf7661------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd710576bb5d</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[page-speed]]></category>
            <dc:creator><![CDATA[Filip Huhta]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 11:12:17 GMT</pubDate>
            <atom:updated>2024-02-26T15:30:53.095Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMZXCrT2Ihg0it0yEBKwPA.png" /></figure><p>Accessibility is an essential aspect of web development, as it ensures that everyone, regardless of their abilities, can access and interact with digital content. To create inclusive websites, developers need to consider various accessibility guidelines and best practices. One valuable tool that can assist in this process is <a href="https://pagespeed.web.dev/">Google’s PageSpeed tool(opens in a new tab)</a>.</p><p>Google’s PageSpeed tool is primarily known for its performance optimization capabilities. It helps developers identify and improve factors that affect a website’s loading speed. However, it also provides valuable insights into accessibility issues and offers recommendations for resolving them. Here are some reasons why you should consider using PageSpeed for accessibility in your development process.</p><p><em>Be aware that PageSpeed will not pick up all of your access issues and </em><a href="https://accessibility.huit.harvard.edu/manual-testing-accessibility"><em>manual testing</em></a><em> should also be considered to catch all accessibility issues.</em></p><h3>1. Comprehensive Accessibility Audits</h3><p>PageSpeed performs thorough accessibility audits by analyzing the HTML structure, CSS, JavaScript, and other elements of your web page. It checks for common accessibility issues, such as missing alternative text for images, improper heading structures, inadequate color contrast, and more. By utilizing PageSpeed’s audits, you can quickly identify and address accessibility gaps in your website. In this case, I got a score of performance 98%, accessibility 97%, best methods 100%, and SEO 100%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*IDCPISI8yHyrLUwYT0cbKQ.png" /></figure><h3>2. Prioritized Recommendations</h3><p>After analyzing your website, PageSpeed generates a report with prioritized recommendations based on the severity and impact of each accessibility issue. This allows you to focus on high-priority items first and gradually improve the overall accessibility of your site. Prioritization helps you efficiently allocate your development resources and address critical accessibility concerns promptly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*KjI66OxjamUNJ5uAg-zWAg.png" /></figure><h3>3. Detailed Explanations and Code Examples</h3><p>PageSpeed provides detailed explanations for each accessibility issue it detects, along with code examples illustrating the problem and potential solutions. This empowers developers to understand the underlying principles behind accessibility guidelines and make informed decisions while implementing the recommended fixes. The educational aspect of PageSpeed’s recommendations can help improve developers’ overall understanding of accessibility. In this case, I needed to fix the contrast of the &lt;span&gt; element, to make the start page 100% accessible according to PageSpeed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*9pGvrWfoBxILkfmw6XMmbQ.png" /></figure><h3>4. Performance and Accessibility Synergy</h3><p>One of the notable benefits of using PageSpeed is its focus on performance optimization. Accessibility and performance often go hand in hand, as both aspects contribute to a positive user experience. By optimizing your website for accessibility, you can enhance its performance and ensure a fast, responsive, and inclusive browsing experience for all users.</p><p>In conclusion, incorporating Google’s PageSpeed tool into your development process can significantly improve the accessibility of your websites. With its comprehensive audits, prioritized recommendations, detailed explanations, integration capabilities, and performance synergy, PageSpeed provides developers with the necessary tools to create inclusive and high-performing digital experiences.</p><p>Remember, accessibility is not just a legal or moral obligation; it also makes good business sense. By ensuring that your websites are accessible to everyone, you expand your audience, enhance user satisfaction, and contribute to a more inclusive online ecosystem. So, embrace PageSpeed as a valuable ally in your quest for accessible web development and join the effort to make the web a more inclusive place for all.</p><p><em>Be aware that PageSpeed will not pick up all of your access issues.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd710576bb5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>