<?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 Sam Abdullaev on Medium]]></title>
        <description><![CDATA[Stories by Sam Abdullaev on Medium]]></description>
        <link>https://medium.com/@samabdullaev?source=rss-d982ed27ab72------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8MEMo8FgzXY990zvyqwKIg.jpeg</url>
            <title>Stories by Sam Abdullaev on Medium</title>
            <link>https://medium.com/@samabdullaev?source=rss-d982ed27ab72------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:00:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samabdullaev/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[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-e0f7460a79a0?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0f7460a79a0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sveltekit]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 22:53:55 GMT</pubDate>
            <atom:updated>2025-08-11T22:53:55.907Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 10: How I Improved My Skills and Workflow in One Project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcXAogaNm1m7wLNmwx5KLw.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to the final part of my 10-part “Concept to Launch” series, where I’ve documented the entire journey of building a full-stack website using SvelteKit and Sanity CMS.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-51a6b18d1c62">Part 9</a>, I shared how I added the final touches before delivering the product to the client. Today, I’m wrapping up the series with a reflection on the lessons I learned throughout the project.</p><p>Let’s get started.</p><h3>Project Summary</h3><p><strong>Client:</strong> Mid-sized accounting firm in Uzbekistan (est. 2019) providing accounting, auditing, and business consulting services</p><p><strong>Goal:</strong> Strengthen credibility and attract new clients through a professional online presence</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vt02FYKBMJGI9MPERqlgzA.png" /><figcaption><a href="http://soffin.uz/">Final Product</a></figcaption></figure><p><strong>Solution Delivered:</strong> A fast, SEO-optimized website with multilingual support and zero developer dependency for content updates after launch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wMQT9STPxt4QyoMHk4pOg.png" /><figcaption>Tools Used</figcaption></figure><p><strong>Tech Stack:</strong> SvelteKit, Sanity CMS, TypeScript, Svelte, JavaScript, CSS, HTML, GitHub, Vercel</p><p><strong>Core Features</strong>:</p><ul><li>Multilingual support (Uzbek, Russian, English)</li><li>CMS-driven dynamic content (Sanity)</li><li>Modular, reusable components for scalability</li><li>Real-time contact notifications via Telegram Bot</li><li>Fully responsive design optimized for mobile and desktop</li><li>Automated CI/CD via Vercel for rapid updates</li></ul><p><strong>Team:</strong></p><ul><li><a href="https://www.linkedin.com/in/davron-suyarov-68a630288/"><strong>Davron Suyarov</strong></a><strong>:</strong> Client (provided branding, content, and feedback)</li><li><a href="https://www.linkedin.com/in/mirzamitdinovs/"><strong>Sayyod Mirzamitdinov</strong></a><strong>:</strong> Senior Engineer (led the project development)</li><li><a href="https://www.linkedin.com/in/samabdullaev/"><strong>Sam Abdullaev</strong></a><strong>:</strong> Software Engineer (contributed to development)</li></ul><p><strong>My Role</strong>: As a Full-stack Developer, I was responsible for:</p><ul><li>contributing to the architecture design, frontend development, CMS integration, and deployment</li><li>working closely with the client to define requirements and branding</li><li>collaborating with the senior engineer on technical implementation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pzLAzjR7hPfS6nfshCzCLg.png" /><figcaption>Time Spent</figcaption></figure><p><strong>Timeline</strong>: Successfully completed in 2 weeks (July 15–27, 2025), from initial planning to final launch</p><h3>Key Accomplishments</h3><ol><li>Built an SEO-friendly multilingual accounting website with 10 pages</li><li>Improved site load times by 50%, achieving &lt;1s desktop and ~2s mobile speeds by optimizing with SvelteKit, Sanity, and Vercel</li><li>Reduced new page development time by 40% by building reusable modular components and layouts</li><li>Integrated Sanity CMS with custom multilingual schemas for editors to update all site content without developer help</li><li>Increased responsiveness of client communication by integrating Telegram Bot API to send instant contact form notifications</li><li>Cut codebase size by 25%, improving maintainability by removing technical debt and using third-party tools</li><li>Reduced client support requests by delivering a clear CMS onboarding guide for smooth post-handoff transitions</li></ol><h3>Lessons Learned</h3><p>I’ve shared plenty of technical details throughout this series, so here’s a broader perspective on what I learned from the project as a whole:</p><ol><li><strong>Ask Questions</strong>: Don’t be afraid to ask questions because even simple ones can prevent bigger problems later</li><li><strong>Communicate Consistently</strong>: Keep everyone aligned through regular updates or check-ins</li><li><strong>Use AI</strong>: Speed up development, but always understand and verify the code it produces</li><li><strong>Test Ideas: </strong>Try new ideas, learn from mistakes, and refine your approach</li><li><strong>Keep Learning</strong>: Search for solutions, explore new tools, and develop efficient habits to grow as a developer</li></ol><h3>Series Recap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vheslULSLfPxAPMa4ZeaQQ.png" /><figcaption>Project Development Article Series</figcaption></figure><p>Writing this series has helped me track my progress and reflect on the project’s challenges and solutions. You can also use it as a step-by-step guide for building and deploying websites with SvelteKit and Sanity CMS.</p><p>For anyone just joining, here’s a quick recap of the series:</p><ol><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-1eeb10ef2ded"><strong>Part 1</strong></a><strong>:</strong> Planning the project and picking the tech stack</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-2bc1fe9b3540"><strong>Part 2</strong></a><strong>:</strong> Turning a template into a prototype</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-6f2369c50234"><strong>Part 3</strong></a><strong>:</strong> Setting up the repo and development environment</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-8462179a07d7"><strong>Part 4</strong></a><strong>:</strong> Building reusable components for a modular UI</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-3a74d03b10ef"><strong>Part 5</strong></a><strong>:</strong> Using props to make components dynamic</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-c5f8dfb35369"><strong>Part 6</strong></a><strong>:</strong> Integrating Sanity and structured the CMS</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-96e6848a6ad8"><strong>Part 7</strong></a><strong>:</strong> Integrating Telegram for instant alerts</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-fe6f345c33e7"><strong>Part 8</strong></a><strong>:</strong> Deploying the website and configuring the domain</li><li><a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-51a6b18d1c62"><strong>Part 9</strong></a><strong>:</strong> Testing and delivering the project to the client</li></ol><h3>Conclusion</h3><p>That’s the end of this 10-part project development journey, and I hope you’ve learned useful techniques to apply to your own projects.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0f7460a79a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-51a6b18d1c62?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/51a6b18d1c62</guid>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Sun, 10 Aug 2025 21:54:25 GMT</pubDate>
            <atom:updated>2025-08-10T21:54:25.710Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 9: How I Tested and Delivered the Project to the Client</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYFVZFDtoHZhkaWmbEfNbg.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 9 of my 10-part “Concept to Launch” series, where I’m building a full-stack website using SvelteKit and Sanity CMS for an accounting firm in Uzbekistan.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-fe6f345c33e7">Part 8</a>, I shared how I deployed the site with Vercel and connected the custom domain. Today, we’ll cover the final steps to turn the site into a polished and a client-ready product.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Final Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1-ddgTI-N4lznffZk_xBw.png" /><figcaption>Final Testing</figcaption></figure><p>A site can be technically correct but still feel unfinished. Before handing the website over to the client, I wanted to make sure everything was working as expected. I thoroughly tested the site on various devices and screen sizes to catch any issues that could affect the user experience. This process helped me identify missing elements, design inconsistencies, and broken links that needed to be resolved before the final handoff.</p><p>As I tested across devices, I documented bugs, design tweaks, and missing content. Here’s a summary of the key areas I addressed:</p><h4>1. Global Navigation</h4><p>The navbar and footer are critical elements of the site, so I made sure they functioned properly across all devices.</p><ul><li><strong>Navbar Fixes</strong>: Added the company logo and a favicon for a more professional and cohesive brand appearance</li><li><strong>Footer Fixes</strong>: Added the missing Facebook icon and URL to ensure consistency across the site</li></ul><h4>2. Homepage Sections</h4><p>The homepage is the first impression of the site, so I ensured the hero section and all content areas were polished.</p><ul><li><strong>Hero Fixes</strong>: Added all necessary data for the hero section and ensured the buttons linked to the correct pages</li><li><strong>Content Fixes</strong>: Adjusted links, added media assets, and ensured everything rendered cleanly across breakpoints</li></ul><h4>3. Content Pages</h4><p>The content throughout the site needed to be consistent, with properly formatted data and a smooth user experience.</p><ul><li><strong>Service Fixes</strong>: Standardized the size of service cards and cleaned up the Sanity content model for services to keep things simple</li><li><strong>Team Fixes:</strong> Ensured all team members had consistent formatting with names, photos, and corrected any background or sizing inconsistencies</li><li><strong>Article Fixes:</strong> Added key data to the homepage and ensured all content was properly displayed on the relevant pages</li></ul><h4>4. Sanity Configuration</h4><p>Some elements were managed through Sanity, and I made sure the CMS structure was fully set up and functional.</p><ul><li><strong>Schema Fixes</strong>: Made some missing schema types optional to allow for future creation when needed</li><li><strong>Studio Fixes:</strong> Adjusted date fields with a DatePicker and added a field for storing Google Maps links</li></ul><h4>5. System Pages</h4><p>To ensure a fully functional, professional site, I added several system pages.</p><ul><li><strong>System Pages:</strong> Added 404, 500, and generic error pages to prevent confusing errors for users</li><li><strong>Legal Pages:</strong> Legal pages (Privacy Policy, Terms &amp; Conditions) will be added later for compliance</li></ul><h4>6. Contact Page</h4><p>I made sure the contact page was fully functional with the correct phone, email, and address links. It’s critical that users can easily reach out, so I tested these links across all devices.</p><p>By methodically testing each section, I ensured that all issues were caught and resolved before the site went live. Testing across different breakpoints and devices helped identify responsiveness issues, while checking each component individually ensured everything worked as intended.</p><h3>Website Performance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXazhU8ARBtgHEAE_G3Uaw.png" /><figcaption>Website Performance</figcaption></figure><p>I tested the website using <a href="https://pagespeed.web.dev/">Google’s PageSpeed Insights</a> and identified several areas for improvement in Performance, Accessibility, Best Practices, and SEO. Here are the key updates I made to improve the scores to 90+ in all categories:</p><h4>1. Performance</h4><ol><li><strong>Unused Assets: </strong>My /assets folder had over 30MB of unused images from the original ThemeForest template<br>• <strong><em>Fix: </em></strong>Removed unused files to cut build size</li><li><strong>Image Loading:</strong> Offscreen images loaded unnecessarily and delayed page load<br>• <strong><em>Fix: </em></strong>Lazy loaded images by setting loading=&quot;lazy&quot;</li><li><strong>Render Blocking: </strong>Several CSS files blocked the initial render and delayed the Largest Contentful Paint (LCP)<br>• <strong><em>Fix:</em></strong> Deferred and inlined critical CSS for faster page load times</li><li><strong>Unused CSS: </strong>A significant amount of unused CSS loaded and increased the page’s payload<br>• <strong><em>Fix:</em></strong> Removed unused CSS to minimize the final build size</li><li><strong>Unused JavaScript: </strong>Some JavaScript files were not utilized but were still loaded and increased load time<br>• <strong><em>Fix: </em></strong>Removed unused JavaScript to load only essential code</li></ol><h4>2. Accessibility</h4><ol><li><strong>Contrast Issues: </strong>Some text had insufficient contrast against background colors and made it hard to read for users with low vision<br>• <strong><em>Fix: </em></strong>Adjusted the color scheme to meet WCAG contrast ratio standards</li><li><strong>Link Accessibility: </strong>Some links lacked descriptive names and could hinder screen reader users<br>• <strong><em>Fix: </em></strong>Added descriptive titles and text to links for better accessibility</li><li><strong>Heading Structure: </strong>Heading elements were out of order and could confuse screen readers and keyboard users<br>• <strong><em>Fix: </em></strong>Restructured headings for better navigation</li></ol><h4>3. Best Practices</h4><ol><li><strong>Aspect Ratio: </strong>Some images displayed incorrectly due to mismatched aspect ratios and affected the overall layout<br>• <strong><em>Fix: </em></strong>Fixed image aspect ratios for correct rendering on all screen sizes</li><li><strong>Console Errors: </strong>JavaScript errors were logged in the browser console and could indicate issues with functionality or performance<br>• <strong><em>Fix: </em></strong>Resolved errors to improve website reliability</li><li><strong>CSP Effectiveness:</strong> The CSP was ineffective and left the site vulnerable to cross-site scripting (XSS) attacks<br>• <strong><em>Fix: </em></strong>Updated CSP to prevent XSS and enhance security</li></ol><h4>4. SEO</h4><ol><li><strong>Link Crawlability: </strong>Some links were not crawlable and could affect the website’s indexing and search visibility<br>• <strong><em>Fix: </em></strong>Made links accessible and crawlable to improve search ranking</li></ol><h3>Custom Errors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5SjVv2sGuI3uJx_xp2HOQ.png" /><figcaption>Custom Errors</figcaption></figure><p>In this project, I wanted to give the website a personalized touch, even for error pages. Rather than a generic error message, I created a custom error page in SvelteKit that displays specific messages and images based on the type of error. This approach not only helps users understand what went wrong but also maintains the visual consistency of the website. Here’s how I set it up:</p><h4>1. Handling Errors</h4><p>SvelteKit provides an easy way to <a href="https://svelte.dev/docs/kit/errors">handle errors</a> using a +error.svelte file. I used Svelte’s reactive capabilities and the status and error properties to display dynamic content based on the error code. For example, for a 404 error (page not found), I displayed a custom image and a localized message for users. Here is my custom error page:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br> const { error, status } = $props&lt;{<br>  error: Error &amp; { frame?: string; stack?: string };<br>  status: number;<br> }&gt;();<br>&lt;/script&gt;<br><br>&lt;div class=&quot;container error&quot;&gt;<br> {#if status === 404}<br>  &lt;img src=&quot;spinning-emoji-face.gif&quot; alt=&quot;error gif&quot; class=&quot;error-image&quot; /&gt;<br>  &lt;h1 class=&quot;error-title&quot;&gt;Page Not Found&lt;/h1&gt;<br>  &lt;p class=&quot;error-text&quot;&gt;Sorry, the page you&#39;re looking for does not exist.&lt;/p&gt;<br> {:else if status === 500}<br>  &lt;img src=&quot;no-result.gif&quot; alt=&quot;no result gif&quot; class=&quot;error-image&quot; /&gt;<br>  &lt;h1 class=&quot;error-title&quot;&gt;Internal Server Error&lt;/h1&gt;<br>  &lt;p class=&quot;error-text&quot;&gt;Please try again later.&lt;/p&gt;<br> {:else}<br>  &lt;img src=&quot;no-notification.gif&quot; alt=&quot;no notification gif&quot; class=&quot;error-image&quot; /&gt;<br>  &lt;h1 class=&quot;error-title&quot;&gt;{error?.message || &#39;An unknown error occurred.&#39;}&lt;/h1&gt;<br>  &lt;p class=&quot;error-text&quot;&gt;Please try again or contact us.&lt;/p&gt;<br> {/if}<br><br> &lt;a href=&quot;/&quot; class=&quot;theme-btn style1 pe-20&quot;&gt;<br>  &lt;i class=&quot;fa-solid fa-arrow-right w-36 h-36 bg-white rounded-circle d-center fz-14 theme-clr4&quot;<br>  &gt;&lt;/i&gt;<br>  Return to Home Page<br> &lt;/a&gt;<br>&lt;/div&gt;</pre><p>For a 404 error, a custom “Page Not Found” message is shown, and for a 500 error, a “Server Error” message appears. If the error is neither of these, it defaults to a generic error message.</p><h4>2. Styling Pages</h4><p>The page is styled to fit the website’s overall design language. It includes:</p><ul><li>A central container with a maximum width for better readability</li><li>Custom fonts and colors to match the brand</li><li>Responsive images and a button to return to the homepage</li></ul><p>The styling ensures that even when a user encounters an error, the page still feels like part of the website. Here’s the CSS for my error page:</p><pre>.container {<br> max-width: 600px;<br> padding: 2rem;<br> text-align: center;<br> font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif;<br>}<br><br>.error {<br> padding-top: 0px !important;<br>}<br><br>.error-title {<br> color: #1c4b42;<br> font-size: 2.5rem;<br> font-weight: 700;<br> line-height: 1.2;<br> margin-bottom: 0.5rem;<br>}<br><br>.error-text {<br> color: #1c4b42;<br> margin-bottom: 1rem;<br> font-size: 1.1rem;<br>}<br><br>.error-image {<br> height: 350px;<br> width: 350px;<br> display: flex;<br> flex-direction: column;<br> align-items: center;<br> justify-content: center;<br> margin: 2rem auto;<br>}</pre><h4>3. Adding CTA</h4><p>At the bottom of the error page, I added a button that links users back to the homepage. This helps keep the navigation flow intact, providing users with a clear way to recover from the error and continue browsing the site.</p><pre>&lt;a href=&quot;/&quot; class=&quot;theme-btn style1 pe-20&quot;&gt;<br> &lt;i class=&quot;fa-solid fa-arrow-right w-36 h-36 bg-white rounded-circle d-center fz-14 theme-clr4&quot;&gt;&lt;/i&gt;<br> Return to Home Page<br>&lt;/a&gt;</pre><h4>Vercel Analytics</h4><p>After deploying the website, I set up Vercel’s built-in analytics to automatically track key metrics like page views, load times, and error rates. Here’s how I enabled it:</p><ol><li><strong>Activate Analytics</strong>: Go to Vercel → Dashboard → Analytics → Enable</li><li><strong>Install Package</strong>: Add the script to your project’s main +layout.svelte</li><li><strong>Access Data</strong>: Vercel automatically tracks page views, load times, etc.</li><li><strong>Add Custom Analytics</strong>: For more detailed tracking, you can also integrate third-party tools like Google Analytics</li></ol><p>Analytics help track how users interact with your site, identify performance issues, and optimize for a better user experience. Monitoring this data regularly allows for informed decisions and continuous improvement.</p><h3>Client Handoff</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwALoT2k7monowlE5vFROA.png" /><figcaption>Client Handoff</figcaption></figure><p>After completing the development and testing, it was time to hand the project over to the client. This stage is crucial because it ensures the client can manage their website easily and knows what to expect moving forward. Here’s how I handled the final handoff:</p><h4>1. Onboarding Guide</h4><p>As part of the final handoff, I created a simple, easy-to-follow onboarding README guide for the client. This guide was tailored for non-technical users, so I focused on the basics of how to manage content through the Sanity CMS, update pages, and manage service-specific content like team profiles or FAQs. The guide included:</p><ul><li>Step-by-step instructions for logging into the CMS</li><li>A breakdown of how to edit text, images, and add new sections</li><li>Screenshots for clarity and references to explain the workflow</li></ul><p>I also handed over all credentials, including:</p><ul><li>Admin access to the CMS (Sanity)</li><li>GitHub access for the code repository</li><li>Domain and hosting account credentials</li></ul><p>By providing this guide and credentials, I ensured the client could make updates to the website without needing to contact developers for every small change.</p><h4>2. Client Presentation</h4><p>Once the site was fully tested and the onboarding guide was ready, I scheduled a final meeting with the client. During the presentation:</p><ul><li>Guided through website features, design, and functionality</li><li>Demonstrated how to manage content through Sanity</li><li>Explained tracking website performance via Vercel analytics</li></ul><p>After the demo, I gathered feedback from the client, which included a few minor adjustments and additions. For example, they wanted to tweak some text on the About page and adjust some images. We agreed on these changes, and I made the final tweaks before proceeding with the official handoff.</p><h4>3. Future Updates</h4><p>I made sure the client understood that the project wasn’t “over” after the handoff. We discussed:</p><ul><li>The level of ongoing support I’d provide, whether it’s fixing bugs, handling security updates, or making small adjustments</li><li>Expectations for future updates, including new features or redesigns, and how update requests would be handled</li></ul><p>With the final handoff complete, I ensured the client had everything needed to confidently manage their website and move forward with future updates and improvements.</p><h3>Key Takeaways</h3><ul><li><strong>Test Manually:</strong> Conduct thorough manual testing across multiple devices to identify and resolve any UX issues</li><li><strong>Analyze Performance: </strong>Use Google’s PageSpeed Insights to assess website performance on both mobile and desktop devices</li><li><strong>Optimize Usability:</strong> Target 90+ in all PSI categories to improve UX, reduce bounce rates, boost conversions, and support SEO</li><li><strong>Handle Errors:</strong> Create custom error pages with relevant messages and visuals to ensure brand consistency</li><li><strong>Track Metrics:</strong> Enable Vercel’s built-in analytics to monitor site performance and user behavior</li><li><strong>Onboard Clients:</strong> Create a guide and schedule a meeting to review features and collect feedback</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll share the lessons learned from working with a client, the tech stack, and the project overall.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51a6b18d1c62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-fe6f345c33e7?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe6f345c33e7</guid>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 22:09:22 GMT</pubDate>
            <atom:updated>2025-08-09T22:09:22.823Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 8: How I Deployed the Website and Configured the Domain</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtAplDhgcW0s0qowCNmh0w.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 8 of my 10-part “Concept to Launch” series, where I’m detailing the process of building a full-stack website with SvelteKit and Sanity CMS for an accounting firm.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-96e6848a6ad8">Part 7</a>, I shared how I integrated Telegram to send contact form alerts to the client’s chat. Today, we’ll go over deploying the site and connecting the domain to bring it live.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Deployment Strategy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBWkmVe5fmcy4CjsaXubpA.png" /><figcaption>Deployment Strategy</figcaption></figure><p>For this project, I’ve been using GitHub for version control, and since it integrates well with Vercel, I chose Vercel for deployment. Here are other reasons behind this decision:</p><ul><li><strong>Zero Setup:</strong> With Vercel, I didn’t need to configure anything; I just pushed the code to GitHub and it’s live</li><li><strong>Fast Delivery:</strong> Vercel automatically serves content via its CDN so I didn’t have to worry about performance optimization</li><li><strong>Automatic Scaling: </strong>Vercel’s serverless model automatically scales as traffic increases without the need for me to manage it</li></ul><p>I also considered other options like self-hosting on a VPS or using a monorepo with shared hosting, but these alternatives would have required more manual management for scaling and performance optimization.</p><h3>Project Deployment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5IgdOX0DrEH1-KUDuzW5A.png" /><figcaption>Project Deployment Workflow</figcaption></figure><p>I deployed the SvelteKit frontend and Sanity Studio backend to Vercel using Vercel’s GitHub integration. Here’s how I did it for both:</p><ol><li><strong>Push Project:</strong> I pushed SvelteKit and Sanity Studio to separate GitHub repositories for better modularity and easier deployment</li><li><strong>Link GitHub: </strong>I created two Vercel projects for SvelteKit and Sanity Studio and linked each to its GitHub repository for automatic detection</li><li><strong>Auto Deploy:</strong> Vercel automatically set up both projects, configured build settings, and deployed seamlessly</li><li><strong>Configure Variables:</strong> I added the necessary environment variables through Vercel’s dashboard under <strong>Settings</strong> &gt; <strong>Environment Variables</strong></li><li><strong>Deploy Code:</strong> After pushing my changes to GitHub, Vercel automatically detected the commits and deployed the sites within minutes</li><li><strong>Add Domain:</strong> I added the main domain for the frontend and subdomain for Sanity Studio, and updated DNS records</li><li><strong>Deploy Continuously:</strong> Vercel’s continuous deployment automatically triggered a new build every time I pushed a new commit to GitHub</li></ol><p>One thing to remember here is that all origins, including production and development, should be added to the CORS settings in the Sanity project to avoid errors when fetching data.</p><h3>Domain Configuration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pPL_OhY_7PsNHSjzAP84_w.png" /><figcaption><a href="https://vercel.com/docs/domains">Vercel DNS Query for Domain Setup</a></figcaption></figure><p>After successfully deploying the frontend and Sanity Studio, the next step was to configure the domain to give the website a custom, professional URL. Here’s how I did it:</p><h4><strong>1. Buy Domain</strong></h4><p>I purchased a country-specific domain (e.g. [my-domain].uz) on <a href="https://www.namecheap.com/">Namecheap</a> (you can also use <a href="https://godaddy.com/">GoDaddy</a> or any other registrar).</p><h4><strong>2. Map Domain</strong></h4><p>After purchasing the domain, I connected it to Vercel:</p><ul><li>Selected projects in the <strong>Vercel Dashboard </strong>and went to the <strong>Domains</strong> tab</li><li>Clicked <strong>Add Domain</strong> to enter the domain names</li><li>Entered [my-domain].uz for the main domain and cms.[my-domain].uz for the Sanity Studio subdomain</li></ul><p>Vercel then provided DNS records to add to my registrar’s DNS settings.</p><h4>3. Configure DNS</h4><p>I logged into my domain registrar’s control panel and updated the DNS settings:</p><ul><li><strong>A Records</strong>: Pointed the domain to <a href="https://vercel.com/docs/domains/working-with-nameservers">Vercel’s servers</a></li><li><strong>CNAME Record</strong>: Vercel provided this to map the subdomain correctly</li></ul><p>After making these changes, I waited for DNS propagation (usually takes a few hours). This process ensured that both the main site and the Sanity Studio were hosted under their respective domains and subdomains.</p><h3>Key Takeaways</h3><ul><li><strong>Use GitHub</strong>: Utilize GitHub for easy version control and automatic deployments with Vercel</li><li><strong>Choose Vercel</strong>: Use Vercel for easy deployment with no manual setup, automatic CDN, and scalability</li><li><strong>Separate Repositories:</strong> Keep the frontend and backend in separate GitHub repos for modularity and easier deployment</li><li><strong>Configure Variables</strong>: Add the necessary environment variables in Vercel’s dashboard to set up project settings</li><li><strong>Map Domain:</strong> Buy a domain, connect it to Vercel, and configure DNS settings to link both the main site and Sanity Studio</li><li><strong>Set CORS:</strong> Add all origins (prod and dev) to Sanity’s CORS settings to avoid data-fetching issues</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll show how I put the finishing touches to the project before handing it over to the client.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe6f345c33e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-96e6848a6ad8?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e6848a6ad8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[sanity]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 19:01:05 GMT</pubDate>
            <atom:updated>2025-08-08T19:01:05.307Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 7: How I Integrated Telegram for Instant Alerts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSJWbytkWm3KVx9GKYdiAg.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 7 of my 10-part “Concept to Launch” series, where I’m covering the process of building a full-stack website with SvelteKit and Sanity CMS for an accounting firm in Uzbekistan.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-c5f8dfb35369">Part 6</a>, I shared how I set up Sanity CMS to manage all of the website’s dynamic content. Today, we’ll go through adding Telegram notifications to the contact form for instant alerts with no extra work.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Telegram Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlLbjLBjacFhwqfa57Z-KQ.png" /><figcaption>Telegram Setup</figcaption></figure><p>Before diving into the code, let me quickly explain why I picked Telegram for this use case. The goal was to notify the client instantly whenever someone filled out the contact form. Here are the alternatives I considered:</p><ol><li><strong>Email:</strong> Universal and familiar, but prone to spam and slow delivery</li><li><strong>SMS:</strong> Instant and offline, but costs money for each message</li><li><strong>Telegram Bot:</strong> Fast, free, and popular in Uzbekistan</li></ol><p>Since Telegram is already widely used in Uzbekistan, and the client’s team relied on it for most communications, I integrated it to send instant notifications whenever someone submitted a message.</p><p>To create a Telegram bot and link it to your account, you need two things:</p><ol><li><strong>Telegram Bot Token</strong>: This is your bot’s key to send messages</li><li><strong>Telegram Chat ID</strong>: This is the user ID your bot sends messages to</li></ol><p>Here is how to set them up:</p><ol><li><strong>Go to </strong><a href="https://telegram.me/BotFather"><strong>Botfather on Telegram</strong></a><strong>:</strong> This is Telegram’s official bot manager</li><li><strong>Run the </strong>/newbot<strong> command:</strong> Follow the prompts to create a new bot account and pick a name + username (must end in bot)</li><li><strong>Save the Bot token: </strong>Once created, BotFather will send you a token that looks like:</li></ol><pre>123456789:ABCdefGhIJKlmNoPQRstuVWXyz</pre><p>4. <strong>Log in to </strong><a href="https://web.telegram.org/"><strong>Telegram Web</strong></a><strong>:</strong> This is where you’ll get your Telegram Chat ID</p><p>5. <strong>Get your Chat ID: </strong>Once logged in, go to your “Saved Messages” chat and look at the number after “#” in the URL:</p><pre>https://web.telegram.org/z/#1234567891</pre><h3>Bot Integration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1aCYcmAJyDod5d6DKWrI2w.png" /><figcaption>Bot Integration</figcaption></figure><p>Now that we have a Bot Token and Chat ID, we can wire them into our site. Here’s how I did it:</p><h4>1. Sanity Schema</h4><p>I wanted to give the client full control over the credentials, so they could change them later without touching code. That’s why I made them editable directly from Sanity Studio.</p><p>You can store these credentials in whichever document fits your schema structure. In my case, I added them to the contact.ts schema, where I was storing all contact-related information. I added a dedicated object field for Telegram credentials:</p><pre>// schemaTypes/contact.ts<br><br>defineField({<br>  name: &#39;telegramCredentials&#39;,<br>  title: &#39;Telegram Bot Credentials&#39;,<br>  type: &#39;object&#39;,<br>  fields: [<br>    defineField({<br>      name: &#39;botToken&#39;,<br>      title: &#39;Bot Token&#39;,<br>      type: &#39;string&#39;,<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    defineField({<br>      name: &#39;chatId&#39;,<br>      title: &#39;Chat ID&#39;,<br>      type: &#39;string&#39;,<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>  ],<br>}),</pre><p>This grouped structure made it clear which fields are related to Telegram, keeping the settings logically nested under the contact section.</p><h4>2. SvelteKit Fetch</h4><p>Once the bot token and chat ID were stored in Sanity, I fetched them in SvelteKit to use when someone submits the contact form. I passed them down to the app using the +layout.ts loader:</p><pre>// /src/lib/types/contact.ts<br><br>export interface Contact {<br>  phone: string;<br>  email: string;<br>  ...<br>  telegramCredentials: {<br>    botToken: string;<br>    chatId: string;<br>  };<br>}<br><br>// /src/lib/types/contactQuery.ts<br>export const contactQuery = `*[_type == &quot;contact&quot;][0]{<br>  phone,<br>  email,<br>  ...<br>  telegramCredentials {<br>    botToken,<br>    chatId<br>  }<br>}`<br><br>// /src/routes/+layout.ts<br>import { fetchContact } from &#39;$lib/queries/contactQuery.js&#39;;<br><br>export async function load({ url }) {<br> const [contact] = await Promise.all([fetchContact()]);<br> return {<br>  pathname: url.pathname,<br>  contact,<br> };<br>}<br><br>// /src/routes/+layout.svelte<br>&lt;script lang=&quot;ts&quot;&gt;<br> const { data } = $props();<br>&lt;/script&gt;<br><br>&lt;ContactForm contact={data.contact} /&gt;<br>&lt;Footer contact={data.contact} /&gt;</pre><h4>3. Form Submission</h4><p>With the Telegram credentials passed down via the contact prop, my ContactForm.svelte component sends messages directly to the Telegram bot when a user submits the form:</p><pre>// /src/components/sections/ContactForm.svelte<br>&lt;script lang=&quot;ts&quot;&gt;<br> import type { Contact } from &#39;$lib/types/contact&#39;;<br> const { contact }: { contact: Contact } = $props();<br> const BOT_TOKEN = contact.telegramCredentials.botToken;<br> const CHAT_ID = contact.telegramCredentials.chatId;<br><br> const sendTelegramMessage = async () =&gt; {<br>  const telegramUrl = `https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`;<br><br>  const message = `<br>📥 soffin.uz contact info:<br><br>👤 ${state.form.name}<br>📧 ${state.form.email}<br>📞 ${state.form.phone}<br>💬 ${state.form.message}<br><br>🕓 ${new Date().toLocaleString()}<br>`;<br><br>  // ...sending logic below (see next section)<br> };<br>&lt;/script&gt;</pre><p>Here’s how I handled form state, sent the message, and displayed feedback:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br> const state = $state({<br>  form: { name: &#39;&#39;, email: &#39;&#39;, phone: &#39;&#39;, message: &#39;&#39; },<br>  loading: false,<br>  showSuccess: false,<br>  showError: false<br> });<br><br> const sendTelegramMessage = async () =&gt; {<br>  // ... (as above)<br>  try {<br>   state.loading = true;<br>   const res = await fetch(telegramUrl, {<br>    method: &#39;POST&#39;,<br>    headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br>    body: JSON.stringify({ chat_id: CHAT_ID, text: message })<br>   });<br>   if (res.ok) {<br>    state.showSuccess = true;<br>    state.showError = false;<br>    state.form = { name: &#39;&#39;, email: &#39;&#39;, phone: &#39;&#39;, message: &#39;&#39; };<br>   } else {<br>    throw new Error(&#39;Telegram API failed&#39;);<br>   }<br>  } catch (err: any) {<br>   console.error(&#39;Telegram Error:&#39;, err.message);<br>   state.showError = true;<br>   state.showSuccess = false;<br>  } finally {<br>   state.loading = false;<br>  }<br> };<br><br> const handleSubmit = async (e: Event) =&gt; {<br>  e.preventDefault();<br>  await sendTelegramMessage();<br> };<br>&lt;/script&gt;<br><br>&lt;form onsubmit={handleSubmit}&gt;<br> &lt;input type=&quot;text&quot; required placeholder=&quot;Name&quot; bind:value={state.form.name} /&gt;<br> &lt;input type=&quot;email&quot; required placeholder=&quot;Email&quot; bind:value={state.form.email} /&gt;<br> &lt;input type=&quot;text&quot; placeholder=&quot;Phone&quot; bind:value={state.form.phone} /&gt;<br> &lt;textarea required placeholder=&quot;Message&quot; bind:value={state.form.message}&gt;&lt;/textarea&gt;<br> &lt;button type=&quot;submit&quot; disabled={state.loading}&gt;<br>  {state.loading ? &#39;Sending...&#39; : &#39;Send Message&#39;}<br> &lt;/button&gt;<br><br> {#if state.showSuccess}<br>  &lt;p class=&quot;success&quot;&gt;✅ Message sent successfully!&lt;/p&gt;<br> {/if}<br> {#if state.showError}<br>  &lt;p class=&quot;error&quot;&gt;❌ Failed to send message.&lt;/p&gt;<br> {/if}<br>&lt;/form&gt;</pre><p>Instead of showing plain success or error messages inside the form, you can improve UX using toast notification libraries like <a href="https://svelte.dev/playground/33fa2b9ce00d44748a08e3b65026cfb2">Svelte Toastify</a> or <a href="https://sveltethemes.dev/wobsoriano/svelte-sonner">svelte-sonner</a> for cleaner feedback.</p><h3>VS Code Shortcuts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mThy3VQzUrOQE-MoIMlQgA.png" /><figcaption>VS Code Shortcuts</figcaption></figure><p>This part isn’t strictly about Telegram, but it can make development much faster over the course of a long project. Here are some VS Code keyboard shortcuts I use daily to save time:</p><ul><li><strong>Ctrl + P</strong> → to quickly go to any file I want</li><li><strong>Alt + ↑ / ↓</strong> → to move selected code lines up/down</li><li><strong>Shift + Alt + ↑ / ↓</strong> → to duplicate line up/down</li><li><strong>Ctrl + /</strong> → to toggle line comment</li><li><strong>Ctrl + F</strong> → to find text in the current file</li><li><strong>Ctrl + D</strong> → to add next match to selection</li><li><strong>Ctrl + Alt + ↑ / ↓</strong> → to insert cursor above/below</li><li><strong>Ctrl + S</strong>→ to save the current file</li><li><strong>Ctrl + B</strong> → to toggle sidebar visibility</li><li><strong>Ctrl + Shift + F</strong>→ to search across the whole project</li><li><strong>Ctrl + &#39;</strong> → to open the integrated terminal</li><li><strong>Ctrl + Shift + P</strong> → to open Command Palette</li></ul><p>Reference: <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf">VS Code Keyboard Shortcuts for Windows Cheatsheet</a></p><h3>Key Takeaways</h3><ul><li><strong>Store Securely:</strong> Keep Telegram Bot Token &amp; Chat ID editable in Sanity for client management without coding</li><li><strong>Group Fields:</strong> Use object fields in schema files to logically group related settings like Telegram credentials</li><li><strong>Fetch Centrally:</strong> Load Telegram settings via GROQ and pass through SvelteKit layout for consistent access</li><li><strong>Send Instantly:</strong> Trigger Telegram messages from the form via fetch and Bot API with rich formatting</li><li><strong>Handle Feedback:</strong> Use reactive variables or toast libraries to show real-time success/error states</li><li><strong>Use Shortcuts</strong>: Utilize VS Code keyboard shortcuts to speed up everyday development tasks</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll show how I deployed frontend and backend separately to Vercel with custom domain and subdomain.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e6848a6ad8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-c5f8dfb35369?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5f8dfb35369</guid>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sveltekit]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 22:59:46 GMT</pubDate>
            <atom:updated>2025-08-07T22:59:46.863Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 6: How I Integrated Sanity and Structured the CMS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmlST2FRjb84ROosPqOnCA.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 6 of my 10-part “Concept to Launch” series, where I break down how I built a multilingual website for an accounting firm in Uzbekistan using SvelteKit and Sanity CMS.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-3a74d03b10ef">Part 5</a>, I shared how I used props to make my UI components dynamic and easily customizable. Today, we’ll discover how to set up Sanity as the headless CMS to handle all the editable content on the site.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Sanity Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tj_pmeecBFnfnmcP4sjmGg.png" /><figcaption>Sanity Setup</figcaption></figure><p>We’ve been using the minimal <a href="https://www.sanity.io/templates/sveltekit-sanity-clean">SvelteKit + Sanity starter template</a> from the beginning, focusing solely on the frontend so far to understand the project’s structure and components. I waited to integrate Sanity until all frontend components and prop interfaces were defined to ensure smoother integration later on. This allowed me to:</p><ul><li>Avoid restructuring frontend logic halfway through</li><li>Finalize reusable components and layout</li><li>Identify what data could remain static</li><li>Define what content should be editable by the client</li><li>Structured pages with static placeholder data</li><li>Set up props and logic cleanly</li></ul><p>The starter template comes pre-configured with a Sanity Studio, but let’s make sure we have the template set up correctly. First, I ran this command in the terminal to scaffold the full project:</p><pre>npm create sanity@latest -- --template sanity-io/sanity-template-sveltekit-clean</pre><p>This created a monorepo with:</p><ul><li>studio/ folder → houses Sanity Studio</li><li>sveltekit-app/ folder → SvelteKit app pre-configured for Sanity</li></ul><p>Once initialized, I then ran the Sanity Studio in the studio/ folder:</p><pre>cd &lt;your app name&gt;<br>cd studio<br>npm run dev</pre><p>This starts the Sanity Studio on <a href="http://localhost:5173/">http://localhost:3333</a> where I signed in using GitHub and was ready to start adding schema types.</p><p>By default, the template comes with a pre-defined Post document type. At this point, I learned how to structure the documents, so I removed the files created by default. I reviewed each page and listed what the client should control. This helped me plan schema types and decide between standalone or nested documents. Here’s what I planned to be dynamic:</p><ol><li><strong>Homepage:</strong> Hero, Services list, Testimonials, CTA, Partners, FAQ</li><li><strong>About:</strong> Company intro, timeline/history</li><li><strong>Services:</strong> Service list + individual service pages (with pricing)</li><li><strong>Team:</strong> Each member as a separate entry</li><li><strong>Articles:</strong> Blog posts + categories</li><li><strong>Certificates:</strong> Each certificate with image &amp; metadata</li><li><strong>Contact:</strong> Phone, email, socials, working hours, Telegram config</li></ol><h3>Schema Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBwBDXwnODido9PBa19njA.png" /><figcaption>Schema Structure</figcaption></figure><p>In Sanity, <a href="https://www.sanity.io/docs/apis-and-sdks/introduction-to-schemas">schemas</a> define how content is structured in the CMS. To include additional content types, I began creating schema types under sanity/schemaTypes/ folder. I kept types modular and localized fields flexible for multilingual support. Here are all the content types I created in this project:</p><pre>schemaTypes/<br>├── article.ts<br>├── articleCategory.ts<br>├── blockContent.ts<br>├── certificate.ts<br>├── contact.ts<br>├── faq.ts<br>├── index.ts<br>├── localeBlockContent.ts<br>├── localeString.ts<br>├── localeText.ts<br>├── partner.ts<br>├── pricing.ts<br>├── service.ts<br>├── teamMember.ts<br>└── testimonial.ts</pre><p>To create a new schema, you need to do these 3 things:</p><ol><li>Declare schemas in separate files under schemaTypes/ folder</li><li>Import all schemas under schema.types array in schemaTypes/index.ts</li><li>Import schema.types in the root configuration in sanity.config.ts file</li></ol><p>For example, for my service content type, I followed the same approach:</p><ul><li>Declared service schema in a separate file:</li></ul><pre>// schemaTypes/service.ts<br>import {defineType, defineField} from &#39;sanity&#39;<br><br>export const service = defineType({<br>  name: &#39;service&#39;,<br>  title: &#39;Service&#39;,<br>  type: &#39;document&#39;,<br>  fields: [<br>    defineField({<br>      name: &#39;title&#39;,<br>      title: &#39;Service Title&#39;,<br>      type: &#39;localeString&#39;,<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    defineField({<br>      name: &#39;image&#39;,<br>      title: &#39;Service Image&#39;,<br>      type: &#39;image&#39;,<br>      options: {hotspot: true},<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    {<br>      name: &#39;orderRank&#39;,<br>      title: &#39;Order Rank&#39;,<br>      type: &#39;string&#39;,<br>      hidden: true,<br>    },<br>  ],<br>  preview: {<br>    select: {<br>      title: &#39;title.ru&#39;,<br>      media: &#39;image&#39;,<br>    },<br>  },<br>};</pre><ul><li>Imported service schema in schemaTypes/index.ts:</li></ul><pre>// schemaTypes/index.ts<br>import {service} from &#39;./service&#39;<br><br>export const schemaTypes = [<br>  service,<br>]</pre><ul><li>Imported schema.types in the root configuration in sanity.config.ts file to register it in the studio:</li></ul><pre>// sanity.config.ts<br>import { defineConfig } from &#39;sanity&#39;<br>import { structureTool } from &#39;sanity/structure&#39;<br>import { schemaTypes } from &#39;./schemaTypes&#39;<br><br>export default defineConfig({<br>  name: &#39;default&#39;,<br>  title: &#39;My Sanity Project&#39;,<br><br>  projectId: &#39;your-project-id&#39;,<br>  dataset: &#39;production&#39;,<br><br>  plugins: [structureTool()],<br><br>  schema: {<br>    types: schemaTypes,<br>  },<br>})</pre><h3>Studio Customization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6QscusN5IP-rhlaQpfcZA.png" /><figcaption>Studio Customization</figcaption></figure><p>While building the Sanity Studio, I ran into some customization challenges that I want to share below in case you face similar issues. Most of these were optional to do, but I made sure I added these to make it easier for clients to add data.</p><p>I found solutions through reading the documentation, asking ChatGPT for help, Googling similar problems, and searching Stack Overflow for tips. Here’s what I learned:</p><h4>1. Code Duplication</h4><p><strong><em>What I needed: </em></strong>I needed multilingual support but didn’t want to rely on plugins because I wanted full control over the translations</p><p><strong><em>Where I struggled: </em></strong>Manually repeating language fields for 3 languages (English, Russian, Uzbek) in every schema was getting messy</p><p><strong><em>How I overcame: </em></strong>I created reusable field types - localeString and localeBlockContent - to simplify schema definitions. Here’s how I defined multilingual fields as reusable types in localeString:</p><pre>// localeString.ts<br>import {defineType, defineField} from &#39;sanity&#39;<br><br>export const localeString = defineType({<br>  name: &#39;localeString&#39;,<br>  type: &#39;object&#39;,<br>  title: &#39;Localized String&#39;,<br>  fields: [<br>    defineField({name: &#39;ru&#39;, type: &#39;string&#39;, title: &#39;Russian&#39;}),<br>    defineField({name: &#39;uz&#39;, type: &#39;string&#39;, title: &#39;Uzbek&#39;}),<br>    defineField({name: &#39;en&#39;, type: &#39;string&#39;, title: &#39;English&#39;}),<br>  ],<br>})</pre><h4>2. Content Preview</h4><p><strong><em>What I needed: </em></strong>A cleaner editing experience for clients</p><p><strong><em>Where I struggled: </em></strong>I considered creating a detailed Editor’s Guide, but that felt time-consuming and hard to keep updated</p><p><strong><em>How I overcame: </em></strong>I added custom preview configurations and used field description values to guide editors directly in the Studio:</p><pre>// schemaTypes/service.ts<br>import {defineType, defineField} from &#39;sanity&#39;<br><br>export const service = defineType({<br>  name: &#39;service&#39;,<br>  title: &#39;Service&#39;,<br>  type: &#39;document&#39;,<br>  fields: [<br>    defineField({<br>      name: &#39;title&#39;,<br>      title: &#39;Service Title&#39;,<br>      type: &#39;localeString&#39;,<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    defineField({<br>      name: &#39;image&#39;,<br>      title: &#39;Service Image&#39;,<br>      type: &#39;image&#39;,<br>      options: {hotspot: true},<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    {<br>      name: &#39;orderRank&#39;,<br>      title: &#39;Order Rank&#39;,<br>      type: &#39;string&#39;,<br>      hidden: true,<br>    },<br>  ],<br>  preview: {<br>    select: {<br>      title: &#39;title.ru&#39;,<br>      media: &#39;image&#39;,<br>    },<br>  },<br>};</pre><p>By doing this, I made the Studio much more intuitive for non-technical users. Instead of reading a guide, they get visual feedback and inline tips while editing.</p><h4>3. Portable Text</h4><p><strong><em>What I needed: </em></strong>Rich text rendering for content like articles and service descriptions</p><p><strong><em>Where I struggled: </em></strong>I used the @portabletext/svelte package, but ran into TypeScript issues - especially when trying to customize components for rich text blocks</p><p><strong><em>How I overcame: </em></strong>I used the localeBlockContent type to support multilingual rich text (it is built on Sanity’s blockContent type and accepts content in 3 languages):</p><pre>// schemaTypes/service.ts<br>defineField({<br>  name: &#39;detail&#39;,<br>  title: &#39;Service Detail&#39;,<br>  type: &#39;localeBlockContent&#39;,<br>  validation: (Rule) =&gt; Rule.required(),<br>})<br><br><br>// schemaTypes/blockContent.ts<br>import {defineType} from &#39;sanity&#39;<br><br>export const blockContent = defineType({<br>  name: &#39;blockContent&#39;,<br>  title: &#39;Block Content&#39;,<br>  type: &#39;array&#39;,<br>  of: [<br>    {<br>      type: &#39;block&#39;,<br>    },<br>    {<br>      type: &#39;image&#39;,<br>      options: {hotspot: true},<br>    },<br>  ],<br>})<br><br>// schemaTypes/localeBlockContent.ts<br>import {defineType, defineField} from &#39;sanity&#39;<br><br>export const localeBlockContent = defineType({<br>  name: &#39;localeBlockContent&#39;,<br>  title: &#39;Localized Block Content&#39;,<br>  type: &#39;object&#39;,<br>  fields: [<br>    defineField({name: &#39;ru&#39;, title: &#39;Russian&#39;, type: &#39;blockContent&#39;}),<br>    defineField({name: &#39;uz&#39;, title: &#39;Uzbek&#39;, type: &#39;blockContent&#39;}),<br>    defineField({name: &#39;en&#39;, title: &#39;English&#39;, type: &#39;blockContent&#39;}),<br>  ],<br>})</pre><h4>4. Image Rendering</h4><p><strong><em>What I needed: </em></strong>A way for clients to upload and manage images for services and articles</p><p><strong><em>Where I struggled: </em></strong>Sanity uses image references, so rendering images on the frontend requires generating URLs via @sanity/image-url. But I hit import issues with that package in my Vite + sanity.config.ts setup</p><p><strong><em>How I overcame: </em></strong>I skipped the URL builder for now and used the hotspot option in Sanity to help manage image cropping. On the frontend, I pulled the direct asset URL when available:</p><pre>// schemaTypes/service.ts<br>defineField({<br>  name: &#39;image&#39;,<br>  title: &#39;Service Image&#39;,<br>  type: &#39;image&#39;,<br>  options: {hotspot: true},<br>  validation: (Rule) =&gt; Rule.required(),<br>})<br><br>// /src/lib/queries/serviceQuery.ts<br>image: {<br>  asset?: {<br>    _id: string;<br>    url: string;<br>  };<br>}</pre><h4>5. Orderable Lists</h4><p><strong><em>What I needed: </em></strong>Control over the order of items like FAQs, Services, Articles, etc., especially for frontend rendering</p><p><strong><em>Where I struggled: </em></strong>I tried using the @sanity/orderable-document-list plugin for drag-and-drop ordering, but ran into import issues due to my project’s setup</p><p><strong><em>How I overcame: </em></strong>I manually added an orderRank field in relevant schema types and used the plugin&#39;s orderableDocumentListDeskItem in structure.ts. On the frontend, I simply sorted content with order(orderRank) in my GROQ queries:</p><pre>// schemaTypes/service.ts<br>defineField({<br>  name: &#39;orderRank&#39;,<br>  title: &#39;Order Rank&#39;,<br>  type: &#39;string&#39;,<br>  hidden: true, // keep it out of the editor UI<br>}),<br><br>// structure.ts<br>import {orderableDocumentListDeskItem} from &#39;@sanity/orderable-document-list&#39;<br>import {StructureBuilder} from &#39;sanity/structure&#39;<br><br>export const structure = (S: StructureBuilder, context: any) =&gt;<br>  S.list()<br>    .title(&#39;Content&#39;)<br>    .items([<br>      orderableDocumentListDeskItem({<br>        type: &#39;service&#39;,<br>        title: &#39;Services&#39;,<br>        S,<br>        context,<br>      }),<br>      orderableDocumentListDeskItem({<br>        type: &#39;faq&#39;,<br>        title: &#39;FAQs&#39;,<br>        S,<br>        context,<br>      }),<br>      orderableDocumentListDeskItem({<br>        type: &#39;article&#39;,<br>        title: &#39;Articles&#39;,<br>        S,<br>        context,<br>      }),<br>      // Add more as needed...<br>      S.documentTypeListItem(&#39;contact&#39;).title(&#39;Contact&#39;),<br>    ])<br><br>// /src/lib/queries/serviceQuery.ts<br>*[_type == &quot;service&quot;] | order(orderRank) {<br>  _id,<br>  title,<br>  ...<br>}</pre><h4>6. Nested Schema</h4><p><strong><em>What I needed: </em></strong>A clean way to manage structured and reusable content across the site (e.g. article categories)</p><p><strong><em>Where I struggled: </em></strong>Manually repeating nested structures in every schema was inefficient and hard to maintain</p><p><strong><em>How I overcame: </em></strong>I used type: &#39;reference&#39; to link documents (like articles to categories) to keep things organized:</p><pre>// schemaTypes/article.ts<br>defineField({<br>  name: &#39;category&#39;,<br>  title: &#39;Article Category&#39;,<br>  type: &#39;reference&#39;,<br>  to: [{type: &#39;articleCategory&#39;}],<br>  validation: (Rule) =&gt; Rule.required(),<br>}),<br><br>// schemaTypes/articleCategory.ts<br>import {defineType, defineField} from &#39;sanity&#39;<br><br>export const articleCategory = defineType({<br>  name: &#39;articleCategory&#39;,<br>  title: &#39;Article Categories&#39;,<br>  type: &#39;document&#39;,<br>  fields: [<br>    defineField({<br>      name: &#39;title&#39;,<br>      title: &#39;Category Title&#39;,<br>      type: &#39;localeString&#39;,<br>      validation: (Rule) =&gt; Rule.required(),<br>    }),<br>    {<br>      name: &#39;orderRank&#39;,<br>      title: &#39;Order Rank&#39;,<br>      type: &#39;string&#39;,<br>      hidden: true,<br>    },<br>  ],<br>  preview: {<br>    select: {<br>      title: &#39;title.ru&#39;,<br>    },<br>  },<br>})</pre><h4>7. Slug Fields</h4><p><strong><em>What I needed: </em></strong>A way to identify articles and services via clean, unique URLs</p><p><strong><em>Where I struggled: </em></strong>I experimented with slugify and manual slug fields but found them overkill for my use case</p><p><strong><em>How I overcame: </em></strong>I used Sanity’s built-in _id field as a unique identifier and skipped custom slug fields altogether to simplify the schema and reduce potential duplication or collision issues:</p><pre>// /src/lib/types/service.ts<br><br>export interface Service {<br>  id: string;<br>  title: {<br>    ru: string;<br>    uz: string;<br>    en: string;<br>  };<br>  description: {<br>    ru: string;<br>    uz: string;<br>    en: string;<br>  };<br>  image: string;<br>}<br><br>// /src/lib/queries/serviceQuery.ts<br>const data = await sanity.fetch(`*[_type == &quot;service&quot;] | order(orderRank){<br>  _id,<br>  title,<br>  description,<br>  image {<br>    asset-&gt;{<br>      _id,<br>      url<br>    }<br>  }<br>}`)<br><br>return data.map((item) =&gt; ({<br>  id: item._id, // use as route param or identifier<br>  title: item.title,<br>  description: item.description,<br>  image: item.image.asset?.url,<br>}))</pre><h4>8. Date</h4><p><strong><em>What I needed: </em></strong>Let editors pick a calendar date for content like articles and show it properly to users</p><p><strong><em>Where I struggled: </em></strong>Since my site supports multiple languages, I initially tried to localize the date itself by creating a separate date per language - which quickly became messy</p><p><strong><em>How I overcame: </em></strong>I used Sanity’s built-in date type and formatted the single stored value on the frontend using a helper function (dayjs), keeping things simple and language-aware:</p><pre>// schemaTypes/article.ts<br>defineField({<br>  name: &#39;date&#39;,<br>  title: &#39;Article Date&#39;,<br>  type: &#39;date&#39;,<br>  description: &#39;Pick a date (e.g. July 18, 2025)&#39;,<br>  validation: (Rule) =&gt; Rule.required(),<br>  options: {<br>    dateFormat: &#39;DD-MM-YYYY&#39;, // this is just for editor display<br>  },<br>})<br><br>// /src/lib/types/article.ts<br>export interface Article {<br>  id: string;<br>  title: LocalizedString;<br>  date: string; // formatted on the frontend<br>  image: string;<br>  category: {<br>    id: string;<br>    title: LocalizedString;<br>  };<br>}<br><br>// /src/lib/queries/articleQuery.ts<br>import { formatDate } from &#39;$lib&#39;;<br><br>...<br><br>return data.map((item: RawArticle) =&gt; ({<br>  id: item._id,<br>  title: item.title,<br>  date: formatDate(item.date), // format at runtime<br>  ...<br>}));<br><br>// /src/lib/index.ts<br><br>import dayjs from &#39;dayjs&#39;;<br><br>export function formatDate(date: string): string {<br>  return dayjs(date).format(&#39;DD-MM-YYYY&#39;);<br>}</pre><h3>Querying Data</h3><p>After structuring content using Sanity schemas, the next step is fetching the data with <a href="https://www.sanity.io/docs/content-lake/how-queries-work">GROQ</a> (Sanity’s query language). To keep things organized and scalable, I centralized all my Sanity-related logic into two places:</p><ol><li>/src/lib/queries/*.ts: where I define all my GROQ queries</li><li>/src/lib/types/*.ts: where I define TypeScript interfaces to match the data returned from these queries</li></ol><p>This modular structure ensures that both the query logic and types are easy to maintain and extend. Here’s a step-by-step explanation of how I fetch data from Sanity and display it in the app:</p><h4>1. <strong>Sanity Client</strong></h4><p>To connect to Sanity and fetch data, I created a client using @sanity/client and configured it to pull data based on environment variables. This client is used throughout the app for executing queries.</p><pre>// src/lib/sanityClient.ts<br>import { createClient } from &#39;@sanity/client&#39;;<br>import imageUrlBuilder from &#39;@sanity/image-url&#39;;<br>import type { SanityImageSource } from &#39;@sanity/image-url/lib/types/types&#39;;<br><br>export const sanity = createClient({<br>  projectId: import.meta.env.VITE_SANITY_PROJECT_ID,<br>  dataset: import.meta.env.VITE_SANITY_DATASET || &#39;production&#39;,<br>  apiVersion: &#39;2023-10-01&#39;,<br>  useCdn: false, // false during development for fresh content<br>  token: import.meta.env.SANITY_READ_TOKEN // read-only token<br>});</pre><p>useCdn: false: Ensures data fetched during development reflects recent changes, instead of cached content</p><h4>2. <strong>Utility Functions</strong></h4><p>I created helper functions that can be reused across the app. For example, readData() takes care of localizing content based on the user’s locale.</p><pre>// src/lib/index.ts<br>import { getLocale } from &#39;$lib/paraglide/runtime&#39;;<br>import dayjs from &#39;dayjs&#39;;<br><br>export function readData(item: Record&lt;string, string&gt;): string {<br> const lang = getLocale();<br> return item[lang] || item[&#39;ru&#39;];<br>}<br><br>export function formatDate(date: string): string {<br> const formatted = dayjs(date).format(&#39;DD-MM-YYYY&#39;);<br> return formatted;<br>}</pre><p>This keeps the logic for fetching and formatting data clean and reusable.</p><h4>3. <strong>GROQ Queries</strong></h4><p>To fetch services data, I defined a specific GROQ query inside /src/lib/queries/serviceQuery.ts. This query retrieves a list of services along with localized fields and images.</p><pre>// src/lib/queries/serviceQuery.ts<br>import { sanity } from &#39;../sanityClient&#39;;<br>import type { Service } from &#39;../types/service&#39;;  // Import types for expected data<br><br>type RawService = {<br>  _id: string;<br>  title: { ru: string; uz: string; en: string };<br>  description: { ru: string; uz: string; en: string };<br>  image: { asset: { _id: string; url: string } };<br>};<br><br>export const fetchServices = async (): Promise&lt;Service[]&gt; =&gt; {<br>  const data = await sanity.fetch(`*[_type == &quot;service&quot;] | order(orderRank) {<br>    _id, title, description, image { asset-&gt; { _id, url } }<br>  }`);<br><br>  return data.map((item: RawService) =&gt; ({<br>    id: item._id,<br>    title: item.title,<br>    description: item.description,<br>    image: item.image.asset?.url<br>  }));<br>};</pre><ul><li>The fetchServices() query retrieves all services, orders them by orderRank, and formats the data to include only the required fields (id, title, description, image)</li></ul><p>This query is used later in different parts of the app (e.g., service listings, service details).</p><h4>4. <strong>TypeScript Interfaces</strong></h4><p>I defined TypeScript interfaces in /src/lib/types/service.ts to ensure type safety when working with the fetched data.</p><pre>// src/lib/types/service.ts<br>export interface Service {<br>  id: string;<br>  title: {<br>    ru: string;<br>    uz: string;<br>    en: string;<br>  };<br>  description: {<br>    ru: string;<br>    uz: string;<br>    en: string;<br>  };<br>  image: string;  // URL of the service image<br>}<br><br>export interface ServiceDetails extends Service {<br>  detail: LocaleBlockContent;  // The detail field can be a rich-text field (PortableText)<br>  pricingPlans: PricingPlan[];<br>}<br><br>export type PricingPlan = {<br>  plan: { ru: string; uz: string; en: string };<br>  amount: number;<br>  text: LocalizedString;<br>  points: LocalizedPoints;<br>};</pre><ul><li>The Service interface represents the structure for a service (with localized fields for title and description)</li><li>The ServiceDetails interface extends Service to include detailed content and pricing information</li></ul><h4>5. <strong>Routes </strong>Queries</h4><p>In src/routes/+page.ts, I called fetchServices() to get a list of services and passed it to the Svelte component for rendering. I also combined the data with some static content (e.g. from home.json).</p><pre>// src/routes/+page.ts<br>import { fetchServices } from &#39;$lib/queries/serviceQuery&#39;;<br>import home from &#39;../data/home.json&#39;;<br><br>export async function load() {<br>  const services = await fetchServices();<br>  <br>  return {<br>    hero: home.hero,<br>    service: {<br>      ...home.service,<br>      data: services.slice(0, 4)  // Only show the first 4 services<br>    },<br>  };<br>}</pre><h4>6. Data Rendering</h4><p>The data returned from load() is passed to the component, where I used Svelte syntax to render the services dynamically.</p><pre>&lt;!-- src/routes/+page.svelte --&gt;<br>&lt;script lang=&quot;ts&quot;&gt;<br>  import { m } from &#39;$lib/paraglide/messages&#39;;<br>  import Services from &#39;../components/sections/Services.svelte&#39;;<br>  const { data } = $props();<br>  const { hero, service } = data;<br>&lt;/script&gt;<br><br>&lt;Hero {hero} /&gt;<br>&lt;Services {service} showButton={true} /&gt;</pre><ul><li>The Services component receives the list of services and render them</li></ul><h4>7. Fetching Data for a Specific Service</h4><p>When navigating to a detailed service page, I fetched specific details for that service using fetchServiceDetails(), and then passed the data to the Svelte component.</p><pre>// src/routes/services/[service_id]/+page.ts<br>import { fetchServiceDetails } from &#39;$lib/queries/serviceQuery&#39;;<br>import home from &#39;../../../data/home.json&#39;;<br><br>export async function load({ params }) {<br>  const serviceId = params.service_id;<br>  const service = await fetchServiceDetails(serviceId);<br><br>  return {<br>    service: {<br>      ...home.service,<br>      data: service<br>    },<br>  };<br>}</pre><h4>8. Rendering Service Details</h4><p>In the service detail page, I rendered the fetched service data, including rich-text content (via WysiwygOutput) and pricing information.</p><pre>&lt;!-- src/routes/services/[service_id]/+page.svelte --&gt;<br>&lt;script&gt;<br>  import { getLocale } from &#39;$lib/paraglide/runtime&#39;;<br>  import Breadcrumb from &#39;../../../components/layout/Breadcrumb.svelte&#39;;<br>  import Pricing from &#39;../../../components/sections/Pricing.svelte&#39;;<br>  import WysiwygOutput from &#39;../../../components/ui/WysiwygOutput.svelte&#39;;<br>  const { data } = $props();<br>  const service = data.service;<br>  const lang = getLocale();<br>  const pricingData = service.data.pricingPlans.map(item =&gt; ({<br>    plan: item.plan[lang],<br>    amount: item.amount,<br>    text: item.text[lang],<br>    points: item.points[lang],<br>    popular: false<br>  }));<br>&lt;/script&gt;<br><br>&lt;Breadcrumb title={service.tag[lang]} /&gt;<br>&lt;section&gt;<br>  &lt;div&gt;<br>    &lt;h5&gt;{service.data.title[lang]}&lt;/h5&gt;<br>    &lt;p&gt;{service.data.description[lang]}&lt;/p&gt;<br>  &lt;/div&gt;<br>  &lt;WysiwygOutput value={service.data.detail[lang]} /&gt;<br>  &lt;Pricing {pricingData} /&gt;<br>&lt;/section&gt;</pre><p>By organizing the code into modular files and keeping the service schema consistent across the app, I ensure that fetching data with GROQ is clean, reusable, and easy to maintain. This approach makes it easy to scale the application and add new content types in the future.</p><h3>Key Takeaways</h3><ul><li><strong>Integrate Later:</strong> Finalize frontend components and prop structures before connecting Sanity to reduce schema rework</li><li><strong>Structure Clearly:</strong> Use modular schema files and localized field types to support multilingual content cleanly</li><li><strong>Customize Studio:</strong> Enhance the editing experience with field descriptions, previews, and reusable localized fields</li><li><strong>Manage Order:</strong> Use hidden orderRank fields and @sanity/orderable-document-list to support sortable content without bloating the UI</li><li><strong>Format Dates:</strong> Store a single ISO date in Sanity and format it using dayjs based on locale at render time</li><li><strong>Query Modularly:</strong> Centralize all GROQ queries in /lib/queries and mirror them with TypeScript types in /lib/types for clarity</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll show how I used the Telegram Bot API to deliver real-time contact form messages directly to the client’s inbox.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5f8dfb35369" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-3a74d03b10ef?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a74d03b10ef</guid>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 20:32:37 GMT</pubDate>
            <atom:updated>2025-08-06T20:32:37.266Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Part 5: How I Used Props to Make Components Dynamic</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mrnqQCsgtdN3dTxdmtCLdA.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 5 of my 10-part “Concept to Launch” series, where I’m sharing the step-by-step journey of creating a full-stack website for an accounting firm using SvelteKit and Sanity CMS.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-8462179a07d7">Part 4</a>, I shared how I built reusable components and used static data to create a modular UI. Today, we’ll explore how props made my components dynamic, flexible, and easy to customize.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Component Composition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkXfBtcMgJK1WiWfSftb7A.png" /><figcaption>Component Composition Flow</figcaption></figure><p>When building this project, I wanted a clear separation between different parts of the app. That’s why I created a src/components/ui/ folder to hold small, reusable UI components that accept props and are used by larger layout and page components. Here’s what the folder looks like:</p><pre>src/<br>└── components/<br>    └── ui/<br>        ├── ArticleCard.svelte<br>        ├── FaqAccordionItem.svelte<br>        ├── FaqBanner.svelte<br>        ├── LanguageToggler.svelte<br>        ├── Modal.svelte<br>        ├── NavItem.svelte<br>        ├── SectionTitle.svelte<br>        ├── ServiceCard.svelte<br>        ├── TeamMemberCard.svelte<br>        ├── TestimonialCard.svelte<br>        └── WysiwygOutput.svelte</pre><p>Each file is a small building block of the app. For example:</p><ul><li>SectionTitle renders a styled heading</li><li>ServiceCard shows details about one service</li></ul><p>This approach helped me avoid repeating styles or logic across the project. Instead, I combined these small components into larger ones. Here’s the flow:</p><ol><li>Building blocks are created in src/components/ui/</li><li>These blocks are then used in section components (src/components/sections/). For example, Services.svelte renders multiple ServiceCard components</li><li>Section components are then used in app pages (src/routes/). For instance, the main Services page loads the Services section</li><li>Data from Sanity is fetched in route load functions (+page.ts). It’s passed down as props from pages → sections → UI components</li></ol><p>Here’s how a component like SectionTitle moves through the app:</p><ul><li>In ui/SectionTitle.svelte, I define a component with props:</li></ul><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  const { title, description, button, tag } = $props();<br>&lt;/script&gt;<br><br>&lt;h2&gt;{title}&lt;/h2&gt;</pre><ul><li>In sections/ServicesSection.svelte, I pass props to the component:</li></ul><pre>&lt;SectionTitle<br>  tag={service.tag[lang]}<br>  title={service.title[lang]}<br>  button={showButton ? { text: service.button.title[lang], link: service.button.path } : undefined}<br>  description={showButton ? undefined : service.description[lang]}<br>/&gt;<br><br>{#each service.data as item}<br>  &lt;ServiceCard service={item} /&gt;<br>{/each}</pre><ul><li>In routes/services/+page.ts, I fetch services from Sanity:</li></ul><pre>export async function load() {<br>  const services = await fetchServices();<br>  return {<br>    service: {<br>      ...home.service,<br>      data: services<br>    }<br>  };<br>}</pre><ul><li>In routes/services/+page.svelte, I pass service data to the section:</li></ul><pre>&lt;Services {service} /&gt;</pre><p>This clear layering made the app easier to debug and maintain. Pages handle data fetching, sections handle layout and composition, and UI components focus purely on presentation.</p><h3>Dynamic Components</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuW6CcVypjjxZuAr91WCCA.png" /><figcaption>Dynamic Components</figcaption></figure><p>Once the structure was in place, the next step was to make components dynamic and reusable - that’s where props came in.</p><p>SvelteKit is built on top of Svelte, so UI components are written in Svelte, and <a href="https://svelte.dev/docs/svelte/$props">props</a> are the main way to pass data into them. I used props to control content, styles, and behavior in components like:</p><ul><li>SectionTitle (title, alignment, optional description or button)</li><li>Modal (open state, content, close function)</li><li>FaqAccordionItem (question/answer pairs)</li></ul><p>This kept components flexible and decoupled from specific use cases.</p><p>Let’s see my &lt;ServiceCard&gt; component as an example. It accepts a service prop with a localized title, description, image, and ID. Here’s the simplified version:</p><pre>&lt;!-- ServiceCard.svelte --&gt;<br>&lt;script lang=&quot;ts&quot;&gt;<br> import { getLocale } from &#39;$lib/paraglide/runtime&#39;;<br> import type { Service } from &#39;$lib/types/service&#39;;<br> const { service }: { service: Service } = $props();<br> const lang = getLocale();<br>&lt;/script&gt;<br><br>&lt;div&gt;<br> &lt;h5&gt;{service.title?.[lang]}&lt;/h5&gt;<br> &lt;p&gt;{service.description?.[lang]}&lt;/p&gt;<br><br> {#if service.image}<br>  &lt;img src={service.image} alt={service.title?.[lang]} /&gt;<br> {/if}<br>&lt;/div&gt;</pre><p>Inside the component, I used:</p><ul><li>let { service }: { service: Service } = $props(); to receive the data</li><li>Optional chaining like service.title?.[lang] to avoid runtime errors</li><li>{#if} to render the image only when it exists</li></ul><p>Then in the Services.svelte section component, I loop through an array of services using {#each} and render one ServiceCard for each item. This section also receives all its data through props, including localization and a button toggle:</p><pre>&lt;!-- Services.svelte --&gt;<br>&lt;SectionTitle title={service.title[lang]} /&gt;<br>{#each service.data as item}<br> &lt;ServiceCard service={item} /&gt;<br>{/each}</pre><p>The data comes from Sanity CMS via the page’s load function. The structure looks like this: Sanity → Route (+page.ts) → Section → UI Component</p><p>When working with external data like Sanity, you can’t assume every field will always exist. To avoid crashes or broken UIs, I used defensive patterns like:</p><ul><li>Optional chaining (e.g. service.title?.[lang]) to avoid runtime errors</li><li>Fallbacks (e.g. let { title = &#39;Default&#39; }) to cover edge cases</li><li>Conditional rendering ({#if} blocks) to skip unavailable data</li></ul><p>These small safeguards made my components safe by default, reducing crashes during loading or when content unexpectedly changed in Sanity.</p><p>Overall, having a dedicated ui component folder gave me a clean separation of concerns:</p><ul><li>Logic lives in route loaders and section components</li><li>UI components only care about how to render the props they receive</li><li>Everything stays reusable, testable, and easy to update</li></ul><h3>Practical Integration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vfL7Q1xXG8urIvAFphc1Q.png" /><figcaption>Practical Integration</figcaption></figure><p>As the project scaled, I needed to think beyond layout and structure. The UI needed to support multiple languages, meet accessibility standards, and handle rich content from Sanity.</p><h4>1. Localization</h4><p>The site needed to support Uzbek, Russian, and English. I used getLocale() from <a href="https://svelte.dev/docs/cli/paraglide">Paraglide</a> runtime to detect the active language and passed it into components to render localized content. Here is how I pulled localized strings in ServiceCard.svelte component:</p><pre>&lt;h5&gt;{service.title?.[lang]}&lt;/h5&gt;<br>&lt;p&gt;{service.description?.[lang]}&lt;/p&gt;</pre><p>To allow users to switch languages at runtime, I created a LanguageToggler.svelte component using getLocale() and setLocale():</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br> import { browser } from &#39;$app/environment&#39;;<br> import { setLocale, getLocale } from &#39;$lib/paraglide/runtime&#39;;<br><br> const languages = [<br>  { code: &#39;uz&#39;, label: &#39;UZ&#39; },<br>  { code: &#39;ru&#39;, label: &#39;RU&#39; },<br>  { code: &#39;en&#39;, label: &#39;EN&#39; }<br> ];<br><br> let languageTag = getLocale();<br><br> function changeLang(code: &#39;uz&#39; | &#39;ru&#39; | &#39;en&#39;) {<br>  setLocale(code);<br>  window.scrollTo({ top: 0, behavior: &#39;smooth&#39; });<br> }<br>&lt;/script&gt;<br><br>{#if browser}<br> &lt;div class=&quot;tab-toggler&quot;&gt;<br>  {#each languages as item}<br>   &lt;button<br>    on:click={() =&gt; changeLang(item.code)}<br>    class:selected={item.code === languageTag}<br>   &gt;<br>    {item.label}<br>   &lt;/button&gt;<br>  {/each}<br> &lt;/div&gt;<br>{/if}</pre><p>The browser check ensures the component runs only client-side, since setLocale() is not available during SSR. Once updated, all components using getLocale() re-renders automatically.</p><h4>2. Accessibility</h4><p>For interactive components like modals and accordions, I prioritized accessibility and UX by:</p><ul><li>Using semantic HTML (&lt;button&gt;, &lt;nav&gt;, &lt;section&gt;)</li><li>Managing focus when modals open/close</li><li>Adding aria-* attributes for screen reader support</li></ul><p>These practices made the app more usable and inclusive across all devices.</p><h4>3. Rich Content</h4><p>Sanity uses Portable Text for content like blog posts and page bodies. I rendered this using the official <a href="https://github.com/portabletext/svelte-portabletext/">@portabletext/svelte</a> package, but wrapped it in a Wysiwyg.svelte component to control styling:</p><pre>&lt;script&gt;<br> import { PortableText } from &#39;@portabletext/svelte&#39;;<br> const { value } = $props();<br>&lt;/script&gt;<br><br>&lt;div class=&quot;richtext&quot;&gt;<br> &lt;PortableText {value} /&gt;<br>&lt;/div&gt;</pre><p>I styled elements like headings, lists, and links globally so the layout stayed consistent - even if editors changed content in Sanity:</p><pre>:global(.richtext h2) {<br> font-size: 1.5rem;<br> font-weight: 600;<br> margin: 1.5rem 0 1rem;<br>}<br><br>:global(.richtext ul li::before) {<br> content: &#39;•&#39;;<br> position: absolute;<br> color: #374151;<br> font-weight: bold;<br>}</pre><p>This gave editors freedom while preserving design consistency.</p><h4>4. Build vs. Integrate</h4><p>A key part of frontend work is deciding what to build and what to integrate. My general rule of thumb:</p><ul><li>Build<strong> </strong>if it’s small, project-specific, and easy to test (e.g. LanguageToggler, NavItem, ServiceCard)</li><li>Integrate if it solves a well-known, complex problem (e.g. rich text rendering, focus-trap logic)</li></ul><p>Following this approach kept my codebase clean and minimized technical debt.</p><h3>Key Takeaways</h3><ul><li><strong>Design Modularly:</strong> Create reusable components in ui/ and compose them into larger layout sections and pages</li><li><strong>Maintain Flow:</strong> Pass data via props from Sanity → Route → Page → Section → UI</li><li><strong>Handle Safely:</strong> Use optional chaining, fallbacks, and conditional rendering for dynamic Sanity content</li><li><strong>Localize Thoughtfully:</strong> Use getLocale() and setLocale() to build multilingual support into components</li><li><strong>Improve Accessibility:</strong> Use semantic HTML and ARIA attributes to make components accessible to everyone</li><li><strong>Balance Integration:</strong> Build simple, project-specific features; integrate libraries for complex or generic needs</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll cover how I added Sanity to the project, structured the CMS folder, and defined schema types for content modeling.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a74d03b10ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-8462179a07d7?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/8462179a07d7</guid>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 22:43:30 GMT</pubDate>
            <atom:updated>2025-08-05T22:43:30.128Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 4: How I Built Reusable Components for a Modular UI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1dAXhm-LGXjP9m52SjJCw.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 4 of my 10-part “Concept to Launch” series, where I’m documenting how I built a full-stack website for an accounting firm using SvelteKit and Sanity CMS.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-6f2369c50234">Part 3</a>, I shared how I set up the codebase, GitHub, VS Code, and folder structure. Today, we’ll dive into how I built reusable components to make the frontend scalable and clean.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Component Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEKHtMz7gLt9CliIJ2Xqew.png" /><figcaption><a href="https://svelte.dev/docs/kit/project-structure">SvelteKit Project Structure Docs</a></figcaption></figure><p>Before writing any UI code, I spent some time thinking about where each type of component should live. Here’s what I ended up with:</p><pre>src/<br>└── components/<br>    ├── layout/       # Shared layout components (Navbar, Footer, etc.)<br>    ├── sections/     # Page-specific visual blocks (HeroSection, etc.)<br>    └── ui/           # Reusable, low-level UI components (Card,etc.)</pre><p>Each folder serves a single responsibility:</p><ol><li>layout/ contains components used across all pages</li><li>sections/ contains larger, page-specific chunks</li><li>ui/ contains small, reusable components that accept props</li></ol><p>This structure made it easier to:</p><ul><li>Reuse code across routes</li><li>Build and test components in isolation</li><li>Quickly swap data sources (e.g. static → CMS)</li></ul><p>These benefits really add up as the project grows - especially if you plan for them from the start. To stay consistent and avoid confusion later, I followed a few simple naming rules:</p><ol><li><strong>Component files:</strong> PascalCase (example: HeroSection.svelte)</li><li><strong>Folders:</strong> kebab-case (example: services, about)</li></ol><p>Keeping naming predictable makes it easier to find and refactor components, reuse sections across routes, and scale the codebase without friction.</p><p>Using clear and consistent names helps to quickly find and update components, reuse parts across pages, and grow the code smoothly.</p><h3>Page Anatomy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_UIJJCf1ppJD2S1KLyF4mA.png" /><figcaption>Page Anatomy</figcaption></figure><p>Now that the components are organized, let’s look at how everything comes together on a page. Svelte files follow a consistent structure that’s easy to work with:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  export let title: string;<br>  export let icon: string;<br>&lt;/script&gt;<br><br>&lt;div class=&quot;card&quot;&gt;<br>  &lt;img src={icon} alt={title} /&gt;<br>  &lt;h3&gt;{title}&lt;/h3&gt;<br>&lt;/div&gt;<br><br>&lt;style&gt;<br>  .card {<br>    padding: 1rem;<br>    border-radius: 8px;<br>    background: white;<br>    box-shadow: 0 0 10px rgba(0,0,0,0.05);<br>  }<br>&lt;/style&gt;</pre><p>This approach ensures:</p><ul><li>Props are typed for developer safety</li><li>HTML, logic, and styling live together</li><li>It’s easy to refactor without hunting through multiple files</li></ul><p>The main pages of the website are created inside the src/routes/ folder, where each subfolder maps to a route in the app:</p><pre>routes/<br>├── about/<br>│   ├── +page.svelte   // Renders About page<br>│   └── +page.ts       // Loads Sanity data (if needed)<br>├── services/<br>│   ├── +page.svelte<br>│   └── +page.ts<br>├── +page.svelte       // Homepage (index route)</pre><p>Each route includes:</p><ol><li>+page.svelte → handles UI layout using components (e.g. Header)</li><li>+page.ts → loads data from Sanity using GROQ queries</li></ol><p>At this point, I was still working on the UI, so I kept most of the logic inside the .svelte files and used static data. Later, I’ll show you how I enhanced this with dynamic props to make components customizable by the CMS.</p><h3>Static Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gcb1QI5Un9R8OxcvRdUtbA.png" /><figcaption>Static Data Development Workflow</figcaption></figure><p>Before connecting to Sanity, I prefer to work with static data during the early stages of development. It helps me focus on layout, structure, and logic without worrying about the backend. Here’s how I approach it:</p><p>If a section includes multiple items (like cards or features), I remove all but one to keep things simple and reduce visual clutter. This lets me focus on the structure of the component without distraction.</p><p>I store this static data at the top of the Svelte file in a variable, so everything is easy to manage in one place. For example:</p><pre>&lt;script&gt;<br>  const services = [<br>    {<br>      title: &#39;Tax Advisory&#39;,<br>      icon: &#39;/icons/tax.svg&#39;,<br>    },<br>    {<br>      title: &#39;Audit Services&#39;,<br>      icon: &#39;/icons/audit.svg&#39;,<br>    }<br>  ];<br>&lt;/script&gt;<br><br>&lt;main&gt;<br>  {#each services as service}<br>    &lt;Card {...service} /&gt;<br>  {/each}<br>&lt;/main&gt;</pre><p>Even though it’s hardcoded for now, this approach:</p><ul><li>Helps define the expected data shape (like arrays, nested fields, etc.)</li><li>Lets me identify what props each component should accept</li><li>Makes it easier to switch to CMS-driven data later with minimal changes</li></ul><p>If you’re working on a similar project, I recommend using static data for layout until you figure out everything you need. Even if the project doesn’t end up using Sanity, keeping all your data at the top of the file allows you to update content from a single place without digging through the JSX/Svelte code.</p><p>This separation of content and structure makes your components cleaner, more testable, and reusable.</p><h3>Component Examples</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RxtBmkHzUsbWoG09zhGuTw.png" /><figcaption>Basic SvelteKit Component</figcaption></figure><p>Now that we’ve looked at folder structure and data, let’s walk through each component folder to see what’s inside and how they’re used.</p><h4>1. Layout Components</h4><p>These components are used globally across multiple pages. It’s recommended to place them in the layout/ folder to reflect their reusability and persistent presence.</p><pre>components/<br>└── layout/<br>    ├── Breadcrumb.svelte<br>    ├── Footer.svelte<br>    └── Navbar.svelte</pre><p>They are typically imported and rendered inside the +layout.svelte file in routes/, which wraps all routes. For example:</p><pre>&lt;!-- src/routes/+layout.svelte --&gt;<br>&lt;script&gt;<br>  import Navbar from &#39;$components/layout/Navbar.svelte&#39;;<br>  import Footer from &#39;$components/layout/Footer.svelte&#39;;<br>&lt;/script&gt;<br><br>&lt;Navbar /&gt;<br>&lt;slot /&gt; &lt;!-- Renders the current page --&gt;<br>&lt;Footer /&gt;</pre><p>Here’s a simplified version of my Navbar component:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  export let pathname: string;<br>  export let contact = { phone: &#39;123-456-7890&#39;, companyLogo: &#39;/logo.png&#39; };<br>  export let services = [<br>    { id: &#39;1&#39;, title: &#39;Service One&#39; },<br>    { id: &#39;2&#39;, title: &#39;Service Two&#39; }<br>  ];<br><br>  let isMobileMenuOpen = false;<br><br>  const openMenu = () =&gt; (isMobileMenuOpen = true);<br>  const closeMenu = () =&gt; (isMobileMenuOpen = false);<br><br>  const links = [<br>    { title: &#39;Home&#39;, path: &#39;/&#39; },<br>    {<br>      title: &#39;Services&#39;,<br>      path: &#39;/services&#39;,<br>      children: services.map(s =&gt; ({<br>        title: s.title,<br>        path: `/services/${s.id}`<br>      }))<br>    },<br>    { title: &#39;Contact&#39;, path: &#39;/contact&#39; }<br>  ];<br>&lt;/script&gt;<br><br>&lt;header&gt;<br>  &lt;nav&gt;<br>    &lt;ul&gt;<br>      {#each links as link}<br>        &lt;li&gt;<br>          &lt;a href={link.path} class={pathname === link.path ? &#39;active&#39; : &#39;&#39;}&gt;<br>            {link.title}<br>          &lt;/a&gt;<br>        &lt;/li&gt;<br>      {/each}<br>    &lt;/ul&gt;<br><br>    &lt;button on:click={openMenu}&gt;Menu&lt;/button&gt;<br>    {#if isMobileMenuOpen}<br>      &lt;div&gt;<br>        &lt;button on:click={closeMenu}&gt;Close&lt;/button&gt;<br>        &lt;!-- Mobile menu content here --&gt;<br>      &lt;/div&gt;<br>    {/if}<br>  &lt;/nav&gt;<br>&lt;/header&gt;</pre><p>This Navbar component receives props like pathname, contact, and services to build the navigation dynamically, and includes a basic mobile menu toggle.</p><h4>2. Section Components</h4><p>Each file inside this folder represents a logical, visual chunk of a page. Unlike layout components, these aren’t shared across all routes - they’re composed into specific pages based on content needs.</p><pre>components/<br>└── sections/<br>    ├── About.svelte<br>    ├── Articles.svelte<br>    ├── CallToAction.svelte<br>    ├── Certificates.svelte<br>    ├── ContactForm.svelte<br>    ├── ContactMail.svelte<br>    ├── Faq.svelte<br>    ├── Hero.svelte<br>    ├── Pricing.svelte<br>    ├── Services.svelte<br>    ├── Teams.svelte<br>    ├── Testimonials.svelte<br>    └── WhyChooseUs.svelte</pre><p>These components are imported and used inside individual route files like +page.svelte. For example, on the homepage:</p><pre>&lt;!-- src/routes/+page.svelte --&gt;<br>&lt;script&gt;<br>  import Hero from &#39;$components/sections/Hero.svelte&#39;;<br>  import Services from &#39;$components/sections/Services.svelte&#39;;<br>  import Testimonials from &#39;$components/sections/Testimonials.svelte&#39;;<br>&lt;/script&gt;<br><br>&lt;Hero /&gt;<br>&lt;Services /&gt;<br>&lt;Testimonials /&gt;</pre><p>Here’s a simplified version of my About.svelte component from sections/:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  export let vision = {<br>    tag: &#39;Our Vision&#39;,<br>    title: &#39;What Drives Us&#39;,<br>    description: &#39;We aim to deliver excellence.&#39;,<br>    data: [<br>      {<br>        tag: &#39;Quality&#39;,<br>        title: &#39;Top Quality&#39;,<br>        description: &#39;We never compromise on quality.&#39;,<br>        icon: &#39;/icons/quality.svg&#39;,<br>        image: &#39;/images/quality.jpg&#39;<br>      },<br>      {<br>        tag: &#39;Innovation&#39;,<br>        title: &#39;Innovative Solutions&#39;,<br>        description: &#39;Creative approaches for your needs.&#39;,<br>        icon: &#39;/icons/innovation.svg&#39;,<br>        image: &#39;/images/innovation.jpg&#39;<br>      }<br>    ]<br>  };<br>&lt;/script&gt;<br><br>&lt;section&gt;<br>  &lt;h2&gt;{vision.tag}&lt;/h2&gt;<br>  &lt;h3&gt;{vision.title}&lt;/h3&gt;<br>  &lt;p&gt;{vision.description}&lt;/p&gt;<br><br>  &lt;div class=&quot;vision-items&quot;&gt;<br>    {#each vision.data as item}<br>      &lt;div class=&quot;vision-item&quot;&gt;<br>        &lt;img src={item.icon} alt=&quot;{item.tag} icon&quot; /&gt;<br>        &lt;h4&gt;{item.title}&lt;/h4&gt;<br>        &lt;p&gt;{item.description}&lt;/p&gt;<br>        &lt;img src={item.image} alt=&quot;{item.title} image&quot; /&gt;<br>      &lt;/div&gt;<br>    {/each}<br>  &lt;/div&gt;<br>&lt;/section&gt;</pre><h4>3. Routes</h4><p>This folder contains the actual pages users navigate to. These files act as entry points, where layout and section components are composed and fed data - whether static or fetched from a CMS.</p><pre>routes/<br>└── about/<br>    ├── +page.svelte<br>└── articles/<br>    ├── [article_id]/<br>    │   ├── +page.svelte<br>    ├── +page.svelte<br>└── certificates/<br>    ├── +page.svelte<br>└── contact/<br>    ├── +page.svelte<br>└── faq/<br>    ├── +page.svelte<br>└── services/<br>    ├── [service_id]/<br>    │   ├── +page.svelte<br>    ├── +page.svelte<br>└── teams/<br>    ├── [team_id]/<br>    │   ├── +page.svelte<br>    ├── +page.svelte<br>└── +layout.svelte<br>└── +page.svelte</pre><ul><li>Each +page.svelte file defines the UI for a specific route</li><li>These pages import and combine components from layout/ and sections/ to build the final layout</li><li>Files with [param] in the folder name represent dynamic routes - pages that change based on URL parameters (like article or service IDs)</li><li>The root-level +layout.svelte provides shared structure (e.g. header and footer) wrapping all pages</li></ul><p>Here’s an example homepage (+page.svelte) that combines multiple sections with data:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  import Hero from &#39;$components/sections/Hero.svelte&#39;;<br>  import Services from &#39;$components/sections/Services.svelte&#39;;<br>  import Testimonials from &#39;$components/sections/Testimonials.svelte&#39;;<br>  import Faq from &#39;$components/sections/Faq.svelte&#39;;<br><br>  // Data passed into the page (could come from load() or CMS)<br>  export let data = {<br>    hero: { title: &#39;Welcome to Our Site&#39;, subtitle: &#39;We offer great services&#39; },<br>    service: [{ id: 1, title: &#39;Service One&#39; }, { id: 2, title: &#39;Service Two&#39; }],<br>    testimonial: [{ author: &#39;Jane Doe&#39;, text: &#39;Amazing!&#39; }],<br>    faq: [{ question: &#39;What is X?&#39;, answer: &#39;X is...&#39; }]<br>  };<br>&lt;/script&gt;<br><br>&lt;Hero {data.hero} /&gt;<br>&lt;Services {data.service} /&gt;<br>&lt;Testimonials {data.testimonial} /&gt;<br>&lt;Faq {data.faq} /&gt;</pre><h3><strong>Key Takeaways</strong></h3><ul><li><strong>Plan Structure: </strong>Group reusable, shared components into clear folders by responsibility for modular UI</li><li><strong>Name Consistently:</strong> Use PascalCase for components and kebab-case for folders to simplify navigation and refactoring</li><li><strong>Start Static:</strong> Start with static data to focus on layout before adding dynamic CMS content</li><li><strong>Separate Content: </strong>Keep data separate from component structure by passing content as props</li><li><strong>Compose Pages:</strong> Combine layout and sections in routes for clear, modular structure</li><li><strong>Utilize Routing:</strong> Use +page.svelte and +layout.svelte to structure and wrap routes consistently</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll show how I used props to build dynamic components that can be fully customized through the CMS.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8462179a07d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-6f2369c50234?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f2369c50234</guid>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 21:45:34 GMT</pubDate>
            <atom:updated>2025-08-04T21:45:34.028Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 3: How I Set Up the Repo and Development Environment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43n3v0ngoGxAK51Rdp-IDw.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 3 of my 10-part “Concept to Launch” series, where I walk you through how I built a real-world website using SvelteKit and Sanity CMS for a mid-sized accounting firm.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-2bc1fe9b3540">Part 2</a>, I shared how I defined the website layout and prototyped a UI template. Today, I’ll show how I set up the project, GitHub, and VS Code for smooth development.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>My Setup Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WST56oZbohGEb1R4YRwjw.png" /><figcaption>My Setup Workflow</figcaption></figure><p>Whenever I start a new project, I follow this workflow to stay organized:</p><ol><li><strong>Initialize Project</strong><br>→ Create a new codebase with the chosen framework (e.g. SvelteKit)</li><li><strong>Prepare Development Environment</strong><br>→ Set up a suitable IDE (e.g. VS Code) with relevant extensions</li><li><strong>Set Up Version Control</strong><br>→ Create a GitHub repository and link it to the project</li><li><strong>Plan Project Architecture</strong><br>→ Review and adjust the folder structure to fit the project needs</li><li><strong>Maintain Project</strong><br>→ Commit regularly and deploy updates (e.g. Vercel) to share progress</li></ol><p>In the following sections, I’ll go over each step in more detail to help you get your SvelteKit project up and running.</p><h3>1. Project Initialization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDQduxMBNtHyNRTl7CP6CA.png" /><figcaption>SvelteKit + Sanity Starter Template</figcaption></figure><p>The first step in any new project is to initialize a clean, functional codebase. For this build, I considered two options:</p><ol><li>Start with <a href="https://svelte.dev/docs/kit/creating-a-project">a blank SvelteKit app</a> and integrate Sanity later</li><li>Use a minimal <a href="https://www.sanity.io/templates/sveltekit-sanity-clean">SvelteKit + Sanity starter template</a></li></ol><p>I decided to go with the template because it is maintained by the Sanity team, which gave me confidence in its structure and long-term stability. It also allowed me to see how content is fetched and rendered from Sanity right out of the box, and to explore the folder structure before making any customizations.</p><p>The starter includes:</p><ul><li>A SvelteKit frontend pre-configured for content fetching</li><li>A fully working Sanity Studio, running locally alongside the app</li></ul><p>Here’s the command I ran in the terminal to initialize the template:</p><pre>npm create sanity@latest -- --template sanity-io/sanity-template-sveltekit-clean</pre><p>For now, we’ll focus on the frontend to understand the project’s structure and components, while I’ll explain how Sanity works later in the series.</p><h3>2. Environment Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbAVIAkMXtavb7ON8LaAFA.png" /><figcaption>VS Code Extensions</figcaption></figure><p>Once the project is initialized, the next step is setting up the development environment. For this project, I used VS Code as my primary IDE because it’s fast, flexible, and perfect for building websites.</p><p>To start the development server, run this command in the terminal:</p><pre>npm run dev</pre><p>This launches the SvelteKit app on <a href="http://localhost:5173/">http://localhost:5173</a> where live updates appear as you code.</p><p>I recommend having these VS Code extensions while developing the app:</p><ul><li><a href="https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode"><strong>Svelte for VS Code</strong></a><strong> </strong>-<strong> </strong>provides Svelte language support</li><li><a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"><strong>Prettier</strong></a><strong> </strong>-<strong> </strong>keeps code clean and consistently formatted on save</li><li><a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag"><strong>Auto Rename Tag</strong></a> - automatically renames paired HTML/XML tags</li><li><a href="https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-colorize"><strong>Colorize</strong></a> - instantly visualizes CSS colors in CSS files</li><li><a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><strong>Markdown Checkbox</strong></a> - creates checkboxes in markdown</li></ul><h3>3. Version Control</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUvBVTlRjNHMlqKWBw0XLQ.png" /><figcaption>Version Control</figcaption></figure><p>Now that the development environment is set up, it’s time to configure version control. I recommend doing this early in the project because it allows to:</p><ul><li>Track every change made to the codebase</li><li>Revert to previous versions if something breaks</li><li>Collaborate seamlessly with other developers (or simply keep backups)</li><li>Branch out to test features without affecting the main project</li></ul><p>Here’s how to link project to a GitHub repository:</p><ol><li>Go to <a href="https://github.com/">GitHub</a> → <a href="https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository">Create a New Repository</a></li><li>Link the project by running the following commands in the terminal:</li></ol><pre>git remote add origin git@github.com:[your-username]/[repo-name].git<br>git branch -M main<br>git push -u origin main</pre><p>Note: Replace [your-username] and [repo-name] with your actual GitHub username and repository name. After pushing, you should be able to see all project files on GitHub.</p><h3>4. <strong>Project Architecture</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTUY6sdZBK21VarEEFdBtA.png" /><figcaption>My Project Structure Mind Map</figcaption></figure><p>With everything set up, we can now dive deeper into the project architecture. A good structure is key to keeping the code clean, scalable, and easy to maintain. To get started, I recommend first exploring <a href="https://svelte.dev/docs/kit/project-structure">SvelteKit’s default folder structure</a>. Once you’re familiar with it, you can then adapt it to better suit your project’s needs.</p><p>For this project, I extended that setup with the following structure:</p><pre>└── src/<br>    ├── components/<br>    │   ├── layout/<br>    │   ├── sections/<br>    │   └── ui/<br>    ├── data/<br>    │   └── home.json<br>    ├── lib/<br>    │   ├── paraglide/<br>    │   ├── queries/<br>    │   └── types/<br>    ├── routes/<br>    │   ├── about/<br>    │   ├── articles/<br>    │   │   └── [article_id]/<br>    │   ├── certificates/<br>    │   ├── contact/<br>    │   ├── faq/<br>    │   ├── services/<br>    │   │   └── [service_id]/<br>    │   ├── teams/<br>    │   │   └── [team_id]/<br>    │   ├── +page.svelte</pre><p>I followed a modular, single-responsibility approach to keep everything clean and maintainable. In practice, this means:</p><ol><li>Each folder has one clear responsibility (e.g. layout/, sections/)</li><li>Each file is designed to do just one thing</li></ol><p>For the page structure, each folder under routes/ has 2 files:</p><ol><li>+page.svelte to define layout and content for a particular route</li><li>+page.ts to handle data fetching from Sanity before rendering the page</li></ol><h3>5. Project Maintenance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCexm9ixX7ZnjcKoV664xg.png" /><figcaption>Project Maintenance</figcaption></figure><p>The key to keeping things organized and running smoothly is regular maintenance. It ensures that progress stays on track, bugs are fixed, and updates are deployed as needed. Here’s how I maintain the project:</p><h4><strong>1. Commit Regularly</strong></h4><p>I commit smaller changes related to a particular task. This ensures that if something breaks, I can quickly revert to a working state without losing too much progress. Terminal commit commands:</p><pre>git add .<br>git commit -m &quot;message&quot;<br>git push origin main</pre><h4><strong>2. Commit Meaningfully</strong></h4><p>Clear and concise commit messages are key for understanding the changes made. Instead of generic messages like “Update code”, I try something more descriptive, such as “Added service card component”.</p><h4>3. Branching</h4><p>Depending on the scope of the project, I work with different branches:</p><ul><li>main: Production-ready code</li><li>develop: Staging branch</li><li>feature/*: Specific features or page components (e.g., feature/home-hero)</li></ul><p>Here is how I work with a new branch in VS Code when needed:</p><pre>git checkout -b feature/branchName<br>git pull origin main<br>[do work]<br>git add .<br>git commit -m &quot;message&quot;<br>git push origin feature/branchName</pre><h4>4. <strong>Build Locally</strong></h4><p>Before pushing code to production, I build the project locally myself to catch any errors early. I use the following command to build:</p><pre>npm run build</pre><h4>5. Pull Updates</h4><p>To stay up-to-date with the remote repository, I pull the latest changes before starting any work. Terminal command:</p><pre>git pull origin main</pre><h4>6. <strong>Deploying to Vercel</strong></h4><p>By linking GitHub repository with Vercel, deployments are automated. Every push to the main branch triggers an automatic deployment, which makes it easy to share live updates with clients or team members.</p><p>Here’s how to link project to Vercel:</p><ul><li>Go to <a href="https://vercel.com/">Vercel</a> → <a href="https://vercel.com/docs/git/vercel-for-github">Connect your GitHub</a> → <a href="https://vercel.com/docs/projects/managing-projects#creating-a-project">Create a New Project</a></li><li>Vercel handles the rest and allows to easily share live updates</li></ul><p>These practices keep the development process organized and make it easier to track progress and manage changes.</p><h3><strong>Key Takeaways</strong></h3><ul><li><strong>Choose Template</strong>: Use a pre-configured template (SvelteKit + Sanity) for stability and clear structure</li><li><strong>Prepare Environment</strong>: Use VS Code and essential extensions to boost development efficiency</li><li><strong>Use Git</strong>: Set up version control early to track changes, collaborate, and keep backups</li><li><strong>Organize Structure</strong>: Use a modular approach for clear, maintainable code with defined folder responsibilities</li><li><strong>Maintain Code</strong>: Commit regularly and automate deployments with Vercel for smooth updates</li><li><strong>Use Documentation:</strong> Refer to official documentation (e.g. SvelteKit, Sanity) for setup and troubleshooting</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll dive into how I created reusable components like cards and modals to improve functionality.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f2369c50234" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-2bc1fe9b3540?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bc1fe9b3540</guid>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 20:27:43 GMT</pubDate>
            <atom:updated>2025-08-03T20:29:04.344Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2: How I Turned a Template into a Prototype</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MeHjQJmxsnjw-MFqdfbZg.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to Part 2 of my 10-part “Concept to Launch” series, where I’m breaking down how I built a full-stack website using SvelteKit and Sanity CMS for a real accounting firm in Uzbekistan.</p><p>In <a href="https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-1eeb10ef2ded">Part 1</a>, I shared how the project started and the architecture decisions I made. Today, I’ll show how I saved time by adapting a pre-made UI template to fit the project and meet the client’s needs.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Website Layout</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOjvPegYyS0_8rnBHzbx4w.png" /><figcaption>Key Website Parts</figcaption></figure><p>Before choosing a template or writing any code, I needed to define what pages and sections the site would require. Here’s a simplified breakdown based on the client’s requirements:</p><pre>🏁 Main Pages<br>└── 1. Home<br>    ├── Purpose: Showcases the most important sections<br>    ├── Includes: Hero, Partners, Features, Testimonials, Call to Action<br><br>└── 2. About Us<br>    ├── Purpose: Shares company-related information<br>    ├── Includes: About Us, Team, Certificates, FAQ<br><br>└── 3. Services<br>    ├── Purpose: Describes the firm’s offerings<br>    ├── Includes: Services list and individual service details<br><br>└── 4. News Articles<br>    ├── Purpose: Displays the latest news in accounting<br>    ├── Includes: Article list and detailed article pages<br><br>└── 5. Contact<br>    ├── Purpose: Allows visitors to get in touch<br>    ├── Includes: Contact details and a contact form</pre><p>For these pages, I had to account for:</p><ul><li>A consistent layout with a navbar, footer, and multilingual support (Uzbek &amp; Russian)</li><li>Reusable components to save development time (e.g. cards, sliders)</li><li>Responsive design for both desktop and mobile views</li><li>A clean and corporate design</li></ul><p>Planning these sections in advance helped me know exactly what to look for in a template.</p><h3>Template Selection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIG9q8FWJiTPFSi2Bh3DwQ.png" /><figcaption>Template Selection Tool</figcaption></figure><p>Instead of designing everything from scratch, I decided to start with a commercial UI template. This approach saved time, gave the client a visual starting point, and let me focus more on logic and content structure rather than layout details.</p><p>I used <a href="https://themeforest.net/"><strong>ThemeForest</strong></a>, a reliable source for well-designed commercial templates for business websites. While browsing, I focused on a few key things:</p><ul><li>A clean, professional layout suitable for a consulting/accounting firm</li><li>A clear section breakdown (e.g. Hero, Services, Testimonials, Blog)</li><li>Responsiveness and cross-browser support</li><li>Components that could be easily converted into Svelte components</li><li>A design that would pair well with dynamic data from Sanity CMS</li></ul><p>I ended up selecting the <strong>“</strong><a href="https://themeforest.net/item/rudra-business-consulting-react-js-template/58621524"><strong>Rudra - Business Consulting React JS Template</strong></a><strong>”</strong></p><p><strong>Why this template: </strong>It stood out for this project for a few reasons:</p><ul><li>Its layout matched the client’s vision</li><li>Clean typography, solid color palette, and a modern corporate feel</li><li>Already included sections like testimonials, pricing, contact, and blog</li></ul><h3>Prototyping Approach</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46QeEaYp_4tzUgWdqJRDkw.png" /><figcaption>Prototyping Tools</figcaption></figure><p>I usually shortlist 3–5 templates I like and test which one fits the project best by building a small section as a prototype. This gives the client something concrete to review early in the wireframing phase.</p><p>For prototyping purposes, you can extract the code from most templates on ThemeForest using tools like:</p><ul><li><a href="https://www.httrack.com/"><strong>HTTrack Website Copier</strong></a> (Windows) - free software that downloads full websites to your computer</li><li><a href="https://ricks-apps.com/osx/sitesucker/"><strong>SiteSucker</strong></a> (Mac) - a Mac app that downloads websites while keeping their folder structure</li></ul><p>After installing one of these apps, you can simply enter the URL of the template demo, press return, and the tool will download a static copy of the site - including the HTML, CSS, JS, and images - to your local machine.</p><p>Once you’ve validated that a template fits your needs, you should purchase it to acquire a proper license. This not only gives you peace of mind but also supports the developers who built the template.</p><h3>Preparation Steps</h3><p>Once I had the static assets, I took a few key steps to prepare the template for use in my SvelteKit project.</p><h4><strong>Step 1: Analyze the Structure</strong></h4><p>Before jumping into code, I reviewed the template to understand its layout and content flow:</p><ul><li>Identified all major sections and page types</li><li>Noted how content was structured (e.g. cards, sliders)</li><li>Determined what kind of data would need to be dynamic later (e.g. services, testimonials, news articles)</li></ul><h4><strong>Step 2: Plan the Final Website Structure</strong></h4><p>Based on this analysis, I defined the full structure of the website:</p><ul><li>Which pages, sections, and reusable components were needed</li><li>What to keep and what to remove from the template to keep things lean</li></ul><h4><strong>Step 3: Clean Up the Code</strong></h4><ul><li>Removed unused scripts, inline JavaScript, and legacy dependencies</li><li>Split the layout into smaller, reusable components</li><li>Rebuilt only the parts I needed using HTML/CSS</li></ul><p>To keep your codebase flexible and tailored to your project, aim to rebuild only what you need in your framework and avoid hard-coded content. This makes the code easier to maintain and keeps it free of unnecessary parts.</p><h3>Key Takeaways</h3><ul><li><strong>Plan Ahead:</strong> Define your website’s pages and sections before picking a template to save time later</li><li><strong>Use Templates:</strong> Start with a commercial UI template to focus on content and logic, not design from scratch</li><li><strong>Prototype Early:</strong> Use tools like HTTrack or SiteSucker to download and test templates before buying</li><li><strong>Analyze Structure:</strong> Review the template carefully to find dynamic content areas and reusable components</li><li><strong>Clean Up:</strong> Remove unused code and rebuild only what you need for a clean, maintainable project</li><li><strong>Communicate Clearly:</strong> Share prototypes and plans early to keep your client aligned and involved</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll cover how I organized the file structure, initialized the repo, and set up my development environment with VS Code and GitHub.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bc1fe9b3540" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Sanity CMS Powered SvelteKit Website]]></title>
            <link>https://samabdullaev.medium.com/build-a-sanity-cms-powered-sveltekit-website-1eeb10ef2ded?source=rss-d982ed27ab72------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eeb10ef2ded</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sam Abdullaev]]></dc:creator>
            <pubDate>Sat, 02 Aug 2025 22:52:39 GMT</pubDate>
            <atom:updated>2025-08-02T22:52:39.239Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1: H<strong>ow I Planned the Project and Picked the Stack</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8PJhEopVN5sjg-3Kna6Lbw.png" /></figure><h3>Intro</h3><p>Hey, Sam here! Welcome to the first article in my 10-part “Concept to Launch” series, where I’ll guide you through building a full-stack website using SvelteKit and Sanity CMS.</p><p>Over the next 10 days, I’ll walk you through the whole process - from planning to deployment. Today, we’ll start with how the project began and why I picked the tools I used.</p><p>Follow along if you’re into web development with SvelteKit and headless CMS tools like Sanity.</p><h3>Project Overview</h3><p>This project was for a mid-sized accounting firm in Uzbekistan, operating since 2019 and offering services like accounting, auditing, and business consulting. While their offline client base was growing, they lacked a professional website to build credibility and attract new clients.</p><p>They wanted a clean, multilingual website to showcase their services and make it easier for clients to get in touch.</p><p>If you’re an early-career developer looking for real clients, start with leveraging your existing network by offering value. Let friends, family, and acquaintances know that you’re building websites - especially for small businesses. You can reach out with simple proposals, and once there’s interest, move forward by discussing the project and setting clear expectations. One real project can teach you more than tutorials ever will - and it makes a great addition to your portfolio.</p><h4>Gathering Requirements</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYMJfN9ZjWbGbY2IyHFFng.png" /><figcaption>Tools I Used for Requirement Gathering</figcaption></figure><p>We started with a Google Meet call to understand the client’s goals and expectations. If you’re working with a non-technical client, keep the conversation simple and open-ended. Ask things like:</p><ul><li>What should people be able to do on your site?</li><li>Do you want to edit content yourself?</li><li>What kind of information should be featured?</li></ul><p>After our call, we agreed the website should be:</p><ul><li>Fast, responsive, and SEO-friendly</li><li>Easy to update without developer help</li><li>Multilingual (Uzbek &amp; Russian)</li><li>Capable of sending instant contact notifications</li><li>Deployed with a custom domain and no server maintenance</li></ul><p>Here’s how I addressed each need:</p><ol><li>Clean, professional, fast, and responsive design for accounting<br>→ <strong><em>Solution:</em></strong> Started with a UI template and customized it using SvelteKit for speed and responsiveness</li><li>Editable content without developer help<br>→ <strong><em>Solution: </em></strong>Used a headless CMS (Sanity) to manage content easily</li><li>Multilingual support (Uzbek &amp; Russian)<br>→ <strong><em>Solution: </em></strong>Added custom translation fields in Sanity CMS</li><li>Instant contact notifications via preferred communication channel<br>→ <strong><em>Solution: </em></strong>Integrated Telegram Bot API for real-time form alerts</li><li>Custom domain &amp; simple deployment<br>→ <strong><em>Solution: </em></strong>Deployed on Vercel and mapped client’s domain and admin subdomain</li></ol><p>It’s important to always confirm requirements in writing before you start building. This keeps expectations clear and helps avoid misunderstandings later.</p><h3>Architecture Choices</h3><p>Choosing the right tools impacts developer experience, client usability, and long-term maintainability. Here’s the stack I used - and why I picked each one over the alternatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EG38ShPE3H-qO4uJYyLrFQ.png" /><figcaption>Tools I Used for Project Development</figcaption></figure><h4>1. Frontend: SvelteKit</h4><p><strong>What it does:</strong> The frontend handles UI rendering, routing, SEO, and performance</p><p><strong>Alternatives considered:</strong> React + Next.js, Angular, vanilla HTML/CSS/JS</p><p><strong>Why I chose SvelteKit: </strong>SvelteKit is like Next.js but better suited for smaller applications. It stood out for this project because:</p><ol><li><strong>Built-in features:</strong> It includes routing, layouts, and SSR out of the box - no extra setup required like in React or Angular</li><li><strong>Performance:</strong> It compiles to minimal, fast JavaScript with no virtual DOM, making the site lightweight and fast</li><li><strong>Simplicity:</strong> Its syntax is close to plain HTML, CSS, and JS, reducing boilerplate and speeding up development</li></ol><p><strong>When to use SvelteKit: </strong>Use SvelteKit for smaller, content-heavy sites where performance matters and you don’t need complex state management or large component libraries</p><h4>2. Backend/CMS: Sanity CMS</h4><p><strong>What it does: </strong>Sanity powers all dynamic content and lets the client update everything without touching the codebase</p><p><strong>Alternatives considered:</strong> Contentful, Payload, JSON/Markdown files</p><p><strong>Why I chose Sanity CMS: </strong>I needed a fast, flexible, and low-maintenance content solution. It stood out for this project because:</p><ol><li><strong>Custom content structure:</strong> Content schemas are defined in JavaScript, giving more control than UI-based platforms like Contentful</li><li><strong>Performance:</strong> Content updates appear instantly and deploy easily with Vercel - no complex configuration like Payload CMS requires</li><li><strong>Simplicity:</strong> Sanity Studio is fast, clean, and intuitive, even for non-technical users</li></ol><p><strong>When to use Sanity: </strong>Best for small to mid-sized content-driven sites that need flexible modeling, a great editor experience, and quick deployment</p><h4>3. Automation: Telegram Bot API</h4><p><strong>What it does: </strong>The Telegram bot sends instant notifications when someone submits the contact form</p><p><strong>Alternatives considered: </strong>Email</p><p><strong>Why I chose Telegram: </strong>Telegram is widely used in Uzbekistan and already part of the client’s workflow. It stood out for this project because:</p><ol><li><strong>Easy integration:</strong> Setting up a bot is quicker than configuring email or SMS</li><li><strong>Performance:</strong> Messages arrive instantly with no spam risk</li><li><strong>Simplicity:</strong> Bot settings can be stored in Sanity, so the client can update them anytime</li></ol><p><strong>When to use Telegram: </strong>Use the Telegram Bot API if the client already uses Telegram for communication. For others, APIs for WhatsApp, SMS, or email are just as effective.</p><h4>4. Deployment: Vercel</h4><p><strong>What it does: </strong>Vercel handles deployment for both the SvelteKit frontend and the Sanity Studio CMS</p><p><strong>Alternatives considered: </strong>Manual deployment</p><p><strong>Why I chose Vercel: </strong>This cloud hosting service easily handles deployment. It stood out for this project for a few reasons:</p><ol><li><strong>Built-in domain management:</strong> We mapped the main domain for the site and a subdomain for Sanity Studio</li><li><strong>Performance:</strong> Each update gets a live preview, so the client can review changes before they go live</li><li><strong>Simplicity:</strong> It fully supports SvelteKit and requires no configuration - you can simply push from GitHub to deploy</li></ol><p><strong>When to use Vercel: </strong>Use Vercel when you want fast, zero-maintenance deployment with support for modern frameworks and preview environments.</p><h3>Key Takeaways</h3><ul><li><strong>Let People Know:</strong> Reach out to your network or local businesses offering website services - start with simple mockups</li><li><strong>Take Detailed Notes:</strong> You’ll thank yourself later when you’re writing code or handling scope changes</li><li><strong>Use Visuals:</strong> Show example sites to clients and ask what they like or don’t; much easier than explaining layout with words</li><li><strong>Set Realistic Expectations:</strong> Clarify what’s out of scope so you can focus on the most important features</li><li><strong>Double Check Everything:</strong> Always confirm requirements with clients to avoid misunderstandings</li><li><strong>Choose the Right Tools:</strong> SvelteKit + Sanity CMS + Vercel is ideal for small to mid-sized apps needing fast performance, clean UI, easy content updates, and hassle-free deployment with no server maintenance</li></ul><h3>Conclusion</h3><p>Tomorrow, I’ll show how I turned a static ThemeForest template into a dynamic Svelte UI with reusable components - and how you can do the same to speed up your projects.</p><p>If you found this article helpful, consider sharing it with your friends.</p><p>Thanks for reading :)</p><p>I look forward to sharing my journey in the next posts, where I will let you guys know where I am going next, so stay tuned! Feel free to explore <a href="https://linktr.ee/samabdullaev">my Linktree</a> to easily find everything I create across my social media profiles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eeb10ef2ded" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>