<?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 Arnav Goel on Medium]]></title>
        <description><![CDATA[Stories by Arnav Goel on Medium]]></description>
        <link>https://medium.com/@arnxv?source=rss-6e31110be4b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hhk8nW2NZAPSY5aH</url>
            <title>Stories by Arnav Goel on Medium</title>
            <link>https://medium.com/@arnxv?source=rss-6e31110be4b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:37:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arnxv/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[Intima: Revolutionizing Sex Education in India]]></title>
            <link>https://arnxv.medium.com/intima-revolutionizing-sex-education-in-india-9f311acbf9e7?source=rss-6e31110be4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f311acbf9e7</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[sex-education]]></category>
            <dc:creator><![CDATA[Arnav Goel]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 12:46:37 GMT</pubDate>
            <atom:updated>2023-08-21T12:46:40.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2noZDLTaCBEI7d9MaBrrw.png" /></figure><p>Intima arises as a pioneering solution in response to the prevailing societal reluctance surrounding sex education in India. This groundbreaking platform aims to tackle the urgent requirement for comprehensive and accurate sexual education. Intima recognizes that the existing sex education programs in India, such as the Adolescence Education Program, are inadequate and fail to address the needs of the young.<br> <br> Sex education is an essential component of comprehensive health education. A lack of proper sex education can have detrimental effects on an individual’s physical and mental well-being, as well as their overall quality of life. Especially in India, where sexuality is taboo, it is difficult for young people to acquire sex-related knowledge.</p><p><strong>The Need for Comprehensive Sex Education in India.</strong><br> <br> India grapples with the absence of proper sex education, resulting in a myriad of issues such as gender polarization, objectification of women, and a widespread misunderstanding of sexual health. Young people regularly resort to unreliable sources of information, leading to misconceptions and unhealthy sexual practices. It’s clear that India requires a comprehensive, accessible solution — and that’s where Intima comes in. <br> <br> <strong>Introducing Intima: Empowering Individuals with Accurate Information</strong><br> <br> Intima is a revolutionary platform for sex education, designed to empower individuals with accurate information on sex, relationships, consent, and more. Our mission is to promote healthy sexual behaviour and dismantle harmful stereotypes associated with sex in India.<br> <br> <strong>Access Accurate Information at Your Fingertips</strong><br> <br> With Intima, individuals can access accurate information on sex education at their fingertips. Our platform offers a comprehensive range of topics, including sexual anatomy, contraception methods, sexually transmitted infections, consent, and healthy relationships. By providing clear and evidence-based information, we aim to dispel myths and misconceptions surrounding sex and create an environment that fosters open and informed discussions. <br> <br> <strong>Breaking Cultural Barriers</strong><br> In a society where sexuality is often considered a taboo subject, Intima aims to break down these cultural barriers. We understand the apprehension and resistance that exist when it comes to discussing sex, especially among parents, teachers, and politicians. Intima provides a wealth of reliable information on essential topics such as safe sex practices, contraception, consent, legal implications of sexual assault, and sexually transmitted diseases (STDs). Our content is carefully curated and reviewed by experts to ensure its accuracy and reliability. With Intima, you can access trustworthy information at your fingertips, eliminating the need to rely on unreliable sources.<br> <br> <strong>Interactive Forum: A Safe Space for Questions and Guidance</strong><br> <br> In addition to our informative content, Intima features an interactive forum where users can ask questions and seek guidance from experts in the field. We believe in fostering open communication and providing a safe space for individuals to seek accurate information without fear of judgment or embarrassment. Our community of experts is dedicated to addressing your concerns and providing reliable guidance, ensuring that you make informed decisions regarding your sexual health.<br> <br> <strong>ChatGPT: Personalized Support 24/7</strong><br> <br> To enhance user experience, we’ve integrated ChatGPT, an AI-powered chatbot, into Intima. This feature ensures that users have access to reliable information whenever they need it, providing personalized support and answers to questions at any time of the day or night. Powered by OpenAI’s GPT-3.5, our ChatGPT feature offers intelligent and context-aware responses to user queries, making your experience on Intima even more valuable.<br> <br> <strong>Empowering Adolescents, Parents, Guardians, and Educators</strong><br> <br> Intima is designed to cater to a wide range of audiences, including adolescents and young adults, parents, guardians, and educators. We recognize the importance of providing accurate and comprehensive sex education to individuals of different age groups and roles. By equipping our users with the knowledge necessary to make informed decisions about their sexual health and relationships, we aim to empower and create a society that values sexual health and well-being.<br> <br><strong>The Future with Intima: Breaking Down Barriers and Empowering Individuals</strong><br> <br> Intima is not just a platform; it’s a revolution in sex education in India. By addressing the taboo nature of sex and providing a safe space for discussions, we aim to break down barriers and empower individuals with knowledge. Our goal is to create a society that embraces comprehensive sex education, where individuals are well-informed, confident, and respectful when it comes to matters of sexual health.<br> <br> <strong>Join us in Revolutionizing Sex Education in India</strong><br> <br> We invite you to join us in our journey as we revolutionize sex education in India with Intima. Your support and feedback are invaluable to us as we strive to make a difference. Together, we can build a brighter future for all, where accurate information, open communication, and understanding prevail.<br> <br> To learn more about Intima and get involved, visit our website, explore our content, and join our community. Together, let’s break the silence and foster a society that values sexual health and well-being through proper education and understanding.</p><p><a href="https://www.intima.tv/">Intima</a><br> <br> <strong>FAQs</strong></p><ul><li>Can I access Intima’s content anonymously?</li><li>Absolutely! We respect your privacy and allow anonymous access to all our content and features. We understand that privacy is crucial when it comes to sensitive topics like sexual health.</li><li>Is Intima suitable for all age groups?<br>Intima offers age-appropriate content for different target groups, ensuring that the information is relevant and tailored to the user’s needs. Whether you’re an adolescent, parent, guardian, or educator, you’ll find resources that cater to your specific requirements.</li><li>How can I contribute to Intima’s mission?<br> You can contribute to Intima’s mission by spreading awareness about the platform, sharing our content with others, and providing feedback to help us improve and reach more people. Additionally, Intima is 100% open source and privacy-friendly, so if you have expertise in sexual health, education, technology, or any related field, you can contribute by sharing your knowledge, insights, and ideas.</li></ul><p><a href="https://github.com/arncv/Intima">Source Repo</a> <br> <br> Remember, your sexual health matters, and Intima is here to empower you with accurate information and support. Together, let’s break the silence surrounding sex education and foster a society that embraces comprehensive knowledge and understanding.</p><p><strong>References</strong></p><p>Bhagawati, P… (2020, July 5). Awareness and attitude towards reproductive and sexual health rights and practices among college students: An empirical study. <a href="https://scite.ai/reports/10.17485/ijst/v13i25.911">https://scite.ai/reports/10.17485/ijst/v13i25.911</a><br> Teens aren’t receiving enough sex education, study says. (n.d). <a href="https://www.washingtonpost.com/health/sex-education-teens/2021/11/26/c005d154-4c98-11ec-b73b-a00d6e559a6e_story.html">https://www.washingtonpost.com/health/sex-education-teens/2021/11/26/c005d154-4c98-11ec-b73b-a00d6e559a6e_story.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f311acbf9e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why GitLab is the secret weapon for optimizing your development workflow.]]></title>
            <link>https://arnxv.medium.com/why-gitlab-is-the-secret-weapon-for-optimizing-your-development-workflow-73cb2965b17b?source=rss-6e31110be4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/73cb2965b17b</guid>
            <dc:creator><![CDATA[Arnav Goel]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 21:09:30 GMT</pubDate>
            <atom:updated>2023-07-29T21:09:30.522Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of software development, there are a lot of tools and platforms that can help you optimize your workflow. However, one platform that stands out from the rest is GitLab. GitLab is a complete DevOps platform that enables teams to collaborate more effectively and efficiently. In this blog post, we will explore why GitLab is such a powerful tool for developers.</p><h3>What is GitLab?</h3><p>GitLab is an open-source Git repository manager that provides a complete DevOps platform. GitLab offers a wide range of features including source code management, continuous integration and deployment (CI/CD), issue tracking, code review, and more. GitLab provides a comprehensive solution for managing and automating your software development process from start to finish.</p><h3>Well, why GitLab?</h3><p>GitLab offers some compelling features that make it a powerful tool for software development teams, such as:</p><h3>1. Centralized Platform for Collaboration</h3><p>One of the main benefits of GitLab is that it provides a centralized platform for collaboration. With GitLab, you can manage all aspects of your software development process from a single platform. This means that all team members can work together in the same environment, eliminating the need to switch between multiple tools.</p><h3>2. Integrated CI/CD Pipeline</h3><p>GitLab’s integrated CI/CD pipeline is another reason why it is a secret weapon for optimizing your development workflow. The CI/CD pipeline automates the build, test, and deployment process, allowing you to release code faster and with greater confidence. With GitLab, you can easily define your pipeline, customize it to your needs, and track your progress throughout the process.</p><h3>3. Code Review and Collaboration</h3><p>GitLab provides a built-in code review system that enables teams to collaborate on code changes. With GitLab’s code review system, you can create merge requests, assign them to team members, and track progress through the review process. This helps ensure that code changes are thoroughly reviewed and tested before they are merged into the main branch.</p><h3>4. Issue Tracking and Management</h3><p>GitLab also provides a comprehensive issue tracking system that enables teams to manage and track issues throughout the development process. With GitLab’s issue tracking system, you can create and assign issues, track progress, and prioritize tasks. This helps ensure that issues are resolved in a timely and efficient manner.</p><h3>5. Customizable and Extensible</h3><p>GitLab is highly customizable and extensible, making it easy to tailor it to your specific needs. GitLab’s open-source nature means that you can customize it to fit your workflows and integrate it with other tools in your development stack. This flexibility enables you to optimize your development workflow and improve your team’s productivity.</p><h3>How is it different from GitHub?</h3><p>While both GitLab and GitHub are popular tools for managing source code repositories, there are a few key differences that make GitLab a better option for some development teams.</p><p>Firstly, GitLab is an all-in-one platform for managing the entire DevOps workflow, while GitHub focuses more on source code management. GitLab offers built-in CI/CD, container registry, issue tracking, wikis, and discussions, making it a more comprehensive solution than GitHub.</p><p>Secondly, GitLab offers better collaboration features than GitHub, with built-in code review tools and issue tracking that supports group conversations, making it easier for developers to communicate and collaborate on projects.</p><p>Thirdly, GitLab includes built-in security scanning tools and access controls that can help ensure the security and compliance of code, while GitHub offers fewer security features.</p><p>Finally, GitLab is more customizable and extensible than GitHub, making it easier to tailor the platform to the specific needs of a development team. GitLab is built on an open-source platform, which means that developers can modify the code to meet their specific needs, while GitHub does not offer the same level of customization.</p><h3>Conclusion:</h3><p>GitLab is a versatile platform that can benefit any software development team. With its all-in-one approach, integrated CI/CD pipeline, built-in code review, issue tracking and management, and customizable features, GitLab is a secret weapon for optimizing your development workflow. GitLab’s scalability, security features, and open-source nature make it a suitable platform for organizations of all sizes, from small startups to large enterprises. By leveraging GitLab, development teams can streamline their workflow, reduce costs, and deliver high-quality software faster. So, if you’re looking for a comprehensive DevOps tool to take your development process to the next level, GitLab is the perfect choice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73cb2965b17b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build A Time Tracker Web App Integrated with Courier API for Effortless Notification Management]]></title>
            <link>https://arnxv.medium.com/build-a-time-tracker-web-app-integrated-with-courier-api-for-effortless-notification-management-f5684d0c1ec9?source=rss-6e31110be4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5684d0c1ec9</guid>
            <dc:creator><![CDATA[Arnav Goel]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 21:04:14 GMT</pubDate>
            <atom:updated>2023-07-29T21:04:14.540Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://dev.to/t/courierapi">#courierapi</a> <a href="https://dev.to/t/hackathon">#hackathon</a> <a href="https://dev.to/t/productivity">#productivity</a> <a href="https://dev.to/t/node">#node</a></p><h3>Background</h3><p>PowerNap is a simple and elegant time tracker web application that allows users to set up a timer for their power nap sessions. The application was built to help individuals improve their productivity by incorporating short naps into their work routine.For this project, we utilized Node.js and Express.js for the backend and vanilla JS, HTML and CSS for frontend development respectively. We also integrated <a href="https://courier.com/">Courier API</a> to enable the app to send push notifications to users.</p><p>We chose to use Node.js for its efficient and lightweight nature, which makes it perfect for building scalable applications.For the frontend, We chose to use vanilla JavaScript because it’s lightweight, fast, and compatible with all major browsers along with CSS Finally, We incorporated the Courier API to send notifications to users in real-time, which enhances the user experience and improves productivity.</p><h3>Instructions</h3><h3>Part 1: Building the Frontend</h3><p>Building the frontend of PowerNap is a simple process that involves defining the HTML structure, styling the timer using CSS, and implementing the JavaScript code. We will go through each step in detail below.</p><ol><li><strong>Defining the HTML structure:</strong></li></ol><p>To build the frontend of PowerNap, we first need to define the HTML structure. We’ll create a div to hold the timer, a button to start the timer, another div to hold the music player and an audio element to play a sound when the timer is up.</p><pre>&lt;div class=&quot;timer-container&quot;&gt;<br>   &lt;div class=&quot;clock&quot;&gt;25:00&lt;/div&gt;<br>    &lt;div class=&quot;buttons&quot;&gt;<br>    &lt;button class=&quot;start&quot;&gt;Start&lt;/button&gt;<br>    &lt;/div&gt;<br>   &lt;/div&gt;<br>   &lt;div class=&quot;music-container&quot;&gt;<br>   &lt;audio id=&quot;audio&quot; src=&quot;lofi-music.mp3&quot;&gt;&lt;/audio&gt;<br>   &lt;/div&gt;</pre><h3>The UI consists of two main sections:</h3><h4>Timer container:</h4><p>This section contains the timer display and a start button. It has a class of “timer-container” for styling purposes.<br> div tag with class clock: This is where the countdown timer will be displayed. It starts with a default value of “25:00”.<br> div tag with class buttons: This is where the start button is located.</p><h4>Music container:</h4><p>This section contains an audio player to play background music during the Pomodoro. It has a class of “music-container” for styling purposes.<br> audio tag with id audio: This is where the audio file is linked. The audio file is called “lofi-music.mp3” and it is located in the same directory as the HTML file.</p><ol><li><strong>Implementing the JavaScript code</strong></li></ol><p>First, we need to select the HTML elements that we will be working with using the querySelector method. We will also create some variables that we will be using later on:</p><pre>const element = document.querySelector(&#39;.clock&#39;);<br>   const startBtn = document.querySelector(&#39;.start&#39;);<br>   const audio = document.querySelector(&#39;#audio&#39;);</pre><pre>   const timer = {<br>   pomodoro: 1500,<br>   shortBreak: 300,<br>   longBreak: 900<br>   };<br>   let countdown;<br>   let paused = false;</pre><p>Next, we will create a function updateClock that will take care of updating the clock display. We will convert the time in seconds to minutes and seconds and display it in the clock element.</p><pre>function updateClock() {<br>   let min = Math.floor(time / 60);<br>   let sec = time - min * 60;<br>   min = min &lt; 10 ? `0${min}` : min;<br>   sec = sec &lt; 10 ? `0${sec}` : sec;<br>   element.textContent = `${min}:${sec}`;<br>   }</pre><p>We will also create a function playSound that will play a sound when the timer reaches zero.</p><pre>function playSound() {<br>   audio.play();<br>   }</pre><p>Next, we will create a function updateTimer that will take care of updating the timer. We will use the setInterval method to update the clock every second.</p><pre>const updateTimer = () =&gt; {<br>   timer[mode] = timeRemaining--;<br>   if (timer[mode] === 0) {<br>      handleTimerEnd();<br>      return;<br>   }<br>   updateClock(timeRemaining);<br>   updatePomodoroProgress();<br>   };</pre><p>Now, we will create the main function startTimer that will take care of starting the timer. We will use the setInterval method to update the clock every second.</p><pre>const startTimer = () =&gt; {<br>   timeRemaining = timer[mode];<br>   if (pause) {<br>      updateTimer();<br>      pause = false;<br>   }<br>   pomodoroInterval = setInterval(updateTimer, 1000);<br>   controlBtn.dataset.action = &#39;pause&#39;;<br>   controlBtn.textContent = &#39;pause&#39;;<br>   };</pre><p>Finally, we will add an event listener to the start button that will call the startTimer function when clicked.</p><pre>controlBtn.addEventListener(&#39;click&#39;, e =&gt; {<br>   const action = e.target.dataset.action;<br>   if (action === &#39;start&#39;) {<br>      startTimer();</pre><pre>   } else {<br>      stopTimer();<br>      pause = true;<br>   }<br>   });</pre><p>And the basic functionality of the timer is complete! You can check out the final code <a href="https://github.com/arncv/PowerNap/blob/main/public/script.js">here</a>.</p><ol><li><strong>Styling the timer using CSS</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*kHGASfRdlCou07bY" /></figure><p>Using CSS, we can build beautiful and functional UI design for a Pomodoro timer and a music player. The design features a calming blue gradient background, and the typography is set in the Lato font family.</p><p>PowerNap includes a menu with buttons for setting the timer length and selecting the type of session, as well as a progress bar that displays the remaining time. The timer is contained within a circular container, and the countdown clock is prominently displayed in the center.</p><p>The music player has a sleek and modern design, with an album cover image that rotates on hover. The player includes buttons for play, pause, and skip, as well as a progress bar that displays the current position within the song. Additional information about the currently playing song is displayed in a hidden overlay that appears when the player is active.</p><h3>Part 2: Backend using Node.js and Express.js</h3><p>In order to create a full-fledged web application, we need a backend that can handle server-side logic, database operations, and external API integrations. For this purpose, we will be using Node.js and Express.js.</p><p><strong>Why?</strong></p><ul><li>Node.js is a runtime environment for executing JavaScript code outside of a web browser. It is built on top of the Google Chrome V8 engine, which makes it highly performant and scalable.</li><li>Express.js is a popular web framework for Node.js that provides a simple and flexible API for building web applications.</li></ul><p><strong>Setting up the project</strong></p><p>First, we need to create a new directory for our project and initialize it as a Node.js project. We will also install the Express.js framework,body-parser middleware that parses incoming request bodies, node-fetch library to fetch HTTP requests and dotenv to store environment variables(very important for privacy.. shh!).</p><pre>mkdir PowerNap<br>   cd PowerNap<br>   npm init -y<br>   npm install express<br>   npm install body-parser node-fetch dotenv</pre><p>Next, we will create a new file called server.js and add the following code to it:</p><pre>const express = require(&quot;express&quot;);<br>   const bodyParser = require(&quot;body-parser&quot;);<br>   const app = express();</pre><pre>   app.use(bodyParser.json());</pre><p>In the code above, we imported express and body-parser and created an instance of the express application. We then used app.use() to configure body-parser middleware to parse incoming requests with JSON payloads. This will allow us to easily access the JSON data sent in the request body.</p><p><strong>Static Files:</strong></p><p>Next, we need to serve the static files for our webapp. To do this, we will create a public directory in the root directory of our project and place all the static files inside it. Then, we can use the express.static middleware to serve the static files:</p><pre>app.use(express.static(&quot;public&quot;));</pre><p><strong>Routes:</strong></p><p>Now, we need to define the routes for our webapp. We will define a single route that returns the index.html file when a GET request is made to the root URL:</p><pre>const path = require(&quot;path&quot;);</pre><pre>   app.get(&quot;/&quot;, (req, res) =&gt; {<br>   res.sendFile(path.join(__dirname, &quot;public&quot;, &quot;index.html&quot;));<br>   });</pre><p>In the code above, we imported the path module and used the path.join() method to join the current directory name, public, and index.html to form the path to the index.html file.</p><p><strong>Starting the Server:</strong></p><p>Finally, we need to start the server by listening on a port. We can do this by calling the listen method on the app object:</p><pre>app.listen(3000, () =&gt; {<br>   console.log(&#39;Server is listening on port 3000&#39;)<br>   })</pre><p>In this part, we created the backend for our PowerNap webapp using Node.js and Express.js. We defined routes to serve the static files and added rate limiting to prevent abuse of our webapp. In the next part, we will add the Courier API to send notifications to the user.</p><h3>Part 3: Integrating the Courier API</h3><p>Here comes the juicy part. We will be using the Courier API to send notifications to the user. The Courier API is a powerful and flexible API that allows you to send notifications to your users via SMS, email, push notifications, and more.</p><p><strong>First things first:</strong></p><ol><li>Create a free account on <a href="https://app.courier.com/signup">Courier</a>.</li><li>Create a new workspace. You can name it anything you want.</li><li>For the onboarding process, select the email channel aand let Courier build with Node.js.</li><li>Copy the starter code, which is a basic API call using cURL, and paste it in the a new terminal. It has your API key saved already, knows which email address you want to send to, and has a message already built in.</li><li>Once you can see the dancing pigeon on the website, you are ready to use Courier.</li></ol><p>Now that you’ve set up your account, let’s get started with the integration.</p><p>Create a new file named .env in the root directory of your project. Add your Courier API key, email, phone number, and the message you want to send as environment variables in this file. Your .env file should look something like this:</p><pre>APIKEY=&lt;your_courier_api_key&gt;<br>EMAIL=&lt;your_email&gt;<br>PHONENUMBER=&lt;your_phone_number&gt;<br>MESSAGE=&lt;your_message&gt;</pre><p>Use the dotenv package to load the environment variables from the .env file.</p><pre>require(&quot;dotenv&quot;).config();</pre><p>Create a function named send_message that will send a notification to your email and phone number using the Courier API.</p><pre>async function send_message() {<br>      const message = process.env.MESSAGE;<br>      console.log(&quot;Notification Successfully sent!&quot;)</pre><pre>    const courier_options = {<br>        method: &#39;POST&#39;,<br>        headers: {<br>          Accept: &#39;application/json&#39;,<br>          &#39;Content-Type&#39;: &#39;application/json&#39;,<br>          Authorization: &#39;Bearer &#39; + process.env.APIKEY<br>        },<br>        body: JSON.stringify({<br>          &quot;message&quot;: {<br>            &quot;to&quot;: {<br>              &quot;email&quot;: process.env.EMAIL,<br>              &quot;phone_number&quot;: process.env.PHONENUMBER<br>            },<br>            &quot;content&quot;: {<br>              &quot;title&quot;: &quot;Time to Wake Up!&quot;,<br>              &quot;body&quot;: message<br>            },<br>            &quot;routing&quot;: {<br>              &quot;method&quot;: &quot;all&quot;,<br>              &quot;channels&quot;: [&quot;sms&quot;,&quot;email&quot;]<br>            },<br>          }<br>        })<br>      };</pre><pre>      fetch(&#39;https://api.courier.com/send&#39;, courier_options)<br>        .then(response =&gt; response.json())<br>        .then(response =&gt; console.log(response))<br>        .catch(err =&gt; console.error(err));</pre><pre>}</pre><p>This is the send_message function which uses the Courier API to send a message to the specified email and phone number with the message defined in the .env file. Here’s how it works:</p><ol><li>The function gets the message from the .env file using process.env.MESSAGE and sends it via Courier API to the specified email and phone number.</li><li>The courier_options object is defined, which includes the necessary headers for the API call and the JSON body with the recipient email and phone number, message content, and routing information.</li><li>The fetch function is called with the API URL and courier_options.</li></ol><p>Now that we have defined the send_message function, we need to call it when the timer ends.</p><p>In the script.js file, add the following code to the handleTimerEnd function:</p><pre>fetch(&#39;/send-message&#39;, {<br>    method: &#39;POST&#39;,<br>    headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br>    body: JSON.stringify({ data: &#39;message&#39; })<br>  }).then(response =&gt; response.json())<br>  .then(data =&gt; {<br>    console.log(data);<br>  })<br>  .catch(error =&gt; {<br>    console.error(&#39;Error:&#39;, error);<br>  });<br>   send_message();</pre><p>This code sends a POST request to the /send-message endpoint with a JSON body containing a single property data with the value ‘message’. We then parse the JSON response and log it to the console.</p><p>In the server.js file, add the following code to the bottom of the file:</p><pre>app.post(&#39;/send-message&#39;, (req, res) =&gt; {<br>  send_message();<br>  res.json({ message: &#39;message sent&#39; });<br>});</pre><p>This code defines a POST request handler for the /send-message endpoint. It calls the send_message function and sends a JSON response with a message property.</p><p>Now, when the timer ends, the send_message function will be called and a notification will be sent to the user.</p><h3>Starting the Server</h3><p>Finally, we need to start the server by listening on a port.</p><pre>node server.js</pre><p>When the timer ends, the send_message function will be called and a notification will be sent to the user. The notification will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*POSCiaqfI4aG7zvs.png" /></figure><p>and we will get the confirmation message in the terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*xLsgpJf-vubfTrGe.png" /></figure><p>Sweet! We have successfully built a webapp that sends a notification to the user when the timer ends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*yf_2YLlcQraMXGBG.gif" /></figure><h3>Conclusions</h3><p>In this project, we have built a web application called “PowerNap” using HTML, CSS, JavaScript, Node.js, and Express.js. We have also integrated the Courier API to send notification messages to the user. The application allows the user to set a timer for a short nap, and when the time is up, they will receive a notification message reminding them to wake up.</p><p>In the future, We plan to add more features to this project such as allowing the user to set a timer of their choice.</p><p>We encourage you to try building this project on your own and see how it works. Don’t forget to tag us at <a href="https://twitter.com/arnvgl/">@arnvgl</a> when you do! We would love to see your version of this project.</p><h3>About the Author</h3><p>Arnav Goel is a developer from New Delhi, India. Currently a sophomore at MSIT, Delhi, He is passionate about building products that make a positive impact on people’s lives. All things technology fascinate him, and he loves to learn new things. He is also a huge hip-hop fan and loves to play chess.</p><h3>Quick Links</h3><p>🔗 <a href="https://www.courier.com/docs/reference/send/message/">Courier Docs</a></p><p>🔗 <a href="https://www.courier.com/docs/guides/getting-started/nodejs/">Courier Get Started with Node.js</a></p><p>🔗 <a href="https://expressjs.com/">Express.js</a></p><p>🔗 <a href="https://nodejs.org/en/">Node.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5684d0c1ec9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>