<?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 Coding With Ryan on Medium]]></title>
        <description><![CDATA[Stories by Coding With Ryan on Medium]]></description>
        <link>https://medium.com/@codingwithryan?source=rss-d16a7c3c8f1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tXWj9NvnPqFYn7jWjKrEbQ.png</url>
            <title>Stories by Coding With Ryan on Medium</title>
            <link>https://medium.com/@codingwithryan?source=rss-d16a7c3c8f1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:44:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codingwithryan/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[Case Study: How AnkiBuddy used Anvil to automate flashcard creation.]]></title>
            <link>https://medium.com/anvil-works/case-study-how-ankibuddy-used-anvil-to-automate-flashcard-creation-6b955e15865d?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b955e15865d</guid>
            <category><![CDATA[solopreneur]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Mon, 18 Aug 2025 14:27:31 GMT</pubDate>
            <atom:updated>2025-08-18T14:27:31.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/949/0*ZBiG4ylmUBWdyxI-.png" /></figure><h3>Executive Summary</h3><p><a href="https://www.ankibuddy.com/">AnkiBuddy</a> transforms the way medical students create study materials by using AI to generate high-quality <a href="https://apps.ankiweb.net/">Anki</a> flashcards from PDF documents in minutes — eliminating hours of manual card creation. Built by Dr. David Topf and using <a href="https://anvil.works/?utm_source=medium_ankibuddy_case_study">Anvil</a>, AnkiBuddy went from initial idea to working prototype in just 2 months, with Anvil enabling rapid iteration and continuous improvement ever since.</p><ul><li>Built by a solo developer</li><li>Prototype ready in 2 months</li><li>Users: 18,000+</li><li>Customer lifetime value: €70</li><li>MoM user growth: 32%</li><li>50,000+ PDFs parsed</li></ul><blockquote>Anvil has allowed me to do this as a solo entrepreneur. Any other solo entrepreneur that builds a software product needs to basically be a full stack developer who’s also had experience with DevOps and has the skills to build a business. — Dr. David Topf, Founder and CEO, AnkiBuddy</blockquote><h3>The Challenge: When Manual Study Card Creation Meets Medical School</h3><p>Every medical student knows the struggle: You have tonnes of PDF study materials, and you know that spaced repetition with flashcards is one of the most effective ways to learn. But creating quality flashcards manually is incredibly time-consuming. Turning a single PDF into comprehensive Anki cards can take hours.</p><p>David’s sister Danielle, a medical student, experienced this firsthand. She asked David how she could use AI to transform her medical study summaries into flashcards. As David recalls, “When she showed me how long it takes her to manually generate Anki cards, I wanted to try to help”.</p><h3>What If We Let AI Do the Heavy Lifting?</h3><p>David saw an opportunity — what if AI could handle the tedious process of reading through study materials and creating well-structured flashcards? This wasn’t just about automation, it was about creating scientifically-sound study materials that would actually improve learning outcomes.</p><p>The idea became AnkiBuddy: an AI-powered platform that transforms PDF study materials into customizable, high-quality Anki flashcards optimized for medical education.</p><h3>The Solution: AI-Powered Flashcard Generation</h3><p>AnkiBuddy is a web-based platform that lets medical students upload their study materials and receive well-structured Anki flashcards within minutes. The platform:</p><ul><li>Analyzes PDF content using AI</li><li>Generates professionally-structured flashcards</li><li>Allows easy customization and personalization of cards</li><li>Integrates with existing Anki workflows</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z8NgDj0SclzcYSH2.png" /><figcaption>AnkiBuddy Creating Flashcards</figcaption></figure><p>No more spending hours manually creating cards. No more inconsistent formats. Just high-quality study materials, ready when you need them.</p><h3>Building AnkiBuddy: Rapid Development with Anvil</h3><p>David had already worked hard building an AI-powered PDF parser using Python — the next challenge was building a UI and getting it all deployed online. That’s where Anvil came in.</p><p>He’d already learned Python for the AI part of the app, so he reached for Anvil to simplify the web development process and handle his DevOps and hosting. Within two months of working with Anvil, David had a working prototype of AnkiBuddy which he could give to users.</p><blockquote>It basically simplified it to a place where, if I learn Python and I learn the rules of Anvil, I can do pretty much what I want. — Dr. David Topf, Founder and CEO, AnkiBuddy</blockquote><p>More than just accelerating development, Anvil allowed David to offload database management, DevOps, and hosting. It saved him the headaches of navigating complex cloud platforms like AWS — letting him focus entirely on building his product and business.</p><p>He also took advantage of the support package offered by Anvil to help maximise his development speed and get answers to questions fast.</p><blockquote>I completely underestimated how valuable the support plan would be. I’ve been able to work directly with the Anvil development team. They’re not just responsive; they’re some of the most skilled engineers I’ve ever encountered. — Dr. David Topf, Founder and CEO, AnkiBuddy</blockquote><h3>The Results: From Idea to Impact</h3><p>Since its launch, AnkiBuddy has helped 18,000 medical students transform their study workflows. It has proven that there’s real demand for AI-powered study tools that are tuned to specific needs.</p><p>Anvil has enabled fast iteration ever since the prototype was launched. When users reported bugs or suggested improvements, David could implement changes in no time.</p><p>AnkiBuddy is a perfect example of how modern AI can solve real educational challenges and how the right development platform can help solo entrepreneurs move from idea to impact in record time.</p><h3>More Information</h3><p><strong>AnkiBuddy</strong> creates high-quality Anki flashcards from your PDF study materials in minutes.</p><h4><a href="https://www.ankibuddy.com/">Visit Ankibuddy’s website→</a></h4><p>If you’re new to <strong>Anvil</strong> and want to see how you can build powerful web apps using just Python — up to 7× faster than traditional development:</p><h4><a href="https://anvil.works/?utm_source=medium_ankibuddy_case_study">Learn more about app development with Anvil →</a></h4><p>Have questions or want to get in touch? Visit <a href="http://localhost:3000/contact">anvil.works/contact</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b955e15865d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/case-study-how-ankibuddy-used-anvil-to-automate-flashcard-creation-6b955e15865d">Case Study: How AnkiBuddy used Anvil to automate flashcard creation.</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m losing my developer edge, the AI is coming up from behind]]></title>
            <link>https://codingwithryan.medium.com/im-losing-my-developer-edge-the-ai-is-coming-up-from-behind-df0a2af3c389?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/df0a2af3c389</guid>
            <category><![CDATA[parody]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[humor]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 15:33:22 GMT</pubDate>
            <atom:updated>2025-07-18T15:33:22.279Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inspired by LCD Soundystem and the ever-changing world of software engineering.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4PLVriqGy1p5rokJWlGRQ.png" /></figure><p>Yeah, I’m losing my edge.<br>I’m losing my edge.<br>The kids are coming up with AI.<br>I’m losing my edge.<br>I’m losing my edge to the devs with Windsurf and Claude.<br>But I was there.</p><p>I was there in 2008.<br>I was there with plugins in Notepad++.<br>I’m losing my edge.<br>I’m losing my edge to the devs whose keystrokes I hear when they get on the livestream.<br>I’m losing my edge to the new model seekers who can tell me every researcher of every AI company from 1962 to 2008.<br>I’m losing my edge.</p><p>To all the kids in Y Combinator and Techstars.<br>I’m losing my edge to the CS-school Brooklynites in gilet jackets and borrowed nostalgia for the unremembered Haskell.</p><p>But I’m losing my edge.<br>I’m losing my edge, but I was there.<br>I was there.<br>But I was there.</p><p>I’m losing my edge.<br>I’m losing my edge.<br>I can hear the keystrokes every night at the desks.<br>But I was there.<br>I was there in 1984 at the first Cobol practices in a meetup in Silicon Valley.<br>I was working on the CLI shortcuts with much patience.<br>I was there when Guido van Rossum wrote his first interpreter.<br>I told him, “Don’t do open-source. You’ll never make a dime.”<br>I was there.<br>I was the first guy porting Doom to the Kodak Camera.<br>I played it at E3.<br>Everybody thought I was crazy.<br>We all know.<br>I was there.<br>I was there.<br>I’ve never been wrong.</p><p>I used to work in the Linux team.<br>I merged everything before anyone.<br>I was there in the Java virtual machine with James Gosling.<br>I was there in Xerox park during the IP stealing.<br>I woke up programming on the bench in Bletchley in 1948.</p><p>But I’m losing my edge to better-coding people with better ideas and more AI.<br>And they’re actually really, really nice.</p><p>I’m losing my edge.</p><p>I heard you have a compilation of every good source code ever done by anybody. Every great Stack Overflow answer by Jon Skeet. All the underground repositories. All the Kevin Mitnick hacks. I heard you have a hard drive of every zero-day exploit on the dark web. I heard that you have a white hat from every seminal hacker club — 1985, ’86, ’87. I heard that you have a CD compilation of every good Linux distro and another bootable DOS set from the ‘80s.</p><p>I hear you’re downloading Cursor and using Claude and are throwing your dependency tree out the window because you want to make something vibey. You want to make something with prompts.</p><p>I hear that you and your meetup have uninstalled Cursor and installed Windsurf.<br>I hear that you and your meetup uninstalled Windsurf and installed Cursor.</p><p>I hear every algorithm that you know is more efficient than every algorithm that I know.</p><p>But have you seen my code? Documented, responsive, fast, clean, functional, beautiful, pixel-perfect, memory-efficient, memory-safe, un-crashable, un-hackable, un-injectable, compatible, clear, crash-free, open-source, forkable, maintainable, stable, reliable, logable, legacy-free, debt-free, edge-case-free, timeout-free, accessible, stateful, robust, linted, readable…..</p><p>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.<br>You don’t know what you really code.</p><p><a href="https://bsky.app/profile/codingwithryan.com">Ryan (@codingwithryan.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df0a2af3c389" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What makes Anvil so easy to learn?]]></title>
            <link>https://medium.com/anvil-works/what-makes-anvil-so-easy-to-learn-fcbcb44993f5?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcbcb44993f5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 10:27:49 GMT</pubDate>
            <atom:updated>2025-07-18T10:27:49.092Z</atom:updated>
            <content:encoded><![CDATA[<h4>How long does it take to “learn” Anvil? Let’s take a look.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*subaLuJlVI7yR29P.png" /></figure><p>When evaluating a new dev tool, a common question is “How long will it take to learn?”. Lengthy learning curves cost time, effort, and money — but one of the beauties of Anvil is its shallow learning curve.</p><blockquote>I don’t want all the things slowing me down. I don’t want learning curves, I don’t want any of that. I want it quick, and that’s what Anvil gave me. — <strong>Shonna</strong> <strong>Smith, Product Manager, Consultant</strong></blockquote><p>Anvil lets you become productive in days, not months. This isn’t just a marketing claim, it’s an experience shared by many Anvil users. Let’s take a look at why Anvil is quick to learn.</p><h3>Why Is Anvil Easy To Learn?</h3><h3>1. It’s All Python</h3><p>It’s all Python, and much like Python, the learning curve of Anvil is gentle and shallow.</p><p>You don’t need to learn new languages or frameworks for each layer of your web app — saving you time. You can use Python for UI components, front-end code, back-end code and interacting with your database.</p><pre># Simple Anvil event handler - just Python<br>def button_click(self, **event_args):<br>    # Updating the display text of a label component<br>    self.output_label.text = f&quot;Hello, {self.name_box.text}!&quot;</pre><h3>2. No Boilerplate Code</h3><p>Anvil eliminates the need for boiler plate code and setup. The platform wraps common tasks like database access, user authentication, and API endpoints in easy-to-use APIs, letting you focus on what your application does.</p><p>Consider how much effort you typically spend on:</p><ul><li>Setting up projects</li><li>Configuring build tools</li><li>Managing deployment pipelines</li><li>Creating databases and access controls</li><li>Building secure user authentication</li><li>Configuring email services and servers</li><li>Checking software security</li><li>Developing API endpoints</li><li>Setting up version control</li><li>Implementing secrets management</li><li>Integrating external services</li><li>Connecting to IoT devices</li></ul><p>Anvil simplifies and handles all this and more for you, dramatically saving you time. It has the added benefit of making your app more secure — less code equals fewer opportunities for vulnerabilities.</p><blockquote>If data is ever at risk in the journey, we can’t move forward with a solution, full stop… They’ve thought about all of this so that you don’t have to. — <strong>Jacque Van Niekerk, Data Scientist, CFC Underwriting</strong></blockquote><h3>3. Extensive Documentation</h3><p>Anvil’s documentation and tutorials are extensive. They cover everything from the basics to advanced topics, making it easy to get up to speed.</p><p><a href="https://anvil.works/learn/tutorials?utm_source=medium_learning_curve">Try a tutorial →</a></p><p><a href="https://anvil.works/docs/overview?utm_source=medium_learning_curve">Read the docs →</a></p><p>Additionally, we have an extremely active <a href="https://anvil.works/forum/?utm_source=medium_learning_curve">community forum</a> where you can ask questions if you’re stuck, share knowledge, and get help from our team.</p><h3>4. Traditional Web Architecture</h3><p>Anvil follows the traditional web architecture approach, with a separation between client and server code. This makes it familiar, easy to understand, and maintain.</p><p>For people who aren’t familiar with web architecture, i.e. non-web developers, it’s still useful. The clear separation of concerns makes it easier for you to debug and think about. The underlying principles are also widely understood by other people, meaning they can help even without experience of Anvil.</p><p><a href="https://anvil.works/articles/client-vs-server?utm_source=medium_learning_curve">Learn more about client vs server →</a></p><h3>A Different Kind of Investment With Real-World Impact</h3><p>Anvil being quick to learn means:</p><ul><li>Faster time-to-market for your applications</li><li>Reduced training costs for your team</li><li>Lower risk when evaluating the platform</li><li>Increased productivity rather than delayed returns</li></ul><p>And the impact has been felt by many Anvil users:</p><blockquote>We wanted a web app urgently during the Covid-19 lockdown. With only intermediate skills in Python, and no knowledge of HTML/CSS/JavaScript/Flask/Django etc, Anvil enabled us to share a Minimum Viable Product in just 7 days. —<strong>Peter Fison, Managing Director, South West London TV</strong></blockquote><h3>Next Steps</h3><p>Ready to see how shallow Anvil’s learning curve is? Or do you have some questions?</p><ol><li>Try Anvil’s <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_learning_curve">intro tutorial</a></li><li>Ask questions on our friendly <a href="https://anvil.works/forum/?utm_source=medium_learning_curve">community forum</a></li><li><a href="/service/mailto:sales@anvil.works">Talk to an Anvil engineer</a> to discuss your specific use case</li></ol><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><p><em>Originally published at </em><a href="https://anvil.works/blog/anvils-learning-curve"><em>https://anvil.works</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcbcb44993f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/what-makes-anvil-so-easy-to-learn-fcbcb44993f5">What makes Anvil so easy to learn?</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Brought the GOV.UK Design System into Anvil]]></title>
            <link>https://medium.com/anvil-works/how-we-brought-the-gov-uk-design-system-into-anvil-ae2a0b4c2dc8?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae2a0b4c2dc8</guid>
            <category><![CDATA[anvil]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 14:38:24 GMT</pubDate>
            <atom:updated>2025-06-02T14:40:07.989Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Case Study in Implementing Any Design System in Anvil</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*3PwlVGuvDxtbFivFGNltFg.png" /></figure><blockquote>New to Anvil? Welcome! <a href="https://anvil.works/?utm_source=medium_govuk_design">Anvil</a> lets you build full-stack web apps using only Python. No need to juggle JavaScript, HTML, CSS, Python, SQL and all their frameworks. <strong>Just code in Python</strong> and bring your app to life!</blockquote><p><a href="https://www.figma.com/blog/design-systems-101-what-is-a-design-system/">Design systems</a> are invaluable for creating professional web apps. Implementing your design system in Anvil, by creating custom drag-and-drop components, layouts, and themes, streamlines development for both yourself and others. Today, I’ll show you one I built from scratch to demonstrate what’s possible in Anvil.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7u33W97V7Xot02A4.png" /><figcaption>A form in the Anvil editor based on the GOV.UK design system.</figcaption></figure><p>For this case study, I’m using <a href="https://design-system.service.gov.uk/">GOV.UK’s design system</a>. It’s a great example of a comprehensive design system, which standardises styles, helps construct components and takes accessibility seriously. It provides all the benefits of using a well thought out design system when creating a web app — so it’s perfect to show you what you can achieve in Anvil.</p><h3>The finished product</h3><p>The proof is in the pudding so, before I dig into how I implemented the system in Anvil, here’s an example of using the finished design system in the Anvil editor. Here’s me using the design system as a dependency and creating a GOV.UK form by simply dragging and dropping components into the page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CAdvYik0ldIl6MQK.gif" /><figcaption>Building a form in Anvil which uses the GOV.UK design system.</figcaption></figure><p>You can even clone this app and play around yourself:</p><h4><a href="https://anvil.works/build#clone:ESWLOEKGXMN2N24H=WGCFPUA34JSRPR23KVU4FJXJ">Clone the example</a></h4><h3>How it’s built</h3><p><a href="https://design-system.service.gov.uk/">GOV.UK’s design system website</a> provides all the HTML and CSS needed to implement their design system. They break everything down into individual <a href="https://design-system.service.gov.uk/components">components</a> and <a href="https://design-system.service.gov.uk/styles/page-template/">page templates</a>. Since Anvil allows for extensive customisation, I was able to use a few of its out-of-the-box features to recreate them.</p><h3>Custom HTML Layouts</h3><p>The first step was to implement GOV.UKs page template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3KCyCWDgqwv0hNSi.png" /><figcaption>GOV.UKs basic page implemented in Anvil</figcaption></figure><p>Anvil’s <a href="https://anvil.works/docs/ui/layouts/html-layouts?utm_source=medium_govuk_design">custom HTML Layouts</a> let me use the HTML from the <a href="https://design-system.service.gov.uk/styles/page-template/">design system’s page templates</a>. All I had to do was insert <a href="https://anvil.works/docs/ui/layouts/html-layouts#adding-slots?utm_source=medium_govuk_design">slots</a> in the HTML to define where components can be added to the Layout when it is used by other Forms.</p><p>To see how simple it is to create layouts from scratch, check out our docs:</p><h4><a href="https://anvil.works/docs/ui/layouts/html-layouts?utm_source=medium_govuk_design">Read the docs on custom layouts</a> -&gt;</h4><h3>Components from HTML</h3><p>For GOV.UK’s individual components, I used Anvil’s ability to <a href="https://anvil.works/docs/ui/custom-components/html-components?utm_source=medium_govuk_design">create components from scratch in HTML</a>.</p><p>I simply copied and pasted the HTML from the design system and added the anvil-name attribute to the elements I wanted to access in code.</p><p>With anvil-name assigned, I could easily reference those elements in Python using Anvil&#39;s <a href="https://anvil.works/docs/ui/custom-components/html-components#accessing-elements?utm_source=medium_govuk_design">dom_nodes API</a>. This let me to select individual elements, insert new content, apply new styles, and modify attributes-all while keeping the structure of the original design system intact.</p><p>Anvil stands out by giving you full access to any <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element">HTML element’s APIs</a> directly from Python code. There are no limits imposed by Anvil’s abtraction.</p><p>Check out our tutorial on building custom components from HTML:</p><h4><a href="https://anvil.works/learn/tutorials/access-html-elements-in-python?utm_source=medium_govuk_design">Learn how to create components</a> -&gt;</h4><h3>Ready to get started?</h3><p><strong>We’ve got full documentation and tutorials</strong> to help you get started:</p><ul><li><a href="https://anvil.works/learn/tutorials/using-layouts-to-create-multi-page-app?utm_source=medium_govuk_design">Multi-page apps with Layouts tutorial </a>— Learn how to structure your app using layouts.</li><li><a href="https://anvil.works/docs/ui/layouts/html-layouts?utm_source=medium_govuk_design">Custom HTML Layouts docs </a>— Recreate page templates as Anvil layouts.</li><li><a href="https://anvil.works/learn/tutorials/access-html-elements-in-python?utm_source=medium_govuk_design">Creating custom components from scratch tutorial</a> — Follow a step-by-step guide to creating your first custom component.</li><li><a href="https://anvil.works/docs/ui/custom-components/html-components?utm_source=medium_govuk_design">Components from HTML docs </a>— Build individual components and access their attributes.</li></ul><p>These resources will help you with everything you need to bring your design system into Anvil.</p><p>Any questions? Our <a href="https://anvil.works/forum/?utm_source=medium_govuk_design">Community Forum</a> is full of helpful information and Anvil experts.</p><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/?utm_source=medium_govuk_design">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><p>Want to build an app of your own? Get started with <a href="https://anvil.works/learn/tutorials?utm_source=medium_govuk_design">one of our tutorials</a>.</p><blockquote><em>Want to connect?<br></em><a href="https://codingwithryan.medium.com/"><em>Follow me for more</em></a><em> software development content!</em></blockquote><p><em>Originally published at </em><a href="https://anvil.works/blog/implement-your-own-design-system"><em>https://anvil.works</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae2a0b4c2dc8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/how-we-brought-the-gov-uk-design-system-into-anvil-ae2a0b4c2dc8">How We Brought the GOV.UK Design System into Anvil</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have a product idea? Use this SaaS template!]]></title>
            <link>https://medium.com/anvil-works/have-a-product-idea-use-this-saas-template-ab044a3649ad?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab044a3649ad</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[stripe]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 11:34:43 GMT</pubDate>
            <atom:updated>2025-02-10T11:39:04.633Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlFeLArJmoSgThDpee8vIg.png" /></figure><h3>Anvil’s SaaS Template User Guide</h3><p><a href="https://anvil.works/build#clone:SUTICB6NGVZM7J5S=CB3DXR7V65FYL6UQOF2VQF5L">Anvil’s SaaS (Software as a Service) template</a> is a solid starting point and foundation for your subscription-based SaaS product. This template uses <a href="https://stripe.com/">Stripe’s</a> API for subscription management, and includes simplified user permissions for you to use throughout your app. It’s an ideal starting point for your project.</p><h3>Contents</h3><p>In this guide, we’ll walk through the key components of the template, covering:</p><ul><li><strong>Introduction</strong>: Briefly learn about Anvil and the benefits of using this template.</li><li><strong>Prerequisites</strong>: What you’ll need to get started.</li><li><strong>Template Structure</strong>: A high-level overview of the app’s architecture and Stripe integration.</li><li><strong>Template Setup</strong>: Step-by-step instructions to get the template up and running with your account.</li><li><strong>Testing The App</strong>: Test the integration and explore the template’s functionality from a user’s perspective.</li><li><strong>Make The app Your Own</strong>: With the integration set up, it’s time to make the app your own.</li></ul><h3>Introduction</h3><h4>Anvil</h4><p>If you’re new here, welcome! <a href="https://anvil.works/?utm_source=medium_using_saas_template">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><p>You’re going to need to know the basics of Anvil before using this template, so I’d recommend following our <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_using_saas_template">10-minute intro tutorial</a>. This should give you enough knowledge to begin using the SaaS template.</p><h4>Why use Anvil’s SaaS template?</h4><p>This template is a solid foundation for building your own SaaS app. It gives you:</p><ul><li>Full <a href="https://stripe.com/">Stripe</a> payment and checkout</li><li>Subscription management synced with the app</li><li>Account management synced with Stripe</li><li>Easy-to-configure user permissions</li></ul><p>Overall, it’s an ideal starting point for your project.</p><h3>Prerequisites</h3><p>To follow this guide you will need the following:</p><ol><li>An understanding of Python</li><li>A <a href="https://dashboard.stripe.com/login">Stripe account</a></li><li>Basic knowledge of Anvil (a great place to start is with Anvil’s <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_using_saas_template">Feedback Form tutorial)</a></li></ol><h3>Understanding the template’s structure</h3><p>The template is divided into two main parts: the Stripe integration and the Anvil app. Stripe manages payments, subscriptions, and invoicing, while the Anvil app handles user authentication and permissions.</p><p>The app relies on the following Stripe features:</p><ul><li><a href="https://docs.stripe.com/customer-management">Customer Portals</a> — allows our customers to self-manage their payment details, invoices, and subscriptions in one place.</li><li><a href="https://docs.stripe.com/payments/checkout/pricing-table">Pricing Tables</a> — displays our prices, configured easily from our Stripe dashboard and takes users into Stripes checkout flow.</li><li><a href="https://docs.stripe.com/api">APIs</a> — to send data and requests to our Stripe account.</li><li><a href="https://docs.stripe.com/webhooks">Webhooks</a> — to send data to our Anvil app when an event happens in Stripe.</li></ul><p>Here’s an API flow to help visualise the integration:</p><figure><img alt="API Flow Diagram" src="https://cdn-images-1.medium.com/max/1024/0*v2IxAXJSzaFDBoj2.png" /><figcaption>API Flow Diagram</figcaption></figure><p>And here’s a user flow diagram to visualise the functionality available to the end user:</p><figure><img alt="The User Flow Diagram For The Template" src="https://cdn-images-1.medium.com/max/1024/0*Ym267_uK4iBe7aA_.png" /><figcaption>The User Flow Diagram For The Template</figcaption></figure><h3>Setting up the template</h3><p>This section will guide you through getting started with the template, understanding its features, and further developing it to suit your needs.</p><p>Let’s get started!</p><h4>Step 1 — Cloning The Template</h4><p>Start by cloning the template app:<br><a href="https://anvil.works/build#clone:SUTICB6NGVZM7J5S=CB3DXR7V65FYL6UQOF2VQF5L">https://anvil.works/build#clone:SUTICB6NGVZM7J5S=CB3DXR7V65FYL6UQOF2VQF5L</a></p><h4>Step 2 — Stripe Account Setup</h4><p>Next, we’ll set up our Stripe account. <a href="https://dashboard.stripe.com/login">Register for a Stripe account</a> and login. Then enter your <a href="https://support.stripe.com/questions/business-information-requirements-to-use-stripe?locale=en-GB">business details</a> to start capturing recurring revenue (or skip this step if you’re only going to use <a href="https://stripe.com/docs/test-mode?locale=en-GB">Stripe’s test mode</a>). Lastly, activate Stripe’s <a href="https://stripe.com/docs/test-mode?locale=en-GB">test mode</a>.</p><h4>Step 3 — Add The API Key</h4><p>For the integration to work, we need to add your Stripe API key to the app. You can find your keys by clicking on “Developers”, on the bottom left corner of the Stripe dashboard, and going to the API keys tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*58ET5m_8a5wR9Qh6.png" /><figcaption>Developer dashboard link</figcaption></figure><p>Copy your <a href="https://stripe.com/docs/keys">Stripe account’s Secret key</a> and, in the SaaS template app’s <a href="https://anvil.works/docs/security/encrypting-secret-data?utm_source=medium_using_saas_template">App Secrets</a>, set the value of “stripe_test_api_key” to your key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/0*FFdgB6wDY0CTE9AJ.png" /><figcaption>App Secrets</figcaption></figure><h4>Step 4 — Creating A Pricing Table</h4><p>Next, we need to create a pricing table for our customers to use. Start in the Anvil app editor, <a href="https://anvil.works/docs/deployment-new-ide/quickstart?utm_source=medium_using_saas_template">publish this app</a> and take a copy of the URL — we’ll use this in later in this step.</p><p>In the Stripe dashboard, <a href="https://dashboard.stripe.com/test/products?active=true">navigate to the Products catalogue</a>, select the <a href="https://dashboard.stripe.com/test/pricing-tables">Pricing tables tab</a>, and create a <a href="https://stripe.com/docs/payments/checkout/pricing-table">pricing table</a>.</p><ol><li>Click on the textbox under “Products” and select “Add new product”.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/0*USMzB6L-deESkn5x.png" /></figure><p>2. Name your product ‘Personal’, give it a <a href="https://stripe.com/docs/products-prices/how-products-and-prices-work#what-is-a-price">price</a> and save it by clicking ‘Add product’. Then, click ‘Continue’ onto the next step.</p><p>3. In the Payment settings, under “Confirmation page”, select “Don’t show confirmation page” and enter your <strong>published app’s URL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ifJVhQHBYcMtzXdU.png" /><figcaption>URL location</figcaption></figure><h4>Step 5 — Adding The Pricing Table To Your App</h4><p>Stripe’s website should take you to your <a href="https://dashboard.stripe.com/test/pricing-tables">pricing table’s page (if not, follow this link and select your pricing table)</a>. Now, we’ll embed the pricing table in our SaaS app.</p><ol><li>Copy the code for the pricing table.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RIufTrba3WInoKBP.png" /><figcaption>The <a href="https://dashboard.stripe.com/test/pricing-tables">Pricing Table page</a></figcaption></figure><p>2. Open the StripePricing Form in the Anvil Editor. Then <a href="https://anvil.works/docs/ui/components/forms#HTML-Forms-&amp;-Custom-HTML-Forms?utm_source=medium_using_saas_template">edit the custom HTML</a> by clicking the three dots at the top of the designer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RfRufal4kUA7t4ra.png" /></figure><p>3. Paste the code into the StripePricing Form’s custom HTML.</p><p>4. Lastly, add anvil-name=&quot;stripe-pricing-table&quot; to the stripe-pricing-table tag. The final HTML should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QQ_ubhwGxtyh32Nf.png" /><figcaption>Example of the finished StripePricing form’s custom HTML</figcaption></figure><h4>Step 6 — Setting Up The Webhooks</h4><p>We need Stripe to tell us when a new customer is created and when their subscription is updated so we can update our Users table with the Stripe subscription details. We’ll use <a href="https://www.redhat.com/en/topics/automation/what-is-a-webhook">webhooks</a> to do this. <a href="https://docs.stripe.com/webhooks/quickstart">There is a guide to setting up webhooks in Stripe here</a> but let me give you brief instructions.</p><h4>Customer Created</h4><ol><li>Open the <a href="https://dashboard.stripe.com/test/webhooks">Webhooks page</a> in Stripe by selecting the “Developers” link in the bottom left and navigating to the webhooks tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*7aVsZSwOiFfdo2AG.png" /></figure><p>2. Click the “Create an event destination” button.</p><p>3. Set the endpoint URL to your published app’s URL with “/_/api/stripe/stripe_customer_created” added to the end — i.e. “<a href="https://my-saas.anvil.app/_/api/stripe/stripe">https://my-saas.anvil.app/_/api/stripe/stripe</a>_customer_created&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B6ibj-s3dDgOdxHJ.png" /><figcaption>The endpoint URL being entered into the endpoint config screen</figcaption></figure><p>4. Then click “+ select events” and select “customer.created” under events to listen for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H9Kc6ce_Jd0Q_h1d.png" /><figcaption>Searching for the customer.created event</figcaption></figure><p>5. From now on, this will call the stripe_customer_created function in your Anvil app&#39;s StripeFunctions module when a customer is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/0*hZuXiRoOharhs5WW.png" /><figcaption>The set-up webhook</figcaption></figure><h4>Subscription Updated</h4><ol><li>Add another endpoint in Stripe.</li><li>Set the endpoint URL to your published app’s URL with “/_/api/stripe/stripe_subscription_updated” added to the end i.e. “<a href="https://my-saas.anvil.app/">https://my-saas.anvil.app/</a>_/api/stripe/stripe_subscription_updated&quot;</li><li>Then select “customer.subscription.updated” under events to listen for.</li><li>From now on, this will call the stripe_subscription_updated function in the StripeFunctions Server Module every time a customer is created.</li></ol><h4>Step 7 — Setting Up The Customer Portal</h4><p>Let’s quickly set up a way for users to manage their subscription. Go to the Stripe dashboard and use the search bar at the top to find the customer portal screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wN_UiZ2bD40CHVFf.png" /><figcaption>Searching for the customer portal</figcaption></figure><p>Set up a <a href="https://dashboard.stripe.com/settings/billing/portal">customer portal</a>, activate the test link and copy it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*uWv2GheopM67FSme.png" /></figure><p>Then open the SaaS app’s AccountManagement form and point the “manage_subscription_link” component’s URL to the copied link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gqsab8ci1S74Xwou.png" /><figcaption>The URL we need to update</figcaption></figure><p>We’re going to let users manage their email address from the Account page of our app, so we’ll disable the ability for users to change their email in their customer portal. The SaaS template syncs email updates with Stripe automatically. Back in the <a href="https://dashboard.stripe.com/settings/billing/portal">customer portal</a> config page, uncheck the “Email address” checkbox under customer information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yYIDHI7SjdkFrPBA.png" /></figure><p>With these steps completed, your Stripe integration is ready for testing.</p><h3>Testing The App</h3><p>The template has a number of <a href="https://anvil.works/docs/client/alerts-and-notifications#notifications?utm_source=medium_using_saas_template">Notifications</a> which will guide you through testing the app as a user. This will both test the integration we’ve set up and let you experience what the app is like as a user. <a href="https://anvil.works/docs/editor#the-anvil-editor?utm_source=medium_using_saas_template">Run the app</a> and follow along with the in-app instruction notifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qJfGIehpWu_UXjyY.png" /><figcaption>Example of the testing notifications guide</figcaption></figure><p>Here’s a user flow diagram for you to see all the actions you can take and test with the template:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LjJ6DgZ9HGMhGbKT.png" /><figcaption>The User Flow Diagram For The Template</figcaption></figure><h3>Making The App Your Own</h3><p>Now that your Stripe integration is set up and you’ve experienced the app from a user’s perspective, it’s time to make this app your own.</p><h4>Step 1 — Remove The Template Notifications</h4><p>First, we can search ( <em>ctrl+shift+F</em>) for the “# TEMPLATE EXPLANATION ONLY” comments and delete the relevant code below.</p><h4>Step 2 — Using User Permissions</h4><p>For a SaaS app to earn money, you’ll want to have premium features that are restricted to paid users on specific plans — this is where user permissions come in.</p><h4>What’s Included With The Template</h4><p>The template comes with a bespoke function and decorator designed to simplify managing user permissions:</p><ul><li>user_has_subscription: A function that works with <a href="https://anvil.works/docs/api/anvil.server.html#callable">@anvil.server.callable</a>. It verifies whether the user&#39;s subscription is included in the list of subscriptions authorized to use the function decorated by @anvil.server.callable. If permission is denied, a <a href="https://anvil.works/docs/api/anvil.server#PermissionDenied">PermissionDenied</a> exception is thrown.</li><li>@catch_permission_errors: A decorator that catches any <a href="https://anvil.works/docs/api/anvil.server#PermissionDenied">anvil.server.PermissionDenied</a> exceptions raised by the decorated client-side function. If permission is denied, it prompts the user to upgrade their subscription.</li></ul><h4>Using The Functions Together</h4><p>You can use @anvil.server.callable, user_has_subscription and @catch_permission_errors together as follows:</p><p>1. You restrict access to a function with @anvil.server.callable and user_has_subscription</p><p>To restrict access to a premium function to users with a valid subscription, start by decorating the premium function with @anvil.server.callable. You can pass @anvil.server.callable&#39;s require_user argument user_has_subscription. user_has_subscription takes a list of allowed subscriptions and checks if the logged-in user&#39;s subscription matches any entry in the list.</p><p>From the template, this example function is only allowed to be run by users with a “personal” subscription:</p><pre># Here&#39;s an example of a function that would require a paid subscription<br>@anvil.server.callable(require_user=user_has_subscription([&quot;personal&quot;]))<br>def calculate_percentage_of(number, total_number):<br>    percentage = (int(number) / int(total_number)) * 100<br>    return percentage</pre><p>If the user has an active subscription which is in the allowed subscriptions passed to user_has_subscription, the function will run. If they don&#39;t meet the subscription requirement, a permissions error is raised and caught by @catch_permission_errors - let me show you how to use @catch_permission_errors.</p><p>2. You use @catch_permission_errors on the client-side to prompt user</p><p>With the server-side function restricted, it’s time to prompt users to upgrade if they try to use a premium feature without the right subscription — for this, you can use @catch_permission_errors. @catch_permission_errors will catch any anvil.server.PermissionDenied exceptions thrown by our server-side function and prompt users to upgrade if they don&#39;t meet the subscription requirement.</p><p>From the example in the template:</p><pre># Catch_permission_errors catches exceptions that are thrown by a user not being subscribed and gives them a notification to upgrade<br>  @catch_permission_errors<br>  # This function is a simple example function to show you functionality that is gated behind a paywall<br>  def calculate_button_click(self, **event_args):<br>    &quot;&quot;&quot;This method is called when the button is clicked&quot;&quot;&quot;<br>    if self.number_1_textbox.text and self.number_2_textbox.text:<br>      <br>      # This makes a call to a restricted function <br>      percentage = anvil.server.call(&#39;calculate_percentage_of&#39;, self.number_1_textbox.text, self.number_2_textbox.text)<br>    ...</pre><p>And that’s it, you can restrict any number of features this way.</p><h3>Step 3 — Take Stripe out of test mode</h3><p>When you’re ready to go live, switch Stripe from <a href="https://docs.stripe.com/test-mode">test mode</a> to live mode.</p><p>Next, update the app’s account management link (configured in <a href="https://anvil.works/learn/tutorials/using-saas-template#step-7---setting-up-the-customer-portal">step 7</a>) to use the <a href="https://docs.stripe.com/customer-management/activate-no-code-customer-portal#url-parameters">customer portal’s live link</a>.</p><p>Finally, replace the <a href="https://anvil.works/learn/tutorials/using-saas-template#step-2---add-the-api-key?utm_source=medium_using_saas_template">API keys</a> in your Anvil app with the production keys.</p><p>Start building a product with Anvil! We love to see what you create with Anvil, so be sure to share your new apps on our <a href="https://anvil.works/forum/c/show-and-tell?utm_source=medium_using_saas_template">Show and Tell Forum</a>.</p><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/?utm_source=medium_using_saas_template">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><blockquote>Want to connect?<br><a href="https://codingwithryan.medium.com/">Follow me for more</a> software development content!</blockquote><p><em>Originally published at </em><a href="https://anvil.works/learn/tutorials/using-saas-template"><em>https://anvil.works</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab044a3649ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/have-a-product-idea-use-this-saas-template-ab044a3649ad">Have a product idea? Use this SaaS template!</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Layouts to Create a Multi-Page App]]></title>
            <link>https://medium.com/anvil-works/using-layouts-to-create-a-multi-page-app-c51bf7dcb49e?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c51bf7dcb49e</guid>
            <category><![CDATA[anvil]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 10:44:09 GMT</pubDate>
            <atom:updated>2024-08-01T10:44:09.578Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sXlwNjd5fIhOOJ9_bP_7w.png" /></figure><h3>Building reusable UIs with Layouts</h3><p>When you create a multi-page app, there will be parts of the UI that will be shared across multiple <a href="https://anvil.works/docs/ui/forms?utm_source=medium_using_layouts">Forms</a> — for example, a navigation bar. <a href="https://anvil.works/docs/ui/layouts?utm_source=medium_using_layouts">Layouts</a> let you create user interfaces that multiple Forms can use. I’m going to show you how to create one.</p><p>In this tutorial, we’ll build a homepage Layout with a navigation sidebar, and we’ll use it as the Layout for the other Forms in our app. When a user clicks a link in the sidebar, the app will open a new Form that has different content but the same navigation menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fu90Kut1PtPtVjg-9dsN8g.gif" /><figcaption>The final app which uses a Layout to navigate between pages</figcaption></figure><h3>What are Layouts?</h3><p>In Anvil, a <a href="https://anvil.works/docs/ui/layouts?utm_source=medium_using_layouts">Layout</a> is a Form that can be used by other Forms to define their structure. A Layout Form can have components added to it. Any Form using the same Layout will all have those same components. When you create a Layout Form, you add Slots into the design. Slots define where Forms using the Layout can add components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1rU0JNNs3H9NvnMm.png" /></figure><h3>Tutorial Prerequisites</h3><p>To follow along this tutorial you will need to know basic Python and you should know the basics of Anvil. If you’re new to Anvil, why not <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_using_layouts">try our introductory Feedback Form tutorial</a>?</p><h3>Contents</h3><p>These are the steps that we will cover:</p><ul><li><a href="#e350">Step 1 </a>— Create an Anvil app</li><li><a href="#611b">Step 2</a> — Create a homepage Layout</li><li><a href="#dac4">Step 3 </a>— Create a navigation menu</li><li><a href="#96ae">Step 4 </a>— Add a slot</li><li><a href="#e2d6">Step 5 </a>— Use the Layout</li><li><a href="#f1ab">Step 6</a> — Wire up the navigation menu</li><li><a href="#e24a">Step 7 </a>— Make the link look selected</li><li><a href="#4faf">Step 8</a> — Test the app</li><li><a href="#4f26">Step 9</a> — Optional: Change the homepage Layout</li></ul><h3>Step 1 — Create your Anvil app</h3><p><a href="https://anvil.works/build?utm_source=medium_using_layouts">Log in</a> to Anvil and click ‘Blank App’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xsk_lIsi1CMnL2e0.png" /></figure><p>When you’re asked what you’d like your page to look like, select Material Design 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*S6rX4vArL35wQbfJ.png" /></figure><p>Click on the name at the top of the screen and give your app a name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*ddTeJMxB4Z0F3epj.png" /><figcaption>Rename your app by clicking on the title</figcaption></figure><h3>Step 2 — Create your homepage template</h3><p>Our app already has a Form added called Form1, which we’ll turn into our homepage Layout. Open Form1 and change the name to “Homepage”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*pwgbBcDIf5FwPsJc.png" /><figcaption>Rename Form1</figcaption></figure><p>Then, click the three dot icon above the form and select “Use as layout”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jT9UsoPyxEyoaGNd.png" /><figcaption>Use Homepage as a Layout</figcaption></figure><blockquote>The first time you use Layouts in your app, you’ll need to migrate the app to use the new UI features. If the app hasn’t yet been migrated, you’ll see a popup message when you change your Form to a Layout. This is an irreversible change to our app, so please be aware if you’re migrating an app you’ve built with the old Anvil Designer.</blockquote><p>Let’s add a description of our Layout in the form’s configuration menu. This information shows up when deciding which template a new form should use. Click the three dot icon above the form again and select “Edit properties and events”. Then add a description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*MlO0M2Mt0Yi4kC9Y.png" /><figcaption>Editing the Homepage’s metadata</figcaption></figure><p>That’s great. Next up, let’s build a navigation UI in our ayout for other forms to inherit.</p><h3>Step 3 — Creating our navigation menu UI</h3><p>Let’s start by adding a <a href="https://anvil.works/docs/ui/components/containers#columnpanel?utm_source=medium_using_layouts">Column Panel</a> into the sidebar of our Form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yoi2UKGug8lhd-dA.gif" /><figcaption>Adding a column panel to our form</figcaption></figure><p>Then we can drag two <a href="https://anvil.works/docs/ui/components/basic#link?utm_source=medium_using_layouts">Link</a> components into the Column Panel — one for each Form that will use this Layout. We’ll change the first link’s text to “About Us” and the second link’s text to “Contact Us”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GjuHrRf4kFPsyP44.gif" /><figcaption>Adding links to our nav bar</figcaption></figure><p>Lastly, let’s give our app a title by dragging a Label into the title section on the top left of the Homepage Form. Then change the Label’s role to Title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LjA56Kzh964zrjrq.gif" /></figure><h3>Step 4 — Adding a slot</h3><p>Now that we’ve built the Layout we want our other Forms to use, let’s add a Slot. Slots define where components can be inserted by Forms that use the Layout.</p><p>We’ll add a Slot to the content_panel of our Homepage by dragging in a “Slot” from Toolbox on to the right of the designer.</p><p>Each Slot has a name. We can rename our slot using the object palette. Let’s call it main_slot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wFr8D8AIZQk-hN0j.gif" /><figcaption>Adding and renaming a Slot</figcaption></figure><blockquote>Be aware that if you delete or rename a Slot from a Layout that is being used by another Form, any components that were inside that Slot will not know where to go. You can find them in the Orphaned Components Panel and add them back to your page. For more information, see our <a href="http://localhost:3000/docs/ui/layouts#orphaned-components">documentation on Layouts</a></blockquote><p>Great, our Layout’s UI is complete. Now it’s time to create some Forms that use our Layout.</p><h3>Step 5 — Using the Layout</h3><p>We’re now going to create two Forms called “AboutUs” and “ContactUs” that use our Layout Form. Later, we’ll add click event functions to the Links we added in the previous step so that they open the corresponding Form when clicked.</p><p>First, we’ll create AboutUs by clicking “Add Form” in the <a href="https://anvil.works/docs/editor#app-browser">App Browser</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bx_QL3WvAIHHy7yh.png" /></figure><p>Then, select the Homepage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xNuDWuZ9X-bSzk1l.png" /></figure><p>Select the Homepage template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FT6Hi-B8LPaseZJu.png" /></figure><p>We can then rename the Form to “AboutUs”, the same way we renamed the Homepage Form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7GdH4o1oTlfhRzgi.png" /><figcaption>The app browser with the AboutUs page created.</figcaption></figure><p>Then, let’s add a label to the main slot and change its text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fUHIZzI8HT4Rxh-j.gif" /></figure><p>Repeat this process for the ContactUs page, adding another label with some different text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XDEihFX4DsU5Jkuv.png" /><figcaption>The Contact Us form with some different text</figcaption></figure><p>Now that we have two Forms using our Layout, all we have to do is wire up the sidebar links so they open the corresponding Form when clicked.</p><h3>Step 6 — Wiring up the navigation menu</h3><p>Open the Homepage Form and select the “About Us” link in the navigation menu. Let’s first rename the Link so that it’s easier to reference in code. In the floating Object Palette, click on link_1 and rename the Link to about_us_link. Next, select on click event, this will open up the code view for our Form and create an <a href="http://localhost:3000/docs/client/events">event handler</a> function for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jUVKNmSMvIlQ4h-4.png" /></figure><p>Inside the event function, we’ll use the open_form function to open our AboutUs page by passing in the name of the Form as a strin</p><pre>def about_us_link_click(self, **event_args):<br>  &quot;&quot;&quot;This method is called when the link is clicked&quot;&quot;&quot;<br>  open_form(&#39;AboutUs&#39;)</pre><p>Now, every time the “About Us” link is clicked, it will load the corresponding page. We will also do the same for the “Contact Us” link by renaming the link, adding the click event and opening the relevant Form in the function.</p><p>Lastly, let’s create a reset_links function for the Forms using our template to use. Create the function and inside, set every Link component’s <a href="https://anvil.works/docs/client/themes-and-styling/roles">role</a> to a blank string:</p><pre>def reset_links(self, **event_args):<br>  self.contact_us_link.role = &#39;&#39;<br>  self.about_us_link.role = &#39;&#39;</pre><h3>Step 7 — Making the Link look selected</h3><p>Our final step is to make it so that when we click one of the links in our navigation menu, it looks selected. This will make it easier to tell what page we are already on.</p><p>Select the AboutUs Form in the designer and in the <a href="https://anvil.works/docs/editor#events">Events section</a> of the properties panel, click the blue button next to the <a href="https://anvil.works/docs/client/components#the-show-and-hide-events">“Show” event</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*lBOMbE2B9LrZ2STd.gif" /><figcaption>Adding a Show event handler to our form</figcaption></figure><p>This will open up the code view and add a function that will run every time the AboutUs Form is <a href="https://anvil.works/docs/client/components#the-show-and-hide-events">shown</a>.</p><p>Inside the function, we can interact with the Layout our Form is using with self.layout. This gives us the ability to call functions defined in our Layout and change the properties of the Layout’s components. Let’s reset the links and set the <a href="http://localhost:3000/docs/ui/custom-styling/roles">role</a> of the Homepage.about_us_link to be “selected”.</p><pre>def form_show(self, **event_args):<br>    &quot;&quot;&quot;This method is called when the form is shown on the screen&quot;&quot;&quot;<br>    self.layout.reset_links()<br>    self.layout.about_us_link.role = &#39;selected&#39;</pre><p>Repeat this process for ContactUs.</p><h3>Step 8 — Testing the app</h3><p>To see the app in action, click the “Run” button at the top of the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b_p1YWwOIrtNk5Dg.png" /></figure><p>Click each link in the sidebar, and the relevant page should appear using our Layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F1rG3y4tJzkVtxit.gif" /><figcaption>Navigating between our different Forms</figcaption></figure><h3>Step 9 — Optional: Changing the Homepage Layout</h3><blockquote>This part is optional! The best way to learn any new technology is to challenge your understanding. Why not challenge yourself to reinforce what you’ve learnt and learn more?</blockquote><p>One of the best things about Layouts is making a change to the Layout is instantly propagated to all forms using the Layout. So, why not make some changes to our homepage form and see how it affects the other forms. You could:</p><ul><li>Add another link to the navigation sidebar and wire it up</li><li>Add a slot to the sidebar in Homepage so that other Forms using the Layout can add more links to the navigation menu</li><li>Chain Layouts together. Try creating an “Admin” page which uses the Homepage Layout and, in turn, make that a Layout. The admin page could have its own naigation menu inside the homepage’s main slot with links for “Profile” and “Contact Preferences”.</li></ul><h3>Clone the App</h3><p>You can open the <a href="https://anvil.works/build#clone:N5AOYXWUWTWMY6P3%3dNMROJLZXN4SXNXQSPM5GQDTK">source code for the finished Anvil app here</a>.</p><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/?utm_source=medium_4_improvements_custom_components">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><h3><a href="https://anvil.works/build?utm_source=medium_4_improvements_custom_components">Sign up for Anvil →</a></h3><p>Want to build an app of your own? <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_4_improvements_custom_components">Get started with our Feedback Form tutorial</a>.</p><blockquote>Want to connect?<br><a href="https://codingwithryan.medium.com/">Follow me for more</a> software development content!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c51bf7dcb49e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/using-layouts-to-create-a-multi-page-app-c51bf7dcb49e">Using Layouts to Create a Multi-Page App</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamline UI design with Anvil’s reusable Layouts]]></title>
            <link>https://medium.com/anvil-works/streamline-ui-design-with-reusable-layouts-e11a49c50294?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e11a49c50294</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[anvil]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 16:07:40 GMT</pubDate>
            <atom:updated>2024-04-16T16:08:08.141Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7DAx9cgh2XI_s6-jLSH6Q.png" /></figure><p><a href="https://anvil.works/docs/ui/layouts">Layouts</a> simplify UI design by letting you create reusable page structures that can be shared across multiple Forms. For example, you can design a Layout with a navigation bar, and any Form using this Layout will inherit the navigation bar. This makes UI building easier, faster and more consistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_GzsbwpsAta8duJV.png" /></figure><h3>What are the benefits?</h3><h4>1. Better reusability with shared Layouts</h4><p>A Layout can be used by many different Forms. This means when you edit a Layout, you’ll instantly see the changes across the Forms that use it.</p><h4>2. Simpler app navigation</h4><p>Layouts make building page navigation into your apps simpler than ever. Create a navigation bar in your Layout and share it between Forms. Then, you only need one line of code to navigate switch pages.</p><pre>def page_1_link_click(self, **event_args):<br>    &quot;&quot;&quot;This method is called when the link is clicked&quot;&quot;&quot;<br>    open_form(&quot;Page1&quot;)</pre><p>This make building consistent navigation straightforward and fast.</p><h4>3. Greater flexibility, less code</h4><p>You can create complex UI structures by nesting Layouts within each other.</p><p>For example, say you want to extend a homepage Layout with a nested admin panel Layout. You can create an admin panel Layout that uses the homepage Layout, which in turn gets used by other Forms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*lBD0xkk7iaNrm266.png" /></figure><h3>Ready to get started?</h3><p>We’ve got full <a href="https://anvil.works/docs/ui/layouts">documentation</a> and a <a href="https://anvil.works/learn/tutorials/using-layouts-to-create-multi-page-app">brand new tutorial</a> to show you exactly how to get started with Layouts.</p><pre>Want to receive more good quality Anvil articles?<br><br><a href="https://codingwithryan.medium.com/">Follow me on Medium.</a></pre><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e11a49c50294" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/streamline-ui-design-with-reusable-layouts-e11a49c50294">Streamline UI design with Anvil’s reusable Layouts</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Four Improvements To Anvil’s Custom Components]]></title>
            <link>https://medium.com/anvil-works/introducing-four-improvements-to-anvils-custom-components-b2752520c25e?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2752520c25e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-apps]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 15:02:38 GMT</pubDate>
            <atom:updated>2023-12-19T15:02:38.013Z</atom:updated>
            <content:encoded><![CDATA[<h4>We’ve made it simpler to build and use custom components in Anvil</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymjZafvkWkWaVbiRm_Qlug.png" /></figure><p>Anvil’s <a href="https://anvil.works/docs/client/custom-components?utm_source=medium_4_improvements_custom_components">Custom Components</a> allow you to build reusable UI components and use them through your app and others. We’ve recently made them easier to use and more flexible in a few different ways. Let me walk you through them:</p><ol><li><a href="#852d">Live Updates in the Editor</a></li><li><a href="#fef1">Categorize and Add Toolbox Icons</a></li><li><a href="#a8a7">Categorize Custom Component Properties</a></li><li><a href="#ee8b">Custom containers are simpler to build</a></li></ol><h3>1. Live Updates in the Editor</h3><p>We’ve introduced live updates for custom components in the Anvil Editor. Now, as you make changes to your custom component, you’ll instantly see those changes reflected in the designer. Components now run in the designer the same as they do in a live deployed app. This real-time behavior speeds up the development process and helps you fine-tune your components with ease.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*mVxXuSM8TsldxZMR9qPZww.gif" /><figcaption><a href="https://anvil.works/forum/t/progressbar-component-again/18656">Tobais’s progress bar</a></figcaption></figure><p>Not only does live updates mean the components reflect your changes immediately, it also has other benefits like exceptions being thrown and flagged to you immediately in the <a href="https://anvil.works/docs/client/new-designer#live-custom-components?utm_source=medium_4_improvements_custom_components">designer output</a>.</p><h3>2. Categorize and Add Toolbox Icons</h3><p>We understand that as you add dependencies to your app, managing custom components in the toolbox can become challenging. To help you keep things organized, you can now <a href="https://anvil.works/docs/client/custom-components#configuring-custom-components">categorize custom components and change their icons</a>. This makes them easier to locate and manage in the Editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ER-MGBZCSB1OA0DE.png" /><figcaption>Custom components in the Toolbox</figcaption></figure><h3>3. Categorize Custom Component Properties</h3><p>In addition to categorizing components, you can now categorize your custom component’s properties. This feature allows you to organize properties logically, making it simpler to configure your custom components. No more hunting for that one property buried deep in the list — categorize them for quick and easy access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*27_17DZe9AKGXlrd.png" /><figcaption>The menu for customising a property, including categorisation options</figcaption></figure><h3>4. Turn custom components into containers</h3><p>For the first time ever, it’s possible for you to build your own <a href="https://anvil.works/docs/client/custom-components/html-components#making-a-custom-component-a-container?utm_source=medium_4_improvements_custom_components">custom containers</a>! You can write your own custom HTML components and turn them into containers so that other components can be dragged and dropped inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTx5e73LiGDObkWTWvK3fw.gif" /><figcaption>An example of a custom container</figcaption></figure><p><a href="https://anvil.works/docs/client/custom-components/html-components#making-a-custom-component-a-container">Check out the docs</a> to learn how to build custom containers.</p><p>With these new improvements, custom components in Anvil are easier to use, more flexible and more efficient than ever before. Try them out today and experience the power of Anvil’s improved custom components for yourself! Happy app building!</p><h4><a href="https://anvil.works/docs/client/custom-components?utm_source=medium_4_improvements_custom_components"><strong>See the custom component docs →</strong></a></h4><h3>More about Anvil</h3><p>If you’re new here, welcome! <a href="https://anvil.works/?utm_source=medium_4_improvements_custom_components">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><h4><a href="https://anvil.works/build?utm_source=medium_4_improvements_custom_components">Sign up for Anvil →</a></h4><p>Want to build an app of your own? <a href="https://anvil.works/learn/tutorials/feedback-form?utm_source=medium_4_improvements_custom_components">Get started with our Feedback Form tutorial</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2752520c25e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/introducing-four-improvements-to-anvils-custom-components-b2752520c25e">Introducing Four Improvements To Anvil’s Custom Components</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Better Python Web Apps With Your Data]]></title>
            <link>https://medium.com/anvil-works/build-better-python-web-apps-with-your-data-b87952ebacfe?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b87952ebacfe</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[anvil]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Fri, 03 Feb 2023 14:58:36 GMT</pubDate>
            <atom:updated>2023-02-03T14:58:36.344Z</atom:updated>
            <content:encoded><![CDATA[<h4>Anvil’s Data Files In 100 Seconds</h4><p>Do you want a quick introduction to <a href="https://anvil.works/docs/working-with-files/data-files?utm_source=medium_data_files_100">Anvil’s Data File service</a>? Then <strong>check out our new 100 second video</strong> where we plot data from a CSV file using <a href="https://pandas.pydata.org/">Pandas</a> and Anvil’s Data Files service.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTEUXht5kxgM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTEUXht5kxgM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTEUXht5kxgM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/871781cc40290521d0305d3c11ed01b1/href">https://medium.com/media/871781cc40290521d0305d3c11ed01b1/href</a></iframe><h4>Anvil is free to use. Start building now! <a href="https://anvil.works/build?utm_source=medium_data_files_100">Try Anvil</a></h4><h3>Prefer text to video? Read on to learn how to use Data Files</h3><p>Python is great for working with data. With <a href="https://anvil.works/?utm_source=medium_data_files_100">Anvil</a> you can build web apps to interact with datasets and machine-learning models entirely in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6hOWFmAcxFDmuT2o50DwIA.gif" /></figure><p>In this article, I’ll show you how to use Anvil’s <a href="https://anvil.works/docs/working-with-files/data-files?utm_source=medium_data_files_100">Data Files service</a> to attach static data to your web app. We’re going to upload a CSV dataset and plot the data from it using <a href="https://pandas.pydata.org/">Pandas</a>. Then, we’ll display the plot online for everyone to see — <strong>all in Python.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*kbU7wfmXA_7Y-wVPa6C0bA.png" /></figure><h4>Uploading our CSV</h4><p>We start by uploading our dataset into our app’s <a href="https://anvil.works/docs/working-with-files/data-files?utm_source=medium_data_files_100">Data Files service</a>. I’m using some example data of Apple’s stock price over time which you can download here:</p><p><a href="http://localhost:3000/articles/img/data-files-100-seconds/dataset.csv">Download Apple’s stock price data</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*1Qy96jaOKtUI9l60.gif" /><figcaption>Adding the CSV data to our app</figcaption></figure><h4>Plotting our data</h4><p>Now, let’s write a <a href="https://anvil.works/docs/server?utm_source=medium_data_files_100">server function</a> called plot_data to plot our CSV data. We can use the <a href="https://anvil.works/docs/api/anvil.files#data_files?utm_source=medium_data_files_100">data_files</a> object to get the path to the file we just uploaded, and load it into Pandas.</p><pre>@anvil.server.callable<br>def plot_data():p<br>  # Read the CSV file into a DataFrame using the Data Files path<br>  df = pd.read_csv(data_files[&#39;dataset.csv&#39;])</pre><p>We’ll use <a href="https://plotly.com/python/pandas-backend/">Plotly’s Pandas backend</a> to plot our dataset as a line graph and return that figure from our server function.</p><pre>@anvil.server.callable<br>def plot_data():<br>  # Read the CSV file into a DataFrame using the Data Files path<br>  df = pd.read_csv(data_files[&#39;dataset.csv&#39;])<br><br>  # Then plot the graph using the Plotly backend<br>  df = df.set_index(&#39;Date&#39;)<br>  fig = df.plot.line(title=&quot;APPL Stock Price&quot;)<br>  return fig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*sHeCJCvbX3i_J7NY.gif" /><figcaption>Writing server-side code to plot our data</figcaption></figure><h3>Building our front-end</h3><p>Now let’s build a front-end to display our graph. Drag and drop a <a href="https://anvil.works/docs/client/components/plots?utm_source=medium_data_files_100">Plot component</a> onto the page from the <a href="https://anvil.works/docs/editor?utm_source=medium_data_files_100">toolbox</a> on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*YAaSYvDnRydEczDf.gif" /><figcaption>Dragging and dropping a Plot component into our form</figcaption></figure><p>Then switch to the app’s <a href="https://anvil.works/docs/client/python?utm_source=medium_data_files_100">front-end Python</a> code. In the __init__ method, we call the plot_data() server function we created earlier and set our <a href="https://anvil.works/docs/api/anvil#Plot?utm_source=medium_data_files_100">plot’s figure property</a> to the graph that is returned.</p><pre>def __init__(self, **properties):<br>  # Set Form properties and Data Bindings.<br>  self.init_components(**properties)<br>  # Any code you write here will run when the form opens.<br>  self.plot_1.figure = anvil.server.call(&#39;plot_data&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*kkQE9BvXD6O9lXWe.gif" /><figcaption>Writing the front-end code which gets our graph</figcaption></figure><h3>Running our app</h3><p>When we run the app, it will load the dataset and plot it with Pandas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*ZIS1YbmDqbNZK7bN.gif" /><figcaption>Running our app to test it</figcaption></figure><p>You can use Anvil’s Data Files to <a href="https://anvil.works/learn/tutorials/deploy-machine-learning-model?utm_source=medium_data_files_100">load and run machine learning models</a>, complicated datasets, and more. To find out more about Anvil and using Data Files, check out the links below.</p><pre><strong>Want to receive more good quality Python articles?</strong><br><br><a href="https://codingwithryan.medium.com/">Follow me on Medium.</a></pre><h3>New to Anvil?</h3><p>If you’re new to Anvil, welcome! <a href="https://anvil.works/?utm_source=medium_data_files_100">Anvil</a> is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks — just <strong>build it all in Python</strong>.</p><p>Yes — Python that <a href="https://anvil.works/docs/client/python?utm_source=medium_data_files_100">runs in the browser</a>. Python that <a href="https://anvil.works/docs/server?utm_source=medium_data_files_100">runs on the server</a>. Python that <a href="https://anvil.works/docs/client?utm_source=medium_data_files_100">builds your UI</a>. A <a href="https://anvil.works/docs/client/ui?utm_source=medium_data_files_100">drag-and-drop UI editor</a>. We even have a built-in <a href="https://anvil.works/docs/data-tables?utm_source=medium_data_files_100">Python database</a>, in case you don’t have your own.</p><p>Why not have a play with the app builder? <strong>It’s free!</strong> Click here to get started: <a href="https://anvil.works/build?utm_source=medium_data_files_100"><strong>Get building</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b87952ebacfe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anvil-works/build-better-python-web-apps-with-your-data-b87952ebacfe">Build Better Python Web Apps With Your Data</a> was originally published in <a href="https://medium.com/anvil-works">Anvil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Ways To Improve Medium’s Analytics Dashboard]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://codingwithryan.medium.com/3-metrics-to-improve-mediums-crummy-analytics-dashboard-aa4ed12e57d4?source=rss-d16a7c3c8f1e------2"><img src="https://cdn-images-1.medium.com/max/1600/1*ETC2ihVvE8uVikWtjaidPA.png" width="1600"></a></p><p class="medium-feed-snippet">Why is Medium&#x2019;s analytics dashboard bad and what could be done to improve it?</p><p class="medium-feed-link"><a href="https://codingwithryan.medium.com/3-metrics-to-improve-mediums-crummy-analytics-dashboard-aa4ed12e57d4?source=rss-d16a7c3c8f1e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://codingwithryan.medium.com/3-metrics-to-improve-mediums-crummy-analytics-dashboard-aa4ed12e57d4?source=rss-d16a7c3c8f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa4ed12e57d4</guid>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Coding With Ryan]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 14:40:39 GMT</pubDate>
            <atom:updated>2023-01-27T10:06:24.968Z</atom:updated>
        </item>
    </channel>
</rss>