<?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 Ozan Batuhan Ceylan on Medium]]></title>
        <description><![CDATA[Stories by Ozan Batuhan Ceylan on Medium]]></description>
        <link>https://medium.com/@obceylan?source=rss-6c36762bab29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dobtFgvHdSyt6LZz.jpeg</url>
            <title>Stories by Ozan Batuhan Ceylan on Medium</title>
            <link>https://medium.com/@obceylan?source=rss-6c36762bab29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 11:50:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@obceylan/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[React Code Smells: 5 Tiny Patterns That Blow Up Your App Later]]></title>
            <link>https://obceylan.medium.com/react-code-smells-5-tiny-patterns-that-blow-up-your-app-later-7a0eb5fdecfe?source=rss-6c36762bab29------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a0eb5fdecfe</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Ozan Batuhan Ceylan]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 10:21:39 GMT</pubDate>
            <atom:updated>2025-08-06T10:21:39.185Z</atom:updated>
            <content:encoded><![CDATA[<p>It always starts the same way.</p><p>You’re building a component. It’s a small feature. Maybe a modal, a form, a list. You write it fast, ship it faster. Everything works. You move on.</p><p>A few weeks later, you’re back.<br> Nothing’s technically “broken,” but something feels… off.</p><p>The logic is tangled. The UI is buggy in weird ways.<br> You try to refactor it and realize: <em>“What the hell was I thinking?”</em></p><p>Congratulations. You’ve just met a <strong>frontend smell</strong>.</p><h4>Wait! What’s a “smell”?</h4><p>A smell is not a bug. It’s worse.<br> It’s a <strong>tiny design flaw</strong> that:</p><ul><li>feels harmless at first,</li><li>slowly spreads,</li><li>and eventually makes your codebase hard to maintain, scale, or even read.</li></ul><p>Frontend smells aren’t always obvious. They hide inside reusable components, inline styles, overused state, and clever-looking hacks that come back to bite you.</p><h4>Who is this for?</h4><p>This post is for frontend developers who:</p><ul><li>build fast,</li><li>care about clean code (but don’t always have the time),</li><li>and want to avoid long-term pain.</li></ul><p>If you’ve ever said:</p><blockquote><em>“I’ll clean this up later.”<br> or<br> “It’s just one component, no big deal.”<br> This post is especially for you.</em></blockquote><h4>TL;DR</h4><p>Your frontend code may start clean, but small bad habits quickly snowball into big problems. This post covers 5 common frontend code smells — from inline functions and overused global state to magic strings — explaining why they cause trouble and how to replace them with cleaner, more maintainable patterns. If you’re a fast-moving junior dev or anyone who cares about code quality, this guide will help you avoid future headaches and write smarter code today.</p><h4>Let’s talk about 5 innocent-looking patterns</h4><p>Each of these smells is small.<br>They’re not dramatic. They won’t throw errors.<br>But if you don’t catch them early, they’ll rot your code from the inside out.</p><p>Let’s start with one of the most common culprits:</p><h3>Smell #1 — Anonymous Functions Everywhere</h3><blockquote>“Inline everything. What could possibly go wrong?”</blockquote><h4>The Smell</h4><p>Inline arrow functions inside JSX are incredibly common:</p><pre>&lt;button onClick={() =&gt; doSomething()}&gt;Click me&lt;/button&gt;</pre><p>Looks clean. One-liner. Easy to write.</p><p><strong>But here’s the catch</strong>: every time your component re-renders, that function is re-created from scratch. And if you’re passing it to child components, they also re-render — even if nothing else changed.</p><h4>Why It’s a Problem</h4><ul><li><strong>Breaks memoization</strong> — Tools like React.memo, useMemo, and useCallback become ineffective because the reference keeps changing.</li><li><strong>Causes unnecessary re-renders</strong> — Especially dangerous in large lists or deeply nested UIs.</li><li><strong>Hides logic</strong> — JSX becomes cluttered with logic that should live elsewhere.</li></ul><h4>Bad Example — Inline Handler in a List</h4><pre>function UserList({ users }) {<br>  return (<br>    &lt;ul&gt;<br>      {users.map(user =&gt; (<br>        &lt;li key={user.id}&gt;<br>          {user.name}<br>          &lt;button onClick={() =&gt; alert(user.name)}&gt;Show Name&lt;/button&gt;<br>        &lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}</pre><p>Everything works… until your list gets longer, or you wrap UserListItem in React.memo.<br> Now every list item <strong>re-renders unnecessarily</strong> — because that inline onClick is always a <strong>new function</strong>.</p><h4>Better Example — Extract the Handler</h4><pre>function UserList({ users }) {<br>  const handleShowName = (name) =&gt; () =&gt; {<br>    alert(name);<br>  };<br>  return (<br>    &lt;ul&gt;<br>      {users.map(user =&gt; (<br>        &lt;li key={user.id}&gt;<br>          {user.name}<br>          &lt;button onClick={handleShowName(user.name)}&gt;Show Name&lt;/button&gt;<br>        &lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}</pre><p>This small change:</p><ul><li>Makes your handler function <strong>stable</strong></li><li>Enables <strong>React.memo</strong> to do its job</li><li>Keeps JSX <strong>clean and focused on structure</strong></li></ul><h4>Bonus: useCallback When Needed</h4><p>If handleShowName itself is passed down as a prop or used across renders, wrap it with useCallback:</p><pre>const handleShowName = useCallback((name) =&gt; () =&gt; {<br>  alert(name);<br>}, []);</pre><p>That ensures the function reference <strong>doesn’t change between renders</strong>, which is especially helpful in complex UIs or performance-critical components.</p><h4>The Takeaway</h4><p>Inline functions feel fast and simple — but they silently ruin performance and scalability.<br>Get into the habit of <strong>lifting logic out of JSX</strong> early. Your future self (and your teammates) will thank you.</p><h3>Smell #2 — The Reusable-But-Not-Really Component</h3><blockquote>“It’s reusable… if you don’t mind 12 props and 8 conditional classNames.”</blockquote><h4>The Smell</h4><p>You build a component with reuse in mind. Let’s say a Button.<br> It starts simple. Then someone asks for a new color. Then a size. Then loading state.<br> Before you know it:</p><pre>&lt;Button<br>  variant=&quot;primary&quot;<br>  size=&quot;small&quot;<br>  isLoading<br>  icon=&quot;download&quot;<br>  fullWidth<br>  align=&quot;left&quot;<br>  type=&quot;submit&quot;<br>  shadow=&quot;none&quot;<br>  trackingId=&quot;cta_01&quot;<br>/&gt;</pre><p>What you now have is a <strong>God Component in disguise</strong>.<br> Reusable? Technically.<br> Maintainable? Barely.<br> Debuggable? Good luck.</p><h4>Why It’s a Problem</h4><ul><li><strong>Too many props = complexity explosion</strong><br> You now need a spec sheet just to use the component.</li><li><strong>Business logic starts leaking in</strong><br> Suddenly you’re handling “if icon exists and isLoading and type === ‘link’” inside a UI element.</li><li><strong>Testing becomes a nightmare</strong><br> Every edge case needs its own test.</li></ul><h4>Bad Example — The “Universal” Button</h4><pre>function Button({ variant, size, isLoading, icon, children }) {<br>  const className = `<br>    btn <br>    ${variant === &#39;primary&#39; ? &#39;btn-primary&#39; : &#39;&#39;}<br>    ${size === &#39;small&#39; ? &#39;btn-sm&#39; : &#39;&#39;}<br>  `;<br>  return (<br>    &lt;button className={className}&gt;<br>      {isLoading ? &#39;Loading...&#39; : icon ? &lt;Icon name={icon} /&gt; : null}<br>      {children}<br>    &lt;/button&gt;<br>  );<br>}</pre><p>On day 1, this looks smart.<br> On day 30, you’re writing conditionals that cancel each other out.<br> On day 90, no one wants to touch this button anymore.</p><h4>Better — Split, Specialize, Compose</h4><p><strong>Instead of one mega-component, split into smaller, focused components.</strong></p><pre>// PrimaryButton.jsx<br>function PrimaryButton({ children, ...props }) {<br>  return (<br>    &lt;button className=&quot;btn btn-primary&quot; {...props}&gt;<br>      {children}<br>    &lt;/button&gt;<br>  );<br>}</pre><p>Or use <strong>composition</strong>:</p><pre>&lt;Button&gt;<br>  &lt;Icon name=&quot;download&quot; /&gt;<br>  Download<br>&lt;/Button&gt;</pre><p>Or expose <strong>slots</strong> and <strong>variants intentionally</strong> with well-defined contracts.</p><h4>The Takeaway</h4><p>If a component has too many props, it’s trying to do too much.<br> A reusable component is only good <strong>if it’s predictable</strong>.</p><blockquote><em>Don’t build for “maybe we’ll need this someday.”<br> Build for “we need this now — and it’s easy to extend if we must.”</em></blockquote><h3>Smell #3 — Magic Numbers &amp; Strings</h3><blockquote>“Why is ‘admin’ hardcoded in 6 different places? Who knows.”</blockquote><h4>The Smell</h4><p>You’re deep in a feature, and you need to check the user role:</p><pre>if (user.role === &#39;admin&#39;) {<br>  // show secret stuff<br>}</pre><p>Looks harmless. Just a quick string.</p><p>But then you see this again…<br> and again…<br> and again…</p><pre>if (user.role === &#39;admin&#39;) { ... }<br>if (permission === &#39;read-only&#39;) { ... }<br>if (status === &#39;active&#39;) { ... }<br>if (theme === &#39;dark&#39;) { ... }</pre><p>Now your codebase is sprinkled with <strong>magic values</strong> — strings and numbers with no context, no validation, and no shared meaning.</p><h4>Why It’s a Problem</h4><ul><li><strong>Hard to change</strong> — Want to rename &#39;admin&#39; to &#39;administrator&#39;? Better hope you didn’t miss any.</li><li><strong>No autocomplete or validation</strong> — Typos like &#39;admn&#39; won’t be caught until runtime.</li><li><strong>Poor readability</strong> — New developers have no idea what valid values are without hunting for them.</li></ul><h4>Bad Example — Hardcoded Chaos</h4><pre>function getDashboardConfig(role) {<br>  if (role === &#39;admin&#39;) {<br>    return { canEdit: true, accessLevel: 3 };<br>  }<br>  if (role === &#39;guest&#39;) {<br>    return { canEdit: false, accessLevel: 0 };<br>  }<br>  return { canEdit: false, accessLevel: 1 };<br>}</pre><p>It works — but it’s fragile.<br> One missed string and behavior breaks silently.</p><h4>Better — Use Constants or Enums</h4><pre>// roles.js<br>export const Roles = {<br>  ADMIN: &#39;admin&#39;,<br>  GUEST: &#39;guest&#39;,<br>  USER: &#39;user&#39;,<br>};</pre><pre>import { Roles } from &#39;./roles&#39;;<br><br>function getDashboardConfig(role) {<br>  if (role === Roles.ADMIN) {<br>    return { canEdit: true, accessLevel: 3 };<br>  }<br>  if (role === Roles.GUEST) {<br>    return { canEdit: false, accessLevel: 0 };<br>  }<br>  return { canEdit: false, accessLevel: 1 };<br>}</pre><p>✅ Now your IDE helps with:</p><ul><li>Autocomplete</li><li>Refactoring</li><li>Type checking (if using TypeScript)</li></ul><h4>Bonus Tip: Enum + TypeScript = ❤️</h4><pre>enum Roles {<br>  Admin = &#39;admin&#39;,<br>  Guest = &#39;guest&#39;,<br>  User = &#39;user&#39;,<br>}<br><br>function getDashboardConfig(role: Roles) {<br>  // role must be one of the enum values<br>}</pre><p>This eliminates guesswork.<br> No more &quot;admin&quot; strings flying around your app like uninvited guests.</p><h4>The Takeaway</h4><blockquote><em>If a value shows up more than once, give it a name.<br> Named constants beat mystery strings every time.</em></blockquote><p>Magic numbers and strings might save you a few keystrokes now, but they’ll cost you hours during debugging and refactoring later.</p><h3>Smell #4 — Overused Global State</h3><blockquote>“Why is everything in context? This app has 4 pages.”</blockquote><h4>The Smell</h4><p>You need to share a bit of state across components.<br> Naturally, you reach for Context.</p><pre>&lt;AppContext.Provider value={{ user, setUser }}&gt;<br>  &lt;App /&gt;<br>&lt;/AppContext.Provider&gt;</pre><p>No problem so far.</p><p>But next thing you know:</p><ul><li>The modal state is global</li><li>The current tab index is global</li><li>That one-time toast message is global</li></ul><p>Now your app has <strong>global everything</strong>, and changing a button label causes half your app to re-render.</p><h4>Why It’s a Problem</h4><ul><li><strong>Unnecessary re-renders</strong> — One state update can ripple through the entire app tree</li><li><strong>Tight coupling</strong> — Components far apart become silently dependent on shared state</li><li><strong>Hard to debug</strong> — Where is this value updated? Why did it change? Who knows!</li></ul><h4>Bad Example — Global State for Local Concerns</h4><pre>// In Context<br>const AppContext = createContext();<br><br>const AppProvider = ({ children }) =&gt; {<br>  const [isModalOpen, setModalOpen] = useState(false);<br>  return (<br>    &lt;AppContext.Provider value={{ isModalOpen, setModalOpen }}&gt;<br>      {children}<br>    &lt;/AppContext.Provider&gt;<br>  );<br>};</pre><p>Then every component starts doing:</p><pre>const { isModalOpen, setModalOpen } = useContext(AppContext);</pre><p>Now the whole app re-renders every time the modal opens — even components that don’t care about modals at all.</p><h4>Better — Localize What Can Be Local</h4><p>If the state is only relevant to a specific area — <strong>keep it there</strong>.</p><pre>function Page() {<br>  const [isModalOpen, setModalOpen] = useState(false);<br>  <br>  return (<br>    &lt;&gt;<br>      &lt;button onClick={() =&gt; setModalOpen(true)}&gt;Open Modal&lt;/button&gt;<br>      {isModalOpen &amp;&amp; &lt;Modal onClose={() =&gt; setModalOpen(false)} /&gt;}<br>    &lt;/&gt;<br>  );<br>}</pre><p>Even better? Use <strong>reducer hooks</strong> or <strong>state machines</strong> when things grow.</p><h4>Bonus Tip: Use Context Like a Scoped API, Not a Dumping Ground</h4><p>If you must share state across unrelated components, <strong>create multiple small contexts</strong>, not one mega-provider.</p><pre>&lt;UserProvider&gt;<br>  &lt;ThemeProvider&gt;<br>    &lt;ModalProvider&gt;<br>      &lt;App /&gt;<br>    &lt;/ModalProvider&gt;<br>  &lt;/ThemeProvider&gt;<br>&lt;/UserProvider&gt;</pre><p>Each context only does <strong>one thing</strong>, and you avoid unnecessary coupling.</p><h4>The Takeaway</h4><blockquote><em>Not all state is app-wide state.<br> Just because Context exists doesn’t mean you should use it for everything.</em></blockquote><p>Use local state by default. Reach for context <strong>only</strong> when:</p><ul><li>Props drilling is deep and unmanageable</li><li>The state is truly global (e.g., auth, theme)</li><li>Performance is under control (or you know how to memoize properly)</li></ul><h3>Smell #5 — Clever Code That Lies To You</h3><blockquote>“Nice one-liner bro… but what does it do again?”</blockquote><h4>The Smell</h4><p>At some point, we all fall into this trap:</p><blockquote><em>“Look at this — destructuring, ternary, optional chaining, </em><em>reduce, all in one neat line. So clean!”</em></blockquote><p>And sure, it <em>feels</em> clean:</p><pre>const result = arr?.reduce((a, { x }) =&gt; (x &gt; 0 ? [...a, x * 2] : a), []) ?? [];</pre><p>But come back to this in two weeks and you’ll be like:</p><p>🧠❌ “Wait, what does this actually do again?”<br> 🫠📉 “Okay… so maybe it’s filtering… and multiplying… or something?”</p><h4>Why It’s a Problem</h4><ul><li><strong>It’s hard to read</strong> — Clever ≠ clear.</li><li><strong>It’s hard to debug</strong> — You can’t easily log or inspect the middle of a one-liner.</li><li><strong>It’s hard to change</strong> — Refactoring gets risky when logic is condensed into a dense syntax salad.</li><li><strong>It confuses others (and future you)</strong> — Your teammate (or yourself, 3 months later) won’t thank you.</li></ul><h4>Bad Example — Ternaryception</h4><pre>const label = status === &#39;active&#39;<br>  ? &#39;🟢 Active&#39;<br>  : status === &#39;pending&#39;<br>  ? &#39;🟡 Pending&#39;<br>  : &#39;🔴 Inactive&#39;;</pre><p>Yes, it technically works.<br> But it reads like you’re trying to write JavaScript poetry.</p><h4>Better — Be Explicit, Be Kind</h4><pre>function getStatusLabel(status) {<br>  if (status === &#39;active&#39;) return &#39;🟢 Active&#39;;<br>  if (status === &#39;pending&#39;) return &#39;🟡 Pending&#39;;<br>  return &#39;🔴 Inactive&#39;;<br>}</pre><p>Now it’s:</p><ul><li>Easy to follow</li><li>Easy to extend</li><li>Easy to test</li></ul><p>No brain gymnastics required.</p><h4>Bonus Tip: Split, Name, and Simplify</h4><p>If your logic is slightly complex — <strong>split it into steps</strong> and <strong>name things</strong>:</p><pre>const positiveNumbers = numbers.filter(n =&gt; n &gt; 0);<br>const doubled = positiveNumbers.map(n =&gt; n * 2);</pre><p>Or, annotate your chains:</p><pre>// Filter out invalid users and sort by last login<br>const activeUsers = users<br>  .filter(u =&gt; u.isActive)<br>  .sort((a, b) =&gt; b.lastLogin - a.lastLogin);</pre><p>It’s still clean. But now it <strong>communicates intention</strong>.</p><h4>The Takeaway</h4><blockquote><em>If a line of code needs a Slack thread to explain it…<br> You probably shouldn’t write it that way.</em></blockquote><p><strong>Readable code is kind code</strong>.<br> Cleverness might impress <em>you</em> — but clarity helps <em>everyone</em>.</p><h3>Conclusion: Small Smells, Big Headaches</h3><p>Code doesn’t rot overnight.<br>It happens slowly — with innocent shortcuts, rushed decisions, and “I’ll clean this up later” promises.</p><p>Each of the five patterns we covered might seem harmless at first. But left unchecked, they snowball into bugs, confusion, and refactoring pain. The good news? Most of these are <strong>easy to avoid with a little awareness</strong>.</p><p>So next time you’re in the zone, ask yourself:</p><blockquote><em>“Is this clever… or is this clear?”<br> “Is this temporary… or is this maintainable?”<br> “Am I writing for the computer… or for the next developer?”</em></blockquote><p>If the answer makes you squint — it’s probably a smell.</p><h4>Smell Checklist — Watch Out for These</h4><p><strong>1. 🚫 Anonymous Functions Everywhere</strong><br><strong>Don’t</strong>: Write inline functions like onClick={() =&gt; doSomething()} in every JSX element<br><strong>Do</strong>: Extract named functions and reuse them for cleaner, more testable code</p><p><strong>2. 🚫 Copy-Paste Components</strong><br><strong>Don’t</strong>: Duplicate components with slightly different props or layouts<br><strong>Do</strong>: Create base/shared components with flexible props or composition</p><p><strong>3. 🚫 Magic Numbers &amp; Strings</strong><br><strong>Don’t</strong>: Hardcode values like &#39;admin&#39;, &#39;blue&#39;, 42 throughout your app<br><strong>Do</strong>: Define constants, enums, or config objects for consistency and readability</p><p><strong>4. 🚫 Overused Global State</strong><br><strong>Don’t</strong>: Store everything in Context or Redux just because you <em>might</em> reuse it<br><strong>Do</strong>: Keep state local unless it’s truly shared across distant parts of the app</p><p><strong>5. 🚫 Clever Code That Lies to You</strong><br><strong>Don’t</strong>: Write dense one-liners just to be fancy<br><strong>Do</strong>: Split logic into readable steps, name things clearly, and leave breadcrumbs for future-you</p><h3>👣 Final Thought</h3><p>Frontend development is fast-paced. But “fast” doesn’t have to mean “fragile”.</p><p>When you catch these smells early, you:</p><ul><li>Help your teammates move faster</li><li>Make debugging 10× easier</li><li>Save your <em>future self</em> a lot of headaches</li></ul><p><strong>Good code isn’t just about making it work — it’s about making it last.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a0eb5fdecfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common MVP UX Mistakes That Make Users Quit, and How to Avoid Them]]></title>
            <link>https://obceylan.medium.com/common-mvp-ux-mistakes-that-make-users-quit-and-how-to-avoid-them-057feb9d9646?source=rss-6c36762bab29------2</link>
            <guid isPermaLink="false">https://medium.com/p/057feb9d9646</guid>
            <category><![CDATA[early-stage-product-ux]]></category>
            <category><![CDATA[mvp-common-pitfalls]]></category>
            <category><![CDATA[how-to-improve-mvp]]></category>
            <category><![CDATA[ux-for-startups]]></category>
            <category><![CDATA[mvp-ux-mistakes]]></category>
            <dc:creator><![CDATA[Ozan Batuhan Ceylan]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 19:21:45 GMT</pubDate>
            <atom:updated>2025-08-04T19:21:45.838Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve poured countless hours into coding your Minimum Viable Product. You crafted outreach campaigns, ran online ads, and finally, after all that hustle, real users got a chance to try your product. You were excited, ready to see the feedback roll in.</p><p>But then reality hit: users struggled. They clicked around confused, abandoned key flows, or bounced faster than you expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEn3wJ0OumZ05-uSxH0RCw.png" /></figure><p>Here’s the hard truth, <strong>your MVP might <em>look</em> fine, but it <em>hurts</em> to use.</strong></p><p>Many technical founders and indie devs fall into the same trap: obsessing over whether the product technically works, but forgetting about how <em>frustrating</em> it is to actually use. And that frustration? It kills momentum before you even get started.</p><p>In this post, we’ll explore the most common UX mistakes in early MVPs, and how to avoid them. Because building something that works isn’t enough. You need to build something people want to keep using.</p><h3>The 5 Most Common UX Mistakes in Early MVPs</h3><p>When you’re building an MVP, it’s easy to fall into traps that slow down or outright lose your users. Here are the top five UX mistakes that indie devs and technical founders often make — and why they hurt your product’s chances.</p><h4>1. Assuming “Users Will Just Figure It Out”</h4><p>You’ve been living in your product’s world for weeks. You know every button, every flow, every detail. So it feels natural to think users will “just figure it out.”</p><p><strong>But they won’t.</strong> If your product isn’t instantly clear, users get frustrated and leave fast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7FL1Ktc6oSgjLpqzGVlS_Q.png" /></figure><h4>How to fix it:</h4><p>Test your MVP with someone who matches your target user profile, someone who’s likely to actually use your product. Watch where they hesitate or get stuck. Simplify your UI and add clear labels or hints. Remember, clarity beats cleverness every time.</p><h4>2. Broken Flows and Confusing Navigation</h4><p>Your MVP might technically work, but if users get lost or stuck trying to move between screens, it’s a no-go. Confusing navigation or dead ends make users frustrated and erode trust quickly.</p><p>Often, these dead ends happen because of links or buttons leading to features not yet available, like “coming soon” pages or unfinished sections. While it’s tempting to showcase your product vision, these placeholders can confuse users more than help them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ASSnkf_9MFYOALhfN6CNA.png" /></figure><h4>How to fix it:</h4><p>Map out your user flow before coding. Test the entire journey with real users who fit your target audience. Make sure each step naturally leads to the next. If a feature isn’t ready, hide or disable its link to avoid confusion. Simplify menus, add clear buttons like “Next” or “Back,” and avoid surprises.</p><h4>3. UI Without UX: Looks Don’t Guarantee Usability</h4><p>Your MVP might have a clean, minimal design with buttons and elements perfectly aligned. But if users don’t understand <em>why</em> those buttons are there or <em>what</em> they do, your UI is just decoration, not a tool.</p><p>Minimalism is great, but too much “empty space” without guidance can make users feel lost or abandoned. Lack of tooltips, onboarding hints, or clear microcopy leaves users guessing what to do next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W0j6-PLUXV_8boHcYt44dg.png" /></figure><h4>How to fix it:</h4><p>Add simple onboarding steps or tooltips that guide first-time users through key actions. Use clear and descriptive labels on buttons and links. Think of your UI as a conversation with your user, make sure it talks back.</p><h4>4. Silent Forms and Meaningless Errors</h4><p>Users often spend time filling out long forms only to find out they can’t submit, and worse, they have no idea why. This confusion quickly turns into frustration and abandonment.</p><p>Long forms without proper validation or clear error messages kill user motivation. Keeping forms short <em>and</em> implementing precise validations with actionable feedback is critical to keep users moving forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDJeNk2qdRfKv03p5Vx5Mg.png" /></figure><h4>How to fix it:</h4><p>Break long forms into smaller, manageable steps. Use real-time validation and clear, specific error messages. For example, instead of a vague “Invalid input,” say “Password must be at least 8 characters.” Help users understand exactly what went wrong and how to fix it.</p><h4>5. Designing for Yourself, Not Your Users</h4><p>It’s easy to build the product <em>you</em> would use or understand best. But your users are not you, they have different needs, skills, and expectations.</p><p>When you design for yourself, you risk creating confusing flows, missing onboarding, or adding features that don’t solve real problems. This empathy gap can make your MVP frustrating or irrelevant to your target audience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B93tTIooQskxKeWhqoSHIw.png" /></figure><h4>How to fix it:</h4><p>Get out of your own head and into your users’ shoes. Conduct user interviews, gather feedback from real prospects, and watch how they interact with your MVP. Design with empathy, it’s the key to building something people actually want to use.</p><h3>Conclusion: Your MVP’s UX Is Its Heartbeat</h3><p>Building an MVP is about more than just showing <em>which</em> problem you’re solving for your users, it’s also about <strong>how easily and smoothly you solve it</strong>. If your MVP makes users jump through hoops or leaves them confused, they won’t stick around long enough to appreciate the value you offer.</p><p>Remember:<br><strong>Solving a problem is important, but solving it <em>effortlessly</em> is what keeps users coming back.</strong></p><p>Invest time early on in simple UX fixes, empathize with your users, and keep testing. The smoother and clearer your MVP feels, the more users will stay engaged, and that’s the real minimum viable success.</p><p>Keep building boldly, but build kindly too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=057feb9d9646" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Customer Health Dashboard with SaaS Data]]></title>
            <link>https://medium.com/peaka/how-to-build-a-customer-health-dashboard-with-saas-data-e0b577a54d1c?source=rss-6c36762bab29------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0b577a54d1c</guid>
            <dc:creator><![CDATA[Ozan Batuhan Ceylan]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 12:38:17 GMT</pubDate>
            <atom:updated>2025-07-22T12:38:17.328Z</atom:updated>
            <content:encoded><![CDATA[<p>Quickly build a customer health dashboard without ETL pipelines. Integrate data from HubSpot, Stripe, and Zendesk to identify risks and boost retention.</p><h3>Project Overview</h3><p>Before customer dissatisfaction snowballs into churn, what if you could spot the early signs from support tickets, health scores, and revenue trends, all in one dashboard?</p><p>In this tutorial, you will build a <strong>customer health dashboard</strong> that integrates data from <strong>Zendesk</strong>, <strong>Hubspot</strong>, and <strong>Stripe</strong> to track key metrics like <strong>support tickets</strong>, <strong>average MRR (Monthly Recurring Revenue)</strong>, <strong>health scores</strong>, and <strong>churn risk</strong>, all in one unified view. The goal is to help <strong>customer success teams</strong>, <strong>product managers</strong>, and <strong>sales leaders</strong> spot early warning signs, improve retention, and reduce churn.</p><p>This dashboard delivers real value for:</p><ul><li><strong>Customer success teams</strong> focused on proactive churn prevention</li><li><strong>Product managers</strong> looking for deeper insights into account health</li><li><strong>Growth and revenue teams</strong> aiming to maximize customer lifetime value and reduce churn costs</li></ul><p>Best of all, instead of spending weeks on complex <strong>data integration</strong> and dashboard development, you will build this entire solution in just a few hours using <strong>Peaka</strong> for seamless data unification and <strong>v0.dev</strong> for fast frontend generation.</p><p>This dashboard serves as a starting point, a foundational solution that you can build upon and customize further as your needs grow. While it covers key customer health metrics, you can easily extend it with more data sources, advanced analytics, or deeper integrations over time.</p><h3>The Tools We Need</h3><p>To build this customer health dashboard, we’ll rely on a streamlined set of tools that simplify data integration and frontend development without the complexity of traditional data engineering.</p><h4>Peaka</h4><p>Peaka acts as the central platform that connects to your existing data sources and lets you join, transform, and model your data in one place using SQL queries. This approach eliminates the need for setting up complex ETL pipelines or managing separate data warehouses, making it faster and easier to create unified views of your customer data while keeping full control over the data logic.</p><h4>v0.dev</h4><p>Once your data models are ready in Peaka, v0.dev enables you to generate a polished, functional dashboard interface using prompt-based UI creation. This allows you to build and iterate on your frontend quickly without writing boilerplate code.</p><h4>Data Sources</h4><p>We’ll connect Peaka to familiar platforms like Zendesk, Hubspot, and Stripe to pull support ticket data, customer health scores, and subscription revenue information. These integrations provide the raw data needed to power the dashboard’s key metrics.</p><h3>What is Peaka?</h3><p>Peaka is a cloud-native data platform that enables teams to connect, transform, and query data from multiple sources in real-time using standard SQL. Unlike traditional data warehouses that require complex ETL pipelines and data duplication, Peaka provides <strong>virtualized data models</strong> that join and aggregate live data without moving it.</p><p>In this project, Peaka acts as the <strong>central data layer</strong>, unifying disparate datasets from Zendesk, Hubspot, and Stripe into clean, queryable virtual tables. This approach allows you to maintain data freshness and consistency while avoiding the overhead of managing separate infrastructure.</p><p>Peaka’s SQL-first design empowers data engineers and analysts to define business logic directly in the platform, accelerating development cycles and improving data governance. Its seamless integration with downstream tools like v0.dev enables rapid frontend development based on these robust data models.</p><p>By using Peaka, you get the best of both worlds: the flexibility and control of SQL with the efficiency and scalability of a modern data platform.</p><h3>Let’s Dive In</h3><h4>Step 1: Setting Up Your Peaka Project</h4><p>Before connecting data sources or writing queries, you’ll need to create a Peaka project and generate an API key for authentication. Follow these steps:</p><ul><li>Go to <a href="https://peaka.studio/">peaka. studio</a> and log in.</li></ul><blockquote>If you don’t have an account yet, sign up. It only takes a couple of minutes.</blockquote><ul><li>From your dashboard, click <strong>Create New Project</strong> and give it a name.</li><li>Open your newly created project and click the gear icon (⚙️) in the bottom-left sidebar to open <strong>Settings</strong>.</li><li>In the <strong>Settings</strong> panel, go to the <strong>API Keys</strong> tab and click <strong>Create API Key</strong>.</li><li>Copy your <strong>Project ID</strong> from the URL in your browser’s address bar. It should look like this:</li></ul><pre>https://peaka.studio/studio/{project_id}/...</pre><blockquote><em>Make sure to save both your API key and Project ID somewhere safe, you’ll need them in the next step when connecting Peaka to your app.</em></blockquote><h4>Step 2: Connect Your Data Sources</h4><p>Let’s start by connecting your first data source, Zendesk.</p><ol><li>Go to your Peaka workspace and click the <strong>+ Data Source</strong> button at the top left.</li><li>In the search bar, type <strong>Zendesk</strong>, then select it from the list.</li><li>Click <strong>Add New Connection</strong>.</li><li>Enter a <strong>Connection Name</strong> and your <strong>Zendesk subdomain</strong>.</li><li>Click <strong>Sign In</strong>, and authorize Peaka to access your Zendesk account.</li></ol><p>Once this process is complete, your Zendesk data will be ready to use inside Peaka.</p><p>Next, follow a similar process to connect <strong>HubSpot</strong>, search, select, and authorize via the OAuth screen. For <strong>Stripe</strong>, you’ll instead use your Stripe API key when creating the connection.</p><p>Need help? You can find step-by-step instructions for each connector in the Peaka documentation:</p><ul><li><a href="https://docs.peaka.com/integrations/zendesk">Zendesk Integration Guide</a></li><li><a href="https://docs.peaka.com/integrations/hubspot">HubSpot Integration Guide</a></li><li><a href="https://docs.peaka.com/integrations/stripe">Stripe Integration Guide</a></li></ul><h4>Step 3: Creating Your Queries</h4><p>To build a dashboard, you’ll first need to define the queries that power your metrics. Here’s how you can create a query on Peaka:</p><ol><li>Navigate to the <strong>Queries</strong> section in the left sidebar.</li><li>Click <strong>➕ New Query</strong> to start creating a new SQL query.</li><li>Choose <strong>Start from Scratch</strong> instead of using a template. (You can explore templates later for common use cases.)</li><li>Write your SQL and click <strong>Run</strong> to preview the results.</li></ol><p>For a more detailed guide on how to create queries in Peaka, check out <a href="https://docs.peaka.com/connecting-your-data/creating-query">this documentation page</a>.</p><p>Let’s go through the core queries you’ll need:</p><h4>1. Active Tickets</h4><p>This query shows how many active support tickets (with statuses “open” or “pending”) each user has created in the past 30 days. It helps identify users who may need more urgent support.</p><pre>SELECT <br>  u.email AS requester_email, -- Requester&#39;s email address<br>  COUNT(*) AS active_ticket_count -- Count of active tickets per user<br>FROM &quot;zendesk&quot;.&quot;public&quot;.&quot;tickets&quot; t<br>JOIN &quot;zendesk&quot;.&quot;public&quot;.&quot;users&quot; u ON t.requester_id = u.id<br>WHERE t.status IN (&#39;open&#39;, &#39;pending&#39;) -- Only tickets that are still open or pending<br>  AND t.created_at &gt;= CURRENT_DATE - INTERVAL &#39;30&#39; DAY -- Tickets created in the last 30 days<br>GROUP BY u.email; -- Group results by user email</pre><h4>2. Monthly Recurring Revenue (MRR)</h4><p>This query calculates the monthly recurring revenue (MRR) per customer by summing up the unit amounts of active or recently incomplete subscriptions. Useful for understanding current revenue flow.</p><pre>SELECT <br>  c.email AS customer_email, -- Customer&#39;s email address<br>  SUM(p.unit_amount / 100) AS mrr_usd -- Sum of subscription amounts (converted from cents to dollars)<br>FROM &quot;stripe&quot;.&quot;payment&quot;.&quot;subscriptions&quot; s<br>JOIN &quot;stripe&quot;.&quot;payment&quot;.&quot;customers&quot; c ON s.customer_id = c.id<br>JOIN &quot;stripe&quot;.&quot;payment&quot;.&quot;prices&quot; p ON s.plan_id = p.id<br>WHERE s.status IN (&#39;active&#39;, &#39;incomplete_expired&#39;, &#39;incomplete&#39;) -- Active or recently incomplete subscriptions<br>GROUP BY c.email; -- Group results by customer email</pre><h4>3. Churn Risk</h4><p>This query identifies customers who have recently submitted a high number of support tickets and cross-references them with their subscription activity to assess churn risk levels.</p><pre>WITH active_tickets AS (<br>  SELECT <br>    u.email AS customer_email, -- Email of the customer who submitted tickets<br>    COUNT(*) AS ticket_count -- Number of tickets created in the last 30 days<br>  FROM &quot;zendesk&quot;.&quot;public&quot;.&quot;tickets&quot; t<br>  JOIN &quot;zendesk&quot;.&quot;public&quot;.&quot;users&quot; u ON t.requester_id = u.id<br>  WHERE t.created_at &gt;= CURRENT_DATE - INTERVAL &#39;30&#39; DAY<br>  GROUP BY u.email<br>),<br>active_subscriptions AS (<br>  SELECT <br>    c.email AS customer_email, -- Customer email from Stripe<br>    MAX(s.ended_at) AS last_payment_date -- Last subscription end date<br>  FROM &quot;stripe&quot;.&quot;payment&quot;.&quot;subscriptions&quot; s<br>  JOIN &quot;stripe&quot;.&quot;payment&quot;.&quot;customers&quot; c ON s.customer_id = c.id<br>  WHERE s.status = &#39;active&#39;<br>  GROUP BY c.email<br>)<br><br>SELECT <br>  at.customer_email, -- Email from active tickets<br>  at.ticket_count, -- Number of tickets submitted<br>  CASE <br>    WHEN at.ticket_count &gt; 5 AND (asub.last_payment_date IS NULL OR asub.last_payment_date &lt; CURRENT_DATE - INTERVAL &#39;30&#39; DAY) THEN &#39;High&#39; -- High risk if many tickets and no recent payment<br>    WHEN at.ticket_count &gt; 3 THEN &#39;Medium&#39; -- Medium risk if moderate ticket count<br>    ELSE &#39;Low&#39; -- Otherwise low risk<br>  END AS churn_risk<br>FROM active_tickets at<br>LEFT JOIN active_subscriptions asub ON at.customer_email = asub.customer_email;</pre><h4>4. Account Health Score</h4><p>This query calculates a composite health score for each customer by combining their active subscription status, recent open tickets, and churn risk level. The score helps prioritize accounts needing attention.</p><pre>WITH ticket_stats AS (<br>  SELECT <br>    u.email AS customer_email, -- Customer email from Zendesk users<br>    COUNT(*) FILTER (WHERE t.status IN (&#39;open&#39;, &#39;pending&#39;) AND t.created_at &gt;= CURRENT_DATE - INTERVAL &#39;30&#39; DAY) AS open_tickets_last_30d, -- Number of open tickets in last 30 days<br>    COUNT(*) AS total_tickets -- Total number of tickets<br>  FROM &quot;zendesk&quot;.&quot;public&quot;.&quot;tickets&quot; t<br>  JOIN &quot;zendesk&quot;.&quot;public&quot;.&quot;users&quot; u ON t.requester_id = u.id<br>  GROUP BY u.email<br>),<br>active_subscriptions AS (<br>  SELECT <br>    c.email AS customer_email, -- Customer email from Stripe<br>    COUNT(*) &gt; 0 AS has_active_subscription -- Boolean flag for active subscription<br>  FROM &quot;stripe&quot;.&quot;payment&quot;.&quot;subscriptions&quot; s<br>  JOIN &quot;stripe&quot;.&quot;payment&quot;.&quot;customers&quot; c ON s.customer_id = c.id<br>  WHERE s.status = &#39;active&#39;<br>  GROUP BY c.email<br>),<br>churn_risk_calc AS (<br>  SELECT <br>    ts.customer_email,<br>    CASE <br>      WHEN ts.open_tickets_last_30d &gt; 5 AND (asub.has_active_subscription = false OR asub.has_active_subscription IS NULL) THEN &#39;High&#39; -- High churn risk if many open tickets and no active subscription<br>      WHEN ts.open_tickets_last_30d &gt; 3 THEN &#39;Medium&#39; -- Medium churn risk for moderate open tickets<br>      ELSE &#39;Low&#39; -- Otherwise low risk<br>    END AS churn_risk<br>  FROM ticket_stats ts<br>  LEFT JOIN active_subscriptions asub ON ts.customer_email = asub.customer_email<br>)<br><br>SELECT<br>  ts.customer_email,<br>  COALESCE(asub.has_active_subscription, false) AS active_subscription, -- Whether customer has active subscription<br>  ts.open_tickets_last_30d, -- Number of open tickets in last 30 days<br>  crc.churn_risk, -- Churn risk level<br>  (<br>    CASE WHEN COALESCE(asub.has_active_subscription, false) THEN 50 ELSE 0 END + -- Add 50 points if active subscription<br>    CASE WHEN ts.open_tickets_last_30d = 0 THEN 20 ELSE 0 END + -- Add 20 points if no open tickets<br>    CASE WHEN ts.open_tickets_last_30d &gt; 5 THEN -20 ELSE 0 END + -- Subtract 20 points if more than 5 open tickets<br>    CASE WHEN crc.churn_risk = &#39;High&#39; THEN -30 ELSE 0 END -- Subtract 30 points if high churn risk<br>  ) AS account_health_score -- Final calculated health score<br>FROM ticket_stats ts<br>LEFT JOIN active_subscriptions asub ON ts.customer_email = asub.customer_email<br>LEFT JOIN churn_risk_calc crc ON ts.customer_email = crc.customer_email;​</pre><h4>Step 4: How to Build the Dashboard on v0.dev</h4><p>Once your queries are ready on Peaka, the next step is turning them into a full-stack dashboard UI. This section explains how to use <a href="https://v0.dev/"><strong>v0.dev</strong></a>, an AI tool that generates production-grade UIs from prompts, to build a fully responsive dashboard with zero boilerplate.</p><p>Here’s how to go from saved queries to a fully functional customer health dashboard:</p><h4><a href="https://docs.peaka.com/blogs/build-health-dashboard-zendesk-hubspot-stripe#write-the-prompt-for-v0-dev">​</a><br>Write the Prompt for v0.dev</h4><p>Begin by preparing a detailed prompt that describes your goal. Here’s an example prompt you can adapt:</p><pre>I have a Peaka account and a Peaka project that contains four saved queries:<br>- active_tickets: Returns number of active support tickets per customer<br>- mrr: Returns monthly recurring revenue (MRR) per customer<br>- account_health_score: Returns a numeric health score between 0 and 100 for each customer<br>- churn_risk: Returns churn risk category (&quot;Low&quot;, &quot;Medium&quot;, or &quot;High&quot;)<br><br>I want to build a full-stack customer health dashboard in Next.js, using React and Tailwind CSS.<br><br>The dashboard layout should include:<br><br>Top section (4 metric cards):<br>- Total active tickets<br>- Average MRR<br>- Average account health score<br>- High churn risk percentage<br><br>Bottom section (charts):<br>- Bar chart showing MRR by customer<br>- Pie chart showing churn risk distribution<br>- Histogram (bar chart) of health score distribution in buckets<br>- Scatter plot of active tickets vs MRR, with churn risk as point color<br><br>All data should be fetched directly from Peaka&#39;s data API using fetch.<br><br>To get data from a Peaka query, I will use the following API pattern:<br><br>POST https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries/execute<br>Authorization: Bearer &lt;token&gt;<br>Content-Type: application/json<br><br>Body:<br>{<br>  &quot;from&quot;: [<br>    {<br>      &quot;catalogName&quot;: &quot;peaka&quot;,<br>      &quot;schemaName&quot;: &quot;query&quot;,<br>      &quot;tableName&quot;: &quot;mrr&quot; // or &quot;active_tickets&quot;, etc.<br>    }<br>  ]<br>}<br><br>Each query will be executed this way from the frontend. You can assume the token is stored in an .env file or injected via a helper function.<br><br>Please generate the full dashboard code as a single `dashboard.tsx` page, using `fetch` to call these APIs from the browser. Use Tailwind CSS for layout. For charts, you can use Recharts or another modern charting library.<br><br>You can check Peaka&#39;s API reference here: https://docs.peaka.com/api-reference/introduction<br><br>Make the code developer-friendly and easy to customize.</pre><p>This prompt provides enough context for v0 to generate a complete dashboard layout with proper data bindings and visualizations.</p><h4>Set Up Environment Variables</h4><p>After generating the UI, v0 will request environment variables for secure access to your Peaka project. Add the following to your .<strong>env</strong> file:</p><pre>PEAKA_API_KEY=your_api_key_here<br>PEAKA_PROJECT_ID=your_project_id_here</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*hgNRS3j8ObVN8evs.png" /></figure><p>These values are injected into your app and used when making authenticated <strong>fetch</strong> calls to Peaka’s Data API.</p><h4>Verify API Calls and Response Handling</h4><p>v0 generates initial API logic based on your prompt. To ensure accuracy:</p><ul><li>Review how <strong>fetch</strong> requests are constructed (especially the body structure)</li><li>Compare it with <a href="https://docs.peaka.com/api-reference/data--queries/execute-query"><strong>Peaka’s API documentation</strong></a></li><li>Add sample request and response objects from the docs directly into your prompt (if needed) to improve alignment</li></ul><p>Pay close attention to fields like <strong>catalogName</strong>, <strong>schemaName</strong>, and <strong>tableName</strong>, these need to be exactly as defined in your Peaka query setup.</p><h4><strong>Make Final Adjustments</strong></h4><p>Once the initial dashboard is generated:</p><ul><li>Refine how response data is parsed into metrics and chart series</li><li>Tweak chart components (tooltips, colors, legends, bucket logic)</li><li>Adjust layout and spacing using Tailwind utility classes</li><li>Simplify or restructure component logic for maintainability</li></ul><p>These small improvements will help polish the UI and make the dashboard easier to customize for future use cases.</p><p>Within minutes, you’ll have a live, responsive, developer-friendly customer health dashboard, powered by real-time data from Peaka and built entirely through prompt-driven development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q07r17mivrvL0laJ.png" /></figure><h3>Real-World Use Cases</h3><p>Different roles across a company can benefit from these metrics in meaningful ways. For instance, a <strong>Customer Success Manager</strong> might regularly track Account Health Scores and Active Tickets to prioritize accounts that need immediate attention or proactive engagement. If an account shows a declining health score and an increasing number of unresolved tickets, it’s a clear signal to intervene before churn becomes inevitable.</p><p>On the other hand, a <strong>Revenue Manager</strong> could use MRR data to analyze revenue growth trends and identify which customer segments are driving the most value. By tying this insight with churn risk data, he/she can spot weak points in the customer journey and collaborate with other teams to improve retention.</p><p>Meanwhile, <strong>Product Teams</strong> can look at churn-prone accounts to understand usage patterns, or the lack thereof. If many of the accounts with high churn risk share a common behavior (e.g., not using a key feature), it becomes a product insight that could inform roadmap priorities or onboarding improvements.</p><p>And of course, <strong>Executives</strong> benefit from seeing the bigger picture, how health scores, support loads, and revenue trends correlate across the business. Having these metrics aggregated and visualized in one place enables faster, more informed strategic decisions.</p><h3>Before Peaka and v0.dev: The Legacy Approach</h3><p>Before tools like Peaka, tracking customer metrics across Stripe and other platforms meant stitching together multiple data sources manually.</p><p>To calculate metrics like MRR or active support tickets, teams often relied on:</p><ul><li>Exporting CSVs from Stripe, Intercom, and Jira</li><li>Writing custom SQL scripts in local notebooks or BI tools</li><li>Setting up and maintaining pipelines to sync these exports into a central database</li><li>Using spreadsheet formulas to aggregate or visualize key numbers</li></ul><p>This approach was:</p><ul><li><strong>Time-consuming</strong>: Writing and maintaining queries required technical expertise.</li><li><strong>Error-prone</strong>: Each manual export introduced chances for mismatched data or outdated snapshots.</li><li><strong>Hard to scale</strong>: As the number of metrics or tools increased, keeping everything in sync became a full-time job.</li><li><strong>Poorly democratized</strong>: Business and support teams had to wait for engineers or analysts to fetch the numbers they needed.</li></ul><p>Even with all this effort, the insights often remained fragmented and delayed.</p><h3>Key Takeaways</h3><ul><li>With v0 and Peaka, you can build customer dashboards from natural language prompts, no coding or manual setup required.</li><li>Peaka brings data from multiple platforms into one place, eliminating the need for custom pipelines or integrations.</li><li>Teams like Customer Success, Product, and Account Management can monitor churn risk, MRR, and ticket activity in real time.</li><li>By replacing spreadsheets and scattered tools, Peaka creates a single source of truth for customer health metrics.</li></ul><h3>Conclusion</h3><p>In this example, we combined data from different sources using Peaka’s robust integration layer and SQL-based interface. Then, with just a few steps, we plugged that data into v0 and built a working dashboard UI in no time. The seamless integration between Peaka and v0 made it incredibly easy to go from raw data to visual output, without setting up a backend or writing complex code. It’s a simple yet powerful way to prototype data-driven apps fast.</p><p><em>Originally published at </em><a href="https://docs.peaka.com/blogs/build-health-dashboard-zendesk-hubspot-stripe"><em>https://docs.peaka.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0b577a54d1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peaka/how-to-build-a-customer-health-dashboard-with-saas-data-e0b577a54d1c">How to Build a Customer Health Dashboard with SaaS Data</a> was originally published in <a href="https://medium.com/peaka">Peaka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Churn Analysis Dashboard in 1 Hour Using Peaka and v0.dev — Peaka]]></title>
            <link>https://medium.com/peaka/how-to-build-a-churn-analysis-dashboard-in-1-hour-using-peaka-and-v0-dev-peaka-bbd7e43b8e66?source=rss-6c36762bab29------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbd7e43b8e66</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[churn]]></category>
            <category><![CDATA[v0]]></category>
            <category><![CDATA[peaka]]></category>
            <category><![CDATA[data-integration]]></category>
            <dc:creator><![CDATA[Ozan Batuhan Ceylan]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 12:32:15 GMT</pubDate>
            <atom:updated>2025-07-08T12:32:15.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Build a Churn Analysis Dashboard in 1 Hour Using Peaka and v0.dev — Peaka</h3><h4>Build a dashboard that identifies Pro- and Enterprise-tier subscribers who contacted support shortly before canceling their subscriptions.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KjMfCBJwkzo9GPvl.jpg" /></figure><h3>Project Overview</h3><p>What if your high-paying customers try to tell you something before they churn, and you don’t catch it?</p><p>In this tutorial, you will build a dashboard that identifies <strong>Pro- and Enterprise-tier subscribers who contacted support shortly before canceling</strong> their subscriptions. The goal is to help support and product teams understand churn patterns and take action before it’s too late.</p><p>This dashboard provides real value for:</p><ul><li><strong>Customer support teams</strong> looking to spot at-risk users,</li><li><strong>Product managers</strong> needing context around cancellations,</li><li><strong>Growth and revenue teams</strong> focused on reducing churn.</li></ul><p>Best of all, instead of spending days coding, you will build this entire system in <strong>just 1 hour</strong> using <strong>Peaka</strong> for data integration and <strong>v0.dev</strong> to generate the frontend.</p><h3>The Tools You’ll Need / The Stack</h3><p>Here’s what you’ll use to bring everything together:</p><ul><li><strong>Peaka</strong> — A no-code data integration platform that connects and joins data from Stripe and Zendesk, then turns those queries into APIs you can consume.</li><li><strong>v0.dev</strong> — An AI-powered tool that generates a full-stack dashboard UI based on a simple natural language prompt.</li><li><strong>Stripe + Zendesk</strong> — The core data sources providing subscription details and customer support tickets, respectively.</li></ul><h4>Why Peaka?</h4><p>Peaka is a no-code data operations platform that enables you to:</p><ul><li>Connect to external data sources like APIs, databases, and SaaS applications,</li><li>Model your data as <strong>virtual tables</strong> without moving or duplicating it,</li><li>Create APIs on top of those virtual tables to serve your applications.</li></ul><p>For this dashboard, Peaka provides:</p><ul><li>A seamless way to <strong>connect Zendesk and Stripe data</strong> by matching customer emails,</li><li>A flexible query builder that lets you <strong>join support tickets with subscription data</strong> using SQL,</li><li>Ready to use API endpoints that you can call directly from your app.</li></ul><p>By using Peaka, you avoid building and maintaining a custom backend, saving significant development time and complexity.</p><h4>Why v0.dev?</h4><p>With v0.dev, you can:</p><ul><li>Skip writing any frontend code. Just describe your app in a prompt,</li><li>Get a fully functional, developer-friendly UI generated for you,</li><li>Automatically generate backend integration logic that connects to Peaka’s APIs,</li><li>Easily adapt your app by updating prompts or API specs and regenerating the code.</li></ul><h3>Let’s Start</h3><h4>Step 1: Setting Up Your Peaka Project</h4><p>Before you start building, you need to set up your Peaka workspace and generate an API key for authentication.</p><p>Follow these steps:</p><ul><li>Go to <a href="https://peaka.studio/">peaka.studio</a> and log in.</li></ul><blockquote>If you don’t have an account yet, sign up. It only takes a minute.</blockquote><ul><li>Open your new project, then click the gear icon (⚙️) in the bottom left sidebar to open <strong>Settings</strong>.</li><li>In <strong>Settings</strong>, navigate to the <strong>API Keys</strong> tab and create a new API key.</li><li>Copy your <strong>Project ID</strong> from the URL in your browser’s address bar. It should look like this:</li></ul><pre>https://peaka.studio/studio/{project_id}/..</pre><p>Save both the API key and Project ID safely, you’ll need these when connecting Peaka to v0.dev.</p><h4>Step 2: Connecting Data Sources in Peaka</h4><p>With your project set up, it’s time to bring in your external data.</p><p>In this example, you’ll connect <strong>Stripe</strong> and <strong>Zendesk</strong> to Peaka. These will serve as the foundation for your churn and support analysis.</p><h4>Connecting Stripe</h4><ul><li>In your Peaka project, click the <strong>➕ Add</strong> button on the left sidebar to open the <strong>Connector List</strong>.</li><li>Use the search bar to find <strong>Stripe</strong> among the available connectors.</li><li>Select it, give the connection a name (e.g., stripe_main), and enter your <strong>Stripe API Key</strong>.</li><li>Click <strong>Connect,</strong> and you’re done!</li></ul><p>Your Stripe data will now appear under your connected data sources.</p><figure><img alt="Search Datasource to Connect" src="https://cdn-images-1.medium.com/max/1024/0*othSTG8XQzpnXBIt.png" /></figure><figure><img alt="Connecting Stripe Account" src="https://cdn-images-1.medium.com/max/548/0*-lY315OgIb37OtxT.png" /></figure><h4>Connecting Zendesk</h4><ul><li>Back in the <strong>Connector List</strong>, search for <strong>Zendesk</strong> and select it.</li><li>Since Zendesk supports <strong>OAuth authentication</strong>, setup is quick and easy.</li><li>Provide a <strong>connection name</strong> and your <strong>Zendesk subdomain</strong> (e.g., yourcompany.zendesk.com).</li><li>Peaka will redirect you to Zendesk for login and authorization. Once approved, the connector will be activated.</li><li>You’ll now have access to <strong>Zendesk tickets and user data</strong> within Peaka, no API handling required.</li></ul><figure><img alt="Connecting Zendesk Account" src="https://cdn-images-1.medium.com/max/506/0*KbAEkzq91xxMVCmS.png" /></figure><p>By the end of this step, both <strong>Stripe</strong> and <strong>Zendesk</strong> will be live in your Peaka project fully authenticated and ready to query.</p><h4>Step 3: Writing Queries in Peaka</h4><p>With Stripe and Zendesk connected, it’s time to extract insights by writing queries across both data sources.</p><h4>Creating a New Query in Peaka</h4><ul><li>From the left sidebar, go to the <strong>Queries</strong> section.</li><li>Click <strong>➕ New Query</strong> to create a new SQL query.</li><li>Choose <strong>Start from Scratch</strong> instead of using a template.</li></ul><blockquote>(You can explore Peaka’s templates later for common use cases.)</blockquote><ul><li>Write the following SQL queries and click <strong>Run</strong> to preview the results.</li></ul><figure><img alt="Create a New Query" src="https://cdn-images-1.medium.com/max/799/0*J1JFZ7z_Y5nqDDKL.png" /></figure><figure><img alt="Query Screen" src="https://cdn-images-1.medium.com/proxy/0*DprBSq40-2sje6kZ.png" /></figure><h4>Query 1: Support Tickets Submitted Shortly Before Churn</h4><p>This query finds <strong>Pro or Enterprise users</strong> who submitted a support ticket <strong>within 14 days before canceling</strong> their subscription.</p><p>Use it to identify customers who might have been unhappy or struggling and possibly prevent future churn.</p><pre>SELECT<br>  u.name,<br>  prod.name AS plan_name,<br>  z.subject,<br>  z.description,<br>  u.email AS customer_email<br>FROM<br>  &quot;zd&quot;.&quot;public&quot;.&quot;tickets&quot; z<br>JOIN<br>  &quot;zd&quot;.&quot;public&quot;.&quot;users&quot; u ON z.requester_id = u.id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;customers&quot; c ON u.email = c.email<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;subscriptions&quot; sub ON c.id = sub.customer_id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;plans&quot; p ON sub.plan_id = p.id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;products&quot; prod ON p.product_id = prod.id<br>WHERE<br>  prod.name IN (&#39;Pro Plan&#39;, &#39;Enterprise Plan&#39;)<br>  AND sub.canceled_at IS NOT NULL<br>  AND z.created_at BETWEEN (sub.canceled_at - INTERVAL &#39;14&#39; DAY) AND sub.canceled_at<br>ORDER BY z.created_at DESC<br>LIMIT 100;</pre><h4>Query 2: All Tickets from Premium Users</h4><p>This query retrieves <strong>all support tickets</strong> submitted by <strong>Pro and Enterprise plan</strong> users, whether they churned or not.</p><p>It’s useful for exploring the overall support volume, issue trends, and satisfaction signals from your premium customer base.</p><pre>SELECT<br>  u.name AS customer_name,<br>  prod.name AS plan_name,<br>  z.subject AS ticket_subject,<br>  z.description AS ticket_description,<br>  u.email AS customer_email,<br>  z.priority,<br>  z.status,<br>  z.updated_at<br>FROM<br>  &quot;zd&quot;.&quot;public&quot;.&quot;tickets&quot; z<br>JOIN<br>  &quot;zd&quot;.&quot;public&quot;.&quot;users&quot; u ON z.requester_id = u.id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;customers&quot; c ON u.email = c.email<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;subscriptions&quot; sub ON c.id = sub.customer_id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;plans&quot; p ON sub.plan_id = p.id<br>JOIN<br>  &quot;stripe&quot;.&quot;payment&quot;.&quot;products&quot; prod ON p.product_id = prod.id<br>WHERE<br>  prod.name IN (&#39;Pro Plan&#39;, &#39;Enterprise Plan&#39;)<br>ORDER BY z.created_at DESC<br>LIMIT 100;</pre><h4>Step 4: Integrating Peaka Queries into the Frontend with v0.dev</h4><p>With your Peaka queries ready, you can now build a complete frontend dashboard using <a href="https://v0.dev/">v0.dev</a>. This step shows how to integrate live query results into your UI, entirely through prompt-based generation.</p><h4>Start with a Prompt</h4><p>Begin by opening <a href="https://v0.dev/">v0.dev</a> and entering a prompt like this:</p><pre>I have a Peaka account and a Peaka project that contains two queries.<br><br>I want to create a dashboard with the following charts:<br><br>- A table listing users who contacted support shortly before canceling. (You can execute the tickets_by_pro_enterprise_customers query from Peaka)<br>- A list of recent feedback entries from premium subscribers. (You can execute the zendesk_tickets_with_stripe_customer_and_plan_info query from Peaka)<br><br>It should be a full-stack system. The design should be developer-friendly and backend should be integrated with Peaka.<br><br>You can check the API reference here: https://docs.peaka.com/api-reference/introduction</pre><figure><img alt="v0 initial prompt" src="https://cdn-images-1.medium.com/max/1024/0*9AGa2fUXp5Ar5MKN.png" /></figure><h4>Set Environment Variables</h4><p>v0.dev will likely ask you to define the following environment variables to authenticate with Peaka:</p><ul><li>PEAKA_API_KEY</li><li>PEAKA_PROJECT_ID</li></ul><p>Use the values you obtained earlier from your Peaka project’s settings and paste them into v0.dev’s environment configuration.</p><figure><img alt="v0 Api Key Screen" src="https://cdn-images-1.medium.com/max/551/0*gf72jsHPpQRApi7w.png" /></figure><h4>Fix the API Base URL</h4><p>By default, v0.dev may try to connect to https://api.peaka.com/v1, which is not the correct base URL for query execution.</p><p>You can fix this by prompting v0.dev with:</p><pre>API Endpoint base is different than api.peaka.com/v1.<br>It should be https://partner.peaka.studio/api/v1</pre><p>If you’re using the <strong>EU zone</strong>, use:</p><pre>https://partner.eu.peaka.studio/api/v1</pre><figure><img alt="Base URL Fix in v0" src="https://cdn-images-1.medium.com/max/687/0*30rPU2hNkIaFqMux.png" /></figure><h4>Use the Correct Request Format</h4><p>After correcting the base URL, you’ll also need to make sure the request payload matches Peaka’s execute-query API format.</p><p>You can provide v0.dev with this sample request and response structure, based on the <a href="https://docs.peaka.com/api-reference/data-queries/execute-query">official documentation</a>:</p><p><strong>Sample request:</strong></p><pre>const options = {<br>  method: &#39;POST&#39;,<br>  headers: {Authorization: &#39;Bearer &lt;token&gt;&#39;, &#39;Content-Type&#39;: &#39;application/json&#39;},<br>  body: &#39;{&quot;from&quot;:[{&quot;catalogName&quot;:&quot;peaka&quot;,&quot;schemaName&quot;:&quot;query&quot;,&quot;tableName&quot;:&quot;samplequery&quot;}]}&#39;<br>};<br><br>fetch(&#39;https://partner.eu.peaka.studio/api/v1/data/projects/{projectId}/queries/execute&#39;, options)<br>  .then(response =&gt; response.json())<br>  .then(response =&gt; console.log(response))<br>  .catch(err =&gt; console.error(err));</pre><p><strong>Sample response:</strong></p><pre>{<br>  &quot;columns&quot;: [<br>    {<br>      &quot;catalogId&quot;: &quot;2&quot;,<br>      &quot;catalogName&quot;: &quot;peaka&quot;,<br>      &quot;schemaName&quot;: &quot;query&quot;,<br>      &quot;tableName&quot;: &quot;samplequery&quot;,<br>      &quot;columnName&quot;: &quot;amount&quot;<br>    }<br>  ],<br>  &quot;data&quot;: [<br>    [<br>      {<br>        &quot;name&quot;: &quot;amount&quot;,<br>        &quot;displayName&quot;: &quot;amount&quot;,<br>        &quot;dataType&quot;: &quot;bigint&quot;,<br>        &quot;value&quot;: &quot;75&quot;,<br>        &quot;order&quot;: 0<br>      }<br>    ],<br>    [<br>      {<br>        &quot;name&quot;: &quot;amount&quot;,<br>        &quot;displayName&quot;: &quot;amount&quot;,<br>        &quot;dataType&quot;: &quot;bigint&quot;,<br>        &quot;value&quot;: &quot;75&quot;,<br>        &quot;order&quot;: 0<br>      }<br>    ],<br>    [<br>      {<br>        &quot;name&quot;: &quot;amount&quot;,<br>        &quot;displayName&quot;: &quot;amount&quot;,<br>        &quot;dataType&quot;: &quot;bigint&quot;,<br>        &quot;value&quot;: &quot;75&quot;,<br>        &quot;order&quot;: 0<br>      }<br>    ]<br>  ]<br>}</pre><figure><img alt="Example Payload and Response prompt" src="https://cdn-images-1.medium.com/max/743/0*jNFuR5_aQ11Nk3do.png" /></figure><h4>Final Touches via Prompt Iteration</h4><p>Once your frontend is connected to Peaka and fetching live data, you can polish the UI using plain prompts.</p><p>For example:</p><pre>Map the &quot;date&quot; field to the &quot;updated_at&quot; column in the recent feedback table, and remove the &quot;rate&quot; field.</pre><p>v0.dev will apply your changes automatically, no need to manually edit code.</p><blockquote><em>✅ At the end of this step, you’ll have a dynamic frontend powered by Peaka’s live query data fully operational in under an hour.</em></blockquote><h4>Step 5: The Final Dashboard</h4><p>After hooking up Peaka as the data layer in a <a href="https://v0.dev/">v0.dev</a> dashboard, you’ll have a clean, fully functional, and developer-friendly interface, powered entirely by live data from Stripe and Zendesk.</p><p>The dashboard consists of two key components:</p><h4>1. Users Who Contacted Support Shortly Before Churning</h4><p>This table lists:</p><ul><li>Customer name</li><li>Email address</li><li>Plan type (Pro or Enterprise)</li><li>Ticket subject &amp; description</li><li>Ticket creation date (within 14 days before cancellation)</li></ul><p>This component highlights <strong>last-minute support activity</strong> from users who churned, providing early-warning signals of dissatisfaction or friction. It’s an invaluable tool for customer support and product teams to spot trends behind cancellations.</p><figure><img alt="Support Before Cancellation screen" src="https://cdn-images-1.medium.com/max/1024/0*EPtIeFdvn9wImkvt.png" /></figure><h4>2. Recent Feedback from Premium Subscribers</h4><p>This section displays all tickets submitted by <strong>current</strong> Pro and Enterprise users, regardless of churn status. It includes:</p><ul><li>Customer name</li><li>Plan name</li><li>Ticket subject &amp; description</li><li>Ticket priority, status, and last updated date</li></ul><p>This real-time view helps teams <strong>monitor ongoing support needs</strong> and stay ahead of potential churn risks before they escalate.</p><figure><img alt="Premium Subscribers’ Ticket Screen" src="https://cdn-images-1.medium.com/max/1024/0*hYx84HLAste2htA6.png" /></figure><h4>Why This Dashboard Delivers Value</h4><p>This dashboard isn’t just a data visualization, it enables action. Here’s how different teams benefit:</p><ul><li><strong>Product teams</strong> can identify recurring friction points.</li><li><strong>Support teams</strong> can evaluate whether unresolved tickets correlate with churn.</li><li><strong>Revenue &amp; growth teams</strong> can track churn trends across plan tiers.</li><li><strong>CSMs</strong> can proactively reach out to users showing warning signs.</li></ul><h4>Time and Effort Saved</h4><p>Traditionally, building this system would require:</p><ul><li>Manual API integrations</li><li>Authentication handling</li><li>SQL joins and data modeling</li><li>Backend service development</li><li>Frontend component coding</li></ul><p>…resulting in <strong>days or even a week</strong> of effort.</p><p>By using <strong>Peaka + v0.dev</strong>, the same outcome can be achieved in <strong>under an hour</strong>, with:</p><ul><li>No custom backend development</li><li>No manual UI coding</li><li>Just clear prompts and a few API keys</li></ul><blockquote><em>💡 This is a fast, scalable way to ship internal tools or MVPs using live SaaS data without compromising on developer experience.</em></blockquote><h3>Real-World Use Cases</h3><p>This exact approach can be adapted for various needs:</p><ul><li><strong>Support teams</strong>: Proactively identify at-risk customers.</li><li><strong>Product teams</strong>: Spot recurring feedback from premium users.</li><li><strong>Growth teams</strong>: Understand why high-value customers churn.</li></ul><p>All without hiring a data team or building internal tools from scratch.</p><h3>The Conventional Way</h3><p>The traditional approach would have looked like this:</p><ul><li>ETL pipeline to pull data from Stripe and Zendesk,</li><li>A data warehouse to store and query the results,</li><li>A backend service to expose APIs,</li><li>A frontend team to build a dashboard.</li></ul><p>Estimated time: <strong>2–3 days, at minimum</strong>.</p><p>Peaka + v0? <strong>1 hour.</strong></p><h3>Key Takeaways</h3><ul><li><strong>Churn signals often hide in support data:</strong> Users who reach out to support shortly before canceling are waving red flags. Surfacing these interactions helps teams take proactive action before it’s too late.</li><li><strong>Peaka makes integrations painless:</strong> Connect to platforms like Stripe and Zendesk without writing any code, model the data with SQL, and instantly turn queries into APIs.</li><li><strong>v0.dev eliminates frontend overhead:</strong> With natural language prompts, you can generate fully functional dashboards that connect to live data, no UI or backend coding required.</li><li><strong>1 hour = days of saved effort:</strong> What would normally take days, building data pipelines, backend services, and frontend components, can now be achieved in under an hour.</li><li><strong>Accessible for non-technical teams:</strong> PMs, support leads, and growth managers can gain insights without needing to write a single line of code.</li><li><strong>Flexible and reusable:</strong> The same structure can be repurposed for different queries, data sources, or dashboard layouts with minimal changes.</li></ul><blockquote><em>🎯 Bottom line: Skip the complexity, accelerate insight.</em></blockquote><blockquote><em>Peaka + v0.dev is a turbocharged way to build MVPs and internal tools.</em></blockquote><h3>Conclusion</h3><p>By simply:</p><ul><li>Connecting Zendesk and Stripe to Peaka,</li><li>Writing two SQL queries,</li><li>Prompting v0.dev to generate the frontend,</li></ul><p>I built a fully functional, data-powered churn insight dashboard in just <strong>1 hour</strong>.</p><p>If you’re a developer or even a PM who wants results without the overhead of building everything from scratch, give this combo a try.</p><p><em>Originally published at </em><a href="https://docs.peaka.com/blogs/how-to-build-churn-dashboard"><em>https://docs.peaka.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbd7e43b8e66" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peaka/how-to-build-a-churn-analysis-dashboard-in-1-hour-using-peaka-and-v0-dev-peaka-bbd7e43b8e66">How to Build a Churn Analysis Dashboard in 1 Hour Using Peaka and v0.dev — Peaka</a> was originally published in <a href="https://medium.com/peaka">Peaka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spotlight effect with HTML & CSS only]]></title>
            <link>https://obceylan.medium.com/spotlight-effect-with-html-css-only-fdb0aafc6988?source=rss-6c36762bab29------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdb0aafc6988</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[css-animation]]></category>
            <dc:creator><![CDATA[Ozan Batuhan Ceylan]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 22:31:35 GMT</pubDate>
            <atom:updated>2024-08-04T09:40:05.286Z</atom:updated>
            <content:encoded><![CDATA[<p>I have a domain that I bought a couple of years ago and forgot about. While clearing my email inbox, I found an email mentioning my domain and decided to create a personal page. As I was thinking about how to create content for the site, I decided to start with a “Coming Soon” page.</p><p>When I researched “Coming Soon” pages, I saw many cool and creative designs, but I wanted to create a minimalist and lightweight page. So, I decided to create a minimalist, text-based HTML &amp; CSS-only “Coming Soon” page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAxEKrCp1bWxbznQD6br4g.png" /><figcaption>my text-based design that is not cool or creative right?</figcaption></figure><p>When I created this page, I thought it wasn’t cool enough and I wanted to add some animation to make the page cooler. So, I decided to create a spotlight effect and animate it.</p><h4>Chasing the spotlight effect</h4><p>Chasing the Spotlight Effect After a few minutes of research, I found lots of examples with spotlight effects, but most of them contained JavaScript solutions or were created using specific frameworks or libraries like React or Vue. So, I read through some code to understand the main approach for the effect.</p><h4>radial-gradient() is the main suspect</h4><p>Radial gradient is a CSS function that helps create a gradient effect with the shape of a circle or ellipse. If we create a radial gradient effect in the shape of a circle from transparent to black, it will look like a spotlight or flashlight.</p><h4>When the Code Reveals</h4><p>My HTML code was this:</p><pre>&lt;div className=&quot;coming-soon-container&quot;&gt;<br>  &lt;div className=&quot;coming-soon&quot;&gt;<br>    Coming Soon<br>    &lt;p&gt;obceylan.dev&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>I added the radial gradient code to my coming-soon-container class.</p><pre>background: radial-gradient(circle at center, #00000000 10rem, #000000 50rem) center left / 200% 200%;</pre><p>Let’s look at the code more closely. First, we defined the shape and position of the radial gradient. Then, we set the first color of the gradient, which is transparent black, and its size. Finally, we defined the second color of the gradient effect and its spread size.</p><h4>Ta-daa: Here is the light</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gg-KMlVz2Te61OusqfEw0w.png" /><figcaption>Is it cooler?</figcaption></figure><h4>Add Some Spark with Basic CSS Animation</h4><p>It’s very lightweight and only uses HTML and CSS, but I thought it was too static. So, I decided to animate the spotlight. I created an animation using CSS keyframes.</p><p>The radial-gradient creates a background image, so we can use background-position to create the animation.</p><pre>@keyframes spotlight {<br>  0% {<br>    background-position:top left;<br>  }<br>  20% {<br>    background-position:bottom right;<br>  }<br>  30% {<br>    background-position:center left;<br>  }<br>  50%{<br>    background-position:center center;<br>  }<br>  80% {<br>    background-position:center right;<br>  }<br>  100% {<br>    background-position:top left;<br>  }<br>}</pre><p>Here is our animation definition, which we will use in our class.</p><pre>.coming-soon-container{<br>  background: radial-gradient(circle at center, #00000000 10rem, #000000 50rem) center left / 200% 200%;<br>  animation-name: spotlight;<br>  animation-duration: 4s;<br>  animation-iteration-count: infinite;<br>}</pre><p>We added the animation to our coming-soon-container class and defined a duration of 4 seconds with an infinite loop using iteration-count.</p><h4>TL;DR: Here is the result and our magical final code.</h4><p>You can check out the result at <a href="https://obceylan.dev/coming-soon">https://obceylan.dev.</a></p><p>And here is the final code:</p><pre>&lt;div className=&quot;coming-soon-container&quot;&gt;<br>  &lt;div className=&quot;coming-soon&quot;&gt;<br>    Coming Soon<br>    &lt;p&gt;obceylan.dev&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;<br><br>&lt;style&gt;<br>  .coming-soon-container{<br>    width: 100%;<br>    height: 100%;<br>    display: flex;<br>    justify-content: center;<br>    background: radial-gradient(circle at center, #00000000 10rem, #000000 50rem) center left / 200% 200%;<br>    animation-name: spotlight;<br>    animation-duration: 4s;<br>    animation-iteration-count: infinite;<br>  }<br>  <br>  .coming-soon{<br>    width: 60%;<br>    height: 60%;<br>    flex: .6;<br>    align-self: center;<br>    text-align: center;<br>    align-content: center;<br>    font-size: 5rem;<br>    text-transform: uppercase;<br>    border-radius: 4rem;<br>  }<br>  <br>  .coming-soon p{<br>    font-size: .7rem;<br>    text-transform:none;<br>  }<br>  <br>  @keyframes spotlight {<br>    0% {<br>      background-position:top left;<br>    }<br>    20% {<br>      background-position:bottom right;<br>    }<br>    30% {<br>      background-position:center left;<br>    }<br>    50%{<br>      background-position:center center;<br>    }<br>    80% {<br>      background-position:center right;<br>    }<br>    100% {<br>      background-position:top left;<br>    }<br>  }<br>&lt;/style&gt;</pre><p>Thank you for reading this lengthy post. Have a nice day. See you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdb0aafc6988" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>