<?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 Youssef El Mahallawy on Medium]]></title>
        <description><![CDATA[Stories by Youssef El Mahallawy on Medium]]></description>
        <link>https://medium.com/@youssef.elmahallawy01?source=rss-f2268447cd63------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*czB1XGLxup0IB9XWTJb2cg.jpeg</url>
            <title>Stories by Youssef El Mahallawy on Medium</title>
            <link>https://medium.com/@youssef.elmahallawy01?source=rss-f2268447cd63------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:02:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@youssef.elmahallawy01/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[The 0 to 1 story on how I sold my first website]]></title>
            <link>https://medium.com/@youssef.elmahallawy01/the-0-to-1-story-on-how-i-sold-my-first-website-6ea284ea1461?source=rss-f2268447cd63------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ea284ea1461</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[side-project]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gpt-3]]></category>
            <dc:creator><![CDATA[Youssef El Mahallawy]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 19:51:35 GMT</pubDate>
            <atom:updated>2023-03-15T19:51:35.431Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Finding a problem, building a solution, scaling it, and selling it</strong></h4><p>Selling software can be one of the most exciting yet nerve-wracking experiences a developer can go through, especially software that wasn’t fully tested before deploying.</p><p>A couple of months ago, I came across OpenAI’s API for GPT-3 and realized there were many use cases for their AI text completion model, but I had yet to find one that was worth my time and so — the search for an idea began…</p><h3>How I found the problem</h3><p>I’ve always been intrigued by indie-hacking, or even the idea of earning a living from the value created by a project rather than the number of hours you work. I figured that by following influential people in the indie-hacker space, I’d be able to identify simple projects that can be monetized without having to raise capital. So I followed <a href="https://twitter.com/levelsio?ref=levels.io">Pieter Levels</a> — who’s one of the most prominent figures in the indie-hacker space, and one of his projects actually inspired me to build <a href="https://www.validatorai.com/">Validator AI</a>.</p><h3>The Power of Reverse-Engineering</h3><p>While checking out <a href="https://levels.io/projects/">Peter’s projects</a>, I came across <a href="https://ideasai.com/">Ideas AI</a>, which I thought could help me come up with an idea. Simply, it was an AI bot that generates random business ideas that people can upvote/downvote on whether it was a good idea or not. After looking through a bunch of ideas generated by AI, I realized that AI wasn’t that good at coming up with random ideas, and I thought to myself <em>“hmm, maybe that’s just something a human might be better at”</em>. Maybe the problem is that AI is bad at generating ideas, and humans are bad at evaluating them, so what if we reversed the roles? Maybe have humans come up with ideas, and have AI evaluate them.</p><h3>Why it made sense to me</h3><p>Humans are creative, we come up with ideas every day. But sometimes creativity isn’t always the answer, some ideas are realistic, and some aren’t. When you’re the ideator, you can easily find yourself blinded by the flaws of your idea, and only see the good parts of it. Many times, validating an idea by trying it out (and failing) is expensive. So even before that, you need validation, that’s when you’d need someone to validate your idea. There are many services that allow you to validate or get opinions from mass groups of people, something like <a href="https://pollthepeople.app/">PollThePeople</a> (a service that lets you poll groups of people on ideas, logos, business names, etc.). But why pay a bunch of money (proportional to the number of people) to get the opinions of random people when we have intelligent technology? <strong>Why can’t you just use AI, which has no feelings, is unbiased, cheaper, quicker, available 24/7, and can be re-used 1000x times to validate your ideas?</strong> That’s where I came up with Validator AI; a website that uses AI to validate business ideas.</p><h3>Building the MVP (Minimum Viable Product)</h3><p>The assumption was that users heading to Validator AI already had business ideas and were looking for validation from an external source. I tried to not overthink it and get <a href="https://en.wikipedia.org/wiki/Analysis_paralysis">paralysis analysis</a>, so I decided to build out the MVP with 3 simple features: an idea criticizer, a feedback provider, and a business name suggester. The idea criticizer identifies the flaws of the idea, the feedback provider helps the user figure out how to make the idea better, and the name suggester picks a name for the business after validation. I then created the simplest version of what I thought was needed to accomplish the task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*18dREdAwOLliS6Jm.png" /></figure><h3>Launching to ProductHunt</h3><p>Once I quickly built what I considered to be the “minimum functionality” for the website, I then wrote a simple description of what it does, why I built it, and how it can be helpful in getting ideas validated. Then, on <a href="https://www.producthunt.com/products/validator-ai#validator-ai">ProductHunt</a>, I launched it and started waiting…</p><p>It’s scary — pushing out a project into the world and waiting to see if people like it or not. I’ve felt the feeling before, but it’s a new feeling every time, and I just didn’t know <em>what</em> to expect.</p><h3>The emotional roller coaster</h3><p>Hours after launching, I checked the post and noticed a lot of positive feedback which was a good indicator. However, I wasn’t able to properly quantify how well it was doing until I checked Google Analytics to view the website’s metrics. When I did, I couldn’t believe my eyes…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b1hf7VDtwOWQr6M9.png" /></figure><p>500 users on the first day, something I’ve <strong>NEVER</strong> seen or expected. I felt on top of the world! I achieved something I didn’t think was possible. I even sent the image above to myself on iMessage so I can remember this achievement forever through all my devices synced on iCloud. I was so happy that I was going to frame the image above on the wall in my room. But then…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w_sJ_1aZICm53YYC.png" /></figure><p>user acquisition rate started to flatline, not at 0, but it was less than 50% of the peak. The crazy thing is, when a project unexpectedly gains rapid traction, it’s easy to start envisioning its potential to become the next Google. So when you see a metric that doesn’t set a new record, it shatters your heart, more than it would if the project didn’t receive any users in the first place. When I saw the graph above, I started to question everything and jump to conclusions; <em>“Why is growth decreasing? What went wrong? Why don’t people like my project? How do I acquire more users without paid marketing?”.</em> I was convinced my project would soon die, and it was a quick hype run at best. All I knew is that I had to do whatever it took to get that dopamine rush back of acquiring users. So I put on my shill suit and started heading to tech communities to shill my project on people.</p><h3>The shilling starts…</h3><p>They say: <em>“Insanity is doing the same thing over and over and expecting different results”,</em> and I did indeed feel insane trying to shill the same project using the same motto expecting that the next person to hear it would magically be convinced to sign up. I created fake Reddit and HackerNews accounts to write reviews about my website being amazing in hopes that it would snowball and encourage other people to try it out (again, whatever it took to get those users).</p><p>I went so far as to write an <a href="https://medium.com/@youssef.elmahallawy01/validating-startup-ideas-using-ai-and-what-it-can-do-for-vc-firms-5506c107afdc">article</a> proposing that VCs (Venture Capitalists) embed my project on their firm’s website, enabling them to filter out startup ideas they’re interested in pursuing and boosting their firm’s visibility as a whole.</p><p>With all this shilling happening, I was distracted from checking Google Analytics until — the night of September 22nd, 2022.</p><h3>The tweet that changed it all</h3><p>I checked the graph on the night of September 22nd, and my jaw dropped to the floor. 3.1k users in one day…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W0c9V90-J9Ep7KrW.png" /></figure><p>Speechless I was, I had no idea how to react. For a second, I thought I was dreaming, I had to slap my arm to make sure I felt the pain and wasn’t in a dream. I didn’t know where all these users came from. I eventually found out that there was a pretty influential account on Twitter with over 60k followers that came across it (somehow I still don’t know how until this day) and tweeted about it. That’s where all the users came from, and that was the beginning of when things really started to take off…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IStHs_jfTp1prYJO.png" /></figure><h3>The scalability problems start</h3><p>Problems are problems, but some are good problems to have and some are bad problems to have. This was the first time I had a good problem I needed to solve, and it was about scaling the website to handle all this traffic at once. OpenAI allowed me to use their GPT3 API a limited amount of times per minute, often referred to as <a href="https://en.wikipedia.org/wiki/Rate_limiting"><em>rate-limiting</em></a>. My servers for Validator AI crashed for prolonged periods, which meant that users weren’t able to use the website without it crashing. TL;DR, to decrease the server’s downtime, I used <a href="https://vercel.com/docs/concepts/functions/edge-functions">Vercel’s Edge functions</a>. For the rate-limiting issue on OpenAI’s side, I integrated Stripe and made the AI’s responses paid, which decreased the number of users who used the website at once (unless they paid of course). As expected, the user count dropped significantly, because that’s what happens when you force users to pay for a product that was previously free. However, after that, I was able to generate revenue from the website, stop servers from crashing, prevent rate-limiting issues, and satisfy my users’ needs.</p><h3>Fast forward to the exit</h3><p>Skip a couple of months of regular operations with the steady growth of ~200 signups/day. After a while, a potential buyer comes along and is interested in acquiring it to turn it into a hub where users get help on how to start a business from A-Z. As a 20-year-old who built their first website that got a bunch of users super quickly, I was surprised but also excited to hear that someone was interested in buying it for cash. “My first exit”, a story that I will always remember and hold close to my heart. Aside from the exit and the payout, I wanted to make sure that the next person to hold my precious baby was going to take care of it and help it grow (which they’ve been doing an awesome job at so far). Once I confirmed that it was going to be taken seriously and going to receive more attention than I was able to give it, I sold it. I took the exit, holding some equity and hoping it grows to become the best it can be.</p><h3>Why I sold it</h3><p>My rationale behind selling it was this; I didn’t see a long user life cycle. It was something that people would use once or twice, maybe a couple of times, but they’d only use it as many times as they would have startup ideas. I didn’t think this was something that a user would recurringly use MANY times, therefore, I didn’t see a huge future for it. However, I still learned many things.</p><h3>Important lessons learned</h3><ol><li><strong>The idea a project starts as may not be what it continues as</strong></li></ol><ul><li>an idea can pivot many times, at first it was a business idea validator, but it could have pivoted into something with a longer user life-cycle but still similar to its original purpose</li></ul><p><strong>2. Take it slow, don’t sell right away before seeing how high the ceiling is</strong></p><ul><li>looking back, I definitely could have made a different decision (but life is about making decisions and learning from them) and took my time to see what the potential of the project was before selling it</li></ul><p><strong>3. Users are one of the most, if not, the most important asset of a project</strong></p><ul><li>once you’ve built a project and have acquired users, you’ve funneled in users that are interested in your solution. This means you’ve already caught an audience with a specific interest and can provide them with other tools based on that interest</li><li>getting users is the hardest part, but once you have a solid user base, it gets easier to provide them with other things, (e.g. business newsletter, a course, a discord community, etc.)</li></ul><h3>In conclusion</h3><p>I hope that you enjoyed my journey, how I came up with the idea, how I sold it, scaled it, and what I learned from the whole experience. If you’d like to read more blogs, make sure to subscribe for future blogs!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ea284ea1461" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Validating startup ideas using AI and what it can do for VC firms]]></title>
            <link>https://medium.com/@youssef.elmahallawy01/validating-startup-ideas-using-ai-and-what-it-can-do-for-vc-firms-5506c107afdc?source=rss-f2268447cd63------2</link>
            <guid isPermaLink="false">https://medium.com/p/5506c107afdc</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[idea-validation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[venture-capital]]></category>
            <dc:creator><![CDATA[Youssef El Mahallawy]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 19:04:35 GMT</pubDate>
            <atom:updated>2022-09-22T19:07:47.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GawTxq_h-l6BV9_qn9Od3g.png" /></figure><h3>The modern way of idea validation</h3><p>Let’s face it, startup ideas are hard to come up with, especially good ones. Even when you come up with a “good” startup idea, it’s challenging to validate your startup idea and figure out if it’s worth taking the leap of faith.</p><p>When you tell your friends you have a startup idea and pitch it to them, 9/10 times they will smile in your face and say it’s a good idea, even if it’s not. That’s because they’re your friends, and they don’t want to hurt you, especially when you’re pitching an idea that you’ve thought about over and over again.</p><p>Well, those times of receiving false hope and bad feedback is over. Humans have emotions and feel bad for criticizing sometime’s thoughts and ideas, but AI doesn’t. Being able to have something emotionless criticize your idea allows you to receive feedback that is completely objective and solely directed at the idea without any filters. The ability to strip emotions and the fear of hurting someone’s feelings allows for accurate and meaningful constructive criticism to be made.</p><h3>The new way for idea validation</h3><p>Recently, I built a website that allows you to get your business ideas validated by an AI. You can try it out <a href="https://www.validatorai.com/">here</a>.</p><p>It allows you to input a business idea and get feedback, criticism, or you can even compare two business names and it will output the better name. <a href="https://www.validatorai.com/">Validator AI</a> is a great tool for testing out different ideas without having to talk to anyone else or posting your idea on social media (because sometimes we don’t want to expose our ideas to the world OR just receive bad feedback).</p><h3>How can we apply this to the startup world?</h3><p>Usually there’s two main parties in the startup world; founders and investors. As a founder you’re able to validate your ideas that you want to pursue and get feedback on it before executing on it (obviously!). As an investor, it’s a little bit different, since you’re looking to invest in ideas (and founders).</p><p>Let’s say a VC firm were to embed Validator AI on their website’s homepage. Founders can then validate their ideas directly on their website, allowing for investors to see the ideas that founders have, along with feedback from the AI to that particular idea.</p><p>But let’s analyze this a little further and look at the pros and cons of doing so:</p><h4>Pros</h4><ul><li>Increase deal-flow for VC firms</li><li>Remove the <em>exclusivity</em> aspect of Venture Capital and allow for anyone to pitch ideas to a firm without needing a warm-intro</li><li>Allow for firms to be more public-facing</li><li>VCs are able to pick from a larger variety of ideas that interests them</li><li>VCs won’t receive pitches about ideas (which sometimes is a time-waster), and instead choose which ideas they want pitched to them</li></ul><h4>Cons</h4><ul><li>There will be many ideas for VCs to filter through</li><li>Anyone would be able to pitch ideas even if they’re not founders</li><li>VCs would see an idea and at most, a person’s LinkedIn, which may or may not be enough to want to meet the founders</li></ul><h3>So what now?</h3><p>Well for starters, if you’re a VC reading this and you haven’t tried out <a href="https://www.validatorai.com/">Validator AI</a> yet — you should play around with it and try it out with a startup idea that you’ve recently funded and see if it comes up with problems that you or your team hasn’t noticed. If you believe that Validator AI can provide value to your firm and help out with idea validation, then feel free to <a href="/service/mailto:youssef.elmahallawy01@gmail.com">email me</a> and we can chat more about it.</p><p>Aside from that, Validator AI will continue to operate autonomously and provide people with feedback on their startup ideas. In the future, there might be another feature that helps you write emails to VCs using the idea that you validated while addressing the problems with the idea and providing solutions to them. More features will be brainstormed and added overtime, so stay tuned!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ezwoH86bXdeY-IuWZ33nKg.png" /></figure><h3>Conclusion</h3><p>If you haven’t checked out <a href="https://www.validatorai.com/">Validator AI</a> already, you should try it out and test out some business ideas. With Validator AI, you’re able to validate your ideas and get feedback much quicker and better than you would traditionally.</p><p>I hope Validator AI is able to help you in your career in entrepreneurship!</p><p>Thanks for reading, feel free to connect with me on <a href="https://www.linkedin.com/in/youssefelmahallawy/">LinkedIn</a> and/or follow me on <a href="https://twitter.com/yelmahall">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5506c107afdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a simple To-do list with Next.js + Serve + PostgreSQL]]></title>
            <link>https://medium.com/@youssef.elmahallawy01/creating-simple-todo-list-with-next-js-serve-postgresql-ecf0f40de780?source=rss-f2268447cd63------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf0f40de780</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[fullstack-development]]></category>
            <dc:creator><![CDATA[Youssef El Mahallawy]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 23:08:47 GMT</pubDate>
            <atom:updated>2022-08-16T21:01:09.246Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re a full-stack developer, then you probably know dozens of API tools for building full-stack apps. In this article, we are going to be looking at <a href="https://www.withserve.com/">Serve</a>; a simple tool for powering backends. In a nutshell, it allows you to generate API endpoints by connecting to data sources and saving queries in that API. For example, you can connect to a PostgreSQL DB and save a SELECT query under an API endpoint so that when you call that API, it will fire that query and return the results.</p><p>While it’s not as feature-rich as some of the other options out there, it’s perfect for quickly creating simple apps. In this post, I’ll be showing you how to use Next.js with Serve to create a simple To-do list app.</p><h3>Step 1: Create and initialize our Next.js app with Typescript</h3><pre>npx create-next-app --example with-typescript todo-app</pre><h3>Step 2: Add packages for UI components</h3><p>We’re going to be using <a href="https://mantine.dev/">Mantine</a> as our component library and following the <a href="https://mantine.dev/guides/next/">Mantine + Next.js guide</a>:</p><pre>cd todo-app &amp;&amp; yarn add @mantine/core @mantine/hooks @mantine/next @emotion/server @emotion/react</pre><p>Create a _document.tsx file in our /pages folder and add the following code:</p><pre>import { createGetInitialProps } from &#39;@mantine/next&#39;;<br>import Document, { Head, Html, Main, NextScript } from &#39;next/document&#39;;</pre><pre>const getInitialProps = createGetInitialProps();</pre><pre>export default class _Document extends Document {<br>  static getInitialProps = getInitialProps;</pre><pre>render() {<br>    return (<br>      &lt;Html&gt;<br>        &lt;Head /&gt;<br>        &lt;body&gt;<br>          &lt;Main /&gt;<br>          &lt;NextScript /&gt;<br>        &lt;/body&gt;<br>      &lt;/Html&gt;<br>    );<br>  }<br>}</pre><p>then add the following code in _app.tsx in our /pages folder:</p><pre>import { AppProps } from &#39;next/app&#39;;<br>import Head from &#39;next/head&#39;;<br>import { MantineProvider } from &#39;@mantine/core&#39;;</pre><pre>export default function App(props: AppProps) {<br>  const { Component, pageProps } = props;</pre><pre>return (<br>    &lt;&gt;<br>      &lt;Head&gt;<br>        &lt;title&gt;Page title&lt;/title&gt;<br>        &lt;meta name=&quot;viewport&quot; content=&quot;minimum-scale=1, initial-scale=1, width=device-width&quot; /&gt;<br>      &lt;/Head&gt;</pre><pre>&lt;MantineProvider<br>        withGlobalStyles<br>        withNormalizeCSS<br>        theme={{<br>          /** Put your mantine theme override here */<br>          colorScheme: &#39;light&#39;,<br>        }}<br>      &gt;<br>        &lt;Component {...pageProps} /&gt;<br>      &lt;/MantineProvider&gt;<br>    &lt;/&gt;<br>  );<br>}</pre><p>and start the development server</p><pre>yarn dev</pre><h3>Step 3: Connect PostgreSQL database and create a workflow</h3><p>In this step, we’re going to start using the Serve interface, start by <a href="https://www.withserve.com/dashboard">making an account</a>.</p><p>In this example, we’re going to be hosting our PostgreSQL DB on <a href="https://railway.app/">Railway</a> (feel free to host it on other cloud platforms such as <a href="https://www.heroku.com/">Heroku</a> or <a href="https://postgresql.scalegrid.io/postgresql-aws?utm_term=aws%20postgresql&amp;utm_campaign=USA+-+PostgreSQL+-+August+2019&amp;utm_source=adwords&amp;utm_medium=ppc&amp;hsa_mt=e&amp;hsa_ad=374774225902&amp;hsa_net=adwords&amp;hsa_src=g&amp;hsa_kw=aws%20postgresql&amp;hsa_tgt=kwd-513396687552&amp;hsa_cam=2082980599&amp;hsa_acc=2428435206&amp;hsa_ver=3&amp;hsa_grp=77087958152">AWS</a>). Once we’ve deployed our database, we’ll want to use the database credentials and plug them in to Serve:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyWiXtMRAXZQzBrILrd_-Q.png" /><figcaption>Also integrates with MySQL, Google Sheets, Airtable and CSV files</figcaption></figure><p>After connecting our database to Serve, we’ll then <a href="https://www.withserve.com/dashboard">create a workflow</a> so we can write SQL queries and save them under API endpoints. After we’ve created a workflow and connected PostgreSQL to it, we’ll be able to use the in-app SQL text editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgOAC9EWNTT-lDfzx0s5bw.png" /><figcaption>(Displays data when making SELECT queries)</figcaption></figure><h3>Step 4: Create our table schema</h3><p>Using the SQL editor, we can create our todo table by running the following query:</p><pre>CREATE TABLE todo(<br>id text PRIMARY KEY NOT NULL,<br>task text<br>);</pre><p>After running this command, we’ll be able to see that our table was created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7eQDTui8NEqt038Hf283gQ.png" /></figure><h3>Step 5: Save some CRUD API endpoints</h3><p>In this todo app, we’re only going to be doing simple read, write, and delete operations. So we’ll write the SQL statements to achieve that and save them in Serve.</p><h4>Read (GET):</h4><p>Reading todos from our database is pretty simple—we’ll save a SELECT query and use the API it gives us to get all of our todos.</p><p>In the editor, we’ll run the following query to see our results:</p><pre>SELECT * FROM todo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khLyARSzq2jqF5-8ABlvfQ.png" /><figcaption>(Database was populated for example purposes)</figcaption></figure><p>Once we’ve run the query successfully, we’ll be able to grab our API endpoint by clicking “Open workflow configurations” and copying the URL it gives us</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8U1p_UMtNfNdrXfIIIadA.png" /></figure><p>We can test the endpoint and fetch our todos by entering it in a new tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UAm6rCHFnER4mFzfxlICQ.png" /></figure><p>and we can use this data in our code by just making a GET request to that URL.</p><h4>Write (POST):</h4><p>To write to our database, we will save an INSERT query with dynamic variables. To enable dynamic variables, we’ll go to our workflow configurations and add body parameters as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_H2koAlV5jOzBU4uKAQJow.png" /><figcaption>Can be found in the workflow configurations tab</figcaption></figure><p>We can then save our SQL query with dynamic variables by wrapping the variables in double curly brackets like so:</p><pre>INSERT INTO todo(id,task) VALUES(&#39;<strong>{{id}}</strong>&#39;,&#39;<strong>{{task}}</strong>&#39;)</pre><p>Once we’ve saved our query, we’ll be given an API endpoint that we can use in our code to fire this query:</p><pre>await fetch(&quot;https://api.withserve.com/v1/workflows/e919a348-bea9-4413-9a6a-53134f58e18f?apiKey=983b5369-1c82-4726-b368-2ca691b2705d&quot;,{ method: &quot;POST&quot;, body: JSON.stringify({ id, task })});</pre><h4>Delete (DELETE):</h4><p>When we want to delete a todo from our database, we’ll use the ID to reference it using body parameters the same way we did in our POST request:</p><pre>DELETE FROM todo WHERE id=&#39;<strong>{{id}}</strong>&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aw969Y2e-LyVOH8eMC0VRA.png" /></figure><p>and can use the URL given to us to make DELETE requests in our code.</p><h3>Step 6: Putting it all together</h3><p>We’ll create our API endpoint (/api/todos.ts) and perform different operations based on our request method. We can do this by checking the method of the request, and picking which workflow (or URL) we want to use. For example, if we have a GET request, we pick the URL that will fire off “SELECT * FROM todo” so we can fech our todos. For the POST and DELETE requests, we use the same technique:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3431bd2765e3556d00f339815f942cc0/href">https://medium.com/media/3431bd2765e3556d00f339815f942cc0/href</a></iframe><p>Our frontend will display: the todos, a button to create a todo, and a delete button to delete a todo once it’s been completed. It will call the endpoint we just created above (/api/todos.ts) like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84cbba7a85ce9dfe62d399befee36fc3/href">https://medium.com/media/84cbba7a85ce9dfe62d399befee36fc3/href</a></iframe><p>And our frontend will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p62dg-aVmTxTlyz1r9OI3g.png" /></figure><p>Feel free to check out and play around with the <a href="https://serve-todo-list-example.vercel.app/">live demo</a> yourself.</p><h3>Conclusion</h3><p>Serve allows you to power your backend with a couple of APIs. In this example we used a PostgreSQL database for our app but you can also connect MySQL, Google Sheets, Airtable and CSV files to Serve and perform CRUD on them the same way we did in this blog. It’s super quick and makes it easy to build small MVPs — and I highly suggest using it for your next project.</p><p>If you found this guide helpful, be sure to follow me and stay tuned for my future blogs. I’ll be publishing more content about software development, startups, and my learnings trying different micro projects.</p><p>Feel free to also connect with me on <a href="https://www.linkedin.com/in/youssefelmahallawy/">LinkedIn</a> and follow me on <a href="https://twitter.com/yelmahall">Twitter</a>.</p><p>Anyways, thanks for reading, happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf0f40de780" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>