# Fixing errors and debugging Source: https://docs.leap.new/best-practices/debugging How to debug and fix errors effectively. Errors will inevitably happen when building software, whether the code is written by an AI or a human. When working with Leap, the key is not to panic or waste credits by repeatedly pasting the same error. Instead, use a systematic debugging approach. Leap works best when you provide clear context and precise, focused instructions. This guide explains how to debug issues effectively, collaborate with Leap, and unblock yourself when things don’t go as expected. ## 1) Provide Detailed Bug Reports When you encounter an issue, the fastest way to get to a fix is by writing a strong bug report. Just like when working with a developer, the more context you share, the easier it is for Leap to understand what went wrong and how to fix it. A strong bug report typically includes: * A clear description of the problem * Steps to reproduce the issue * What you expected to happen * What actually happened * Any relevant logs, screenshots, or error messages **Tip:** The quality of your prompt directly shapes the quality of the fix. Avoid vague requests and include the exact error, a minimal snippet, and what you tried. Instead of: ```text theme={null} It's broken, fix it ``` Try: ```text theme={null} When I click the "Save" button on the form, nothing happens. Expected: The form should save and show a success message. Actual: No response, and the following error appears in the console: "TypeError: handleSubmit is not defined". ``` ## 2) Add relevant logs If Leap struggles fixing the issue even after providing a strong bug report, it can be a good idea to add additional logging. Example: ```text theme={null} When I submit the form, I get the error "TypeError: handleSubmit is not defined". Please add relevant console.log statements around the submit handler so I can gather more details. ``` After running the updated code, check the Logs panel in Leap or your browser’s Console. Share the new output in your next bug report so Leap can refine the fix. ## 3) Use Iterative Debugging Big issues are often solved step by step. Instead of asking Leap to “fix everything,” try breaking down the problem: * Ask Leap to identify why the error is happening * Add logging or test cases if the cause is unclear * Apply the suggested fix and retest * Share updated results with Leap By iterating, you avoid burning credits on large, unfocused requests and make steady progress toward a solution. # Effective Prompting Source: https://docs.leap.new/best-practices/prompting How to craft effective prompts when working with Leap. Leap is capable of building production-ready applications based on your instructions and specifications. Clear and detailed instructions, prompts, lead to better results. A prompt is what you write to tell the AI what you want it to do. Think of the AI like your engineering partner, not an all-knowing oracle: it can only respond based on the information you give it. This guide will help you communicate effectively with Leap to get the results you want. ## The Basics **Be specific about what you're building.** The more details you provide, the better Leap can understand your vision. Instead of: ``` Build a todo app. ``` Try: ``` Build a task management app where users can create projects, add tasks with due dates, and assign them to team members. ``` **Describe your data.** Mention the key entities in your application and how they relate to each other. ``` Build a book review site where users can: - Rate books (1-5 stars) - Write reviews - See other users' reviews - Browse books by genre ``` **Start simple, then iterate.** Begin with core functionality and add complexity through follow-up prompts. Whenever you've completed a feature, it's good to use the *Merge change* feature to save your work and clear the chat. This optimizes token usage and makes it easy to revert back to a working version of your app later on. ## Real Examples That Work Well Here's a prompt that consistently produces great results: ``` Build an expense tracking app where users can: - Log expenses with amounts, dates, and categories - See monthly spending summaries - Set budget limits for different categories - Get notifications when approaching budget limits ``` This works because it clearly defines the core features and data model without overwhelming Leap with implementation details. For a backend-focused application: ``` Build an API for a product inventory system with: - Product management (create, update, search) - Inventory tracking across multiple warehouses - Order processing that updates inventory levels - Low stock alerts ``` ## Integrating with Third-Party Services Leap can often easily integrate with popular third-party services. Simply mention them in your prompt: ``` Build a newsletter platform that uses Resend for email delivery and Stripe for subscription payments. ``` Some popular integrations that work well: * Payment processing (Stripe, Polar) * Email services (Resend, SendGrid) * Authentication providers (Clerk, Auth0) * Analytics tools (PostHog, Mixpanel) * .. and more **Sometimes Leap needs more context:** AI is notoriously bad at recognizing what it doesn’t know. When working with lesser-known services, Leap might hallucinate API endpoints or make assumptions based on common patterns that don't actually apply. If you notice Leap getting it wrong, it helps to copy relevant sections from the service’s documentation into your prompt. This gives Leap the context it needs to generate accurate code. ## Prompt Patterns to Follow **Start with the purpose:** Begin by stating what the application is for. ``` Build a platform for scheduling and managing fitness classes... ``` **List key features:** Use bullet points for clarity. ``` Users should be able to: - Book classes based on availability - Manage their bookings - Receive reminders before class ``` **Mention technical requirements only when necessary:** ``` The application should use PostgreSQL for data storage and include user authentication. ``` Keep in mind Leap can only implement supported technologies and will not be able to use arbitrary programming languages and infrastructure. On the backend side, Leap uses [Encore](https://encore.dev/) as the backend framework which comes with native support for PostgreSQL, microservices, Pub/Sub, Object storage, and more. ## How NOT to Prompt Leap Leap is designed to build applications based on clear, specific feature requests. It’s not intended for general questions or vague feedback. To get the best results, describe exactly what you want to build or fix, and include helpful context like user actions, expected behavior, error messages, logs, or screenshots. These types of prompts won’t work well: **INEFFECTIVE:**\ "Can you fix all the bugs in the application?"\ "The login is broken."\ "Please review and test everything you've built." Instead, be specific and provide context: **EFFECTIVE:**\ "Allow guests to start the checkout process without signing up for an account." "Fix the TypeError: Cannot read property 'email' of undefined shown in the console after submitting the login form." "Adjust the layout so that the cards are horizontally aligned on the index page (see screenshot attached)." ## When You Get Stuck If you've gotten stuck, it may be helpful to revert to your latest merged version by clicking *Discard change*. This clears the context and makes Leap more effective. After reverting to your latest merged version, try these approaches to produce better results: **Be more concrete.** Provide specific examples of how features should work. **Simplify your request.** Break complex applications into smaller pieces. **Ask for guidance.** If you're not sure how to describe something, Leap can help you structure your prompt better. ## Sample Prompt Template Here's a template you can adapt for most applications: ``` Build a [type of application] that helps users [solve this problem]. Key functionality: - [Feature 1] - [Feature 2] - [Feature 3] The application should have: - [Any specific technical requirements] - [Any specific design requirements] ``` ## A Note on Backend Features Leap excels at building proper backend infrastructure. Don't hesitate to request: * Database schemas and migrations * API endpoints with proper error handling * Scheduled jobs * Event-driven architecture * Authentication and authorization Unlike many AI tools that focus on frontends, Leap can generate robust backend code that's ready for production. *** Remember that Leap is designed to handle complex requirements, but clear communication is key. Focus on what you want to build, not how you think it should be implemented, and Leap will handle the technical details. # Reaching users Source: https://docs.leap.new/best-practices/reaching-users Get your Leap app discovered and gain initial traction with these proven strategies Even the most talented builders face the same challenge: **"How do I get users to try this great thing I built?"** You've just created a production-ready application with Leap, complete with backend APIs, database, and cloud deployment. Now it's time to get it in front of users who need it. Here's your step-by-step action plan to gain initial traction: ## Go where your users are The most effective marketing happens where your potential users already spend their time. Instead of trying to pull them to you, meet them where they are. **Reddit is your best friend for niche apps.** If you built a gardening app, the people in r/gardening are exactly who you need to reach. Same goes for fitness apps in r/fitness, or productivity tools in r/entrepreneur. The key is being genuinely helpful, not promotional. Share what you learned building the app, ask for feedback, and let people discover it naturally. **Think beyond the obvious platforms.** Your users might hang out in unexpected places. A meal planning app might find users in r/MealPrepSunday, but also in Facebook groups for busy parents or Discord servers for fitness enthusiasts. **Pro tip**: Spend time in these communities before you post about your app. Understand the culture, contribute helpful comments, and build relationships. When you do share your project, you'll already be a trusted community member. ## Start with your network Your personal network is underrated. These people already know and trust you, which means they're more likely to try your app and give honest feedback. **Don't overthink it** - just tell people what you built. Send a message to former colleagues who might find it useful. Post on your personal social media. Ask friends to try it out. Even if they're not your target users, they might know someone who is. The goal isn't to get thousands of users from your network. It's to get your first 10-20 users who can give you feedback and help you refine your messaging for larger audiences. ## Make it easy to share Once people try your app, make it simple for them to tell others about it. A 30-second screen recording showing your app in action is worth more than any written description. Keep it real and focused on the problem you're solving. People don't care about your tech stack - they care about whether your app makes their life easier. ## Plan a bigger launch Once you've tested your messaging with your network and niche communities, you're ready for broader visibility. **Product Hunt** remains the gold standard for product launches. Submit your app, launch Tuesday-Thursday for maximum visibility, and rally your supporters for launch day. A compelling tagline and demo GIF are essential. **Other launch platforms** worth considering: [Hacker News Show HN](https://news.ycombinator.com/showhn.html) works well for developer tools, [Indie Hackers](https://indiehackers.com) is perfect for solo projects, and [Beta List](https://betalist.com) helps with early-stage apps. The key is timing these launches after you've already refined your messaging and gathered some initial users and feedback. **Remember**: Marketing is not a one-time launch event. The most successful apps combine a strong initial push with consistent, ongoing efforts to reach new users and engage existing ones. # Optimize token usage Source: https://docs.leap.new/best-practices/tokens How to work more efficiently and keep your costs down Leap uses Anthropic’s Claude 4 Sonnet and Google's Gemini models to power its AI. These models process *tokens*, which is defined by Anthropic as: > The smallest individual units of a language model. A token can represent a word, part of a word, a character, or even a byte (especially in the case of Unicode). Each token comes with a cost, and Leap is billed by the AI providers for each token it uses. This is why our paid plans are priced based on how many tokens you get in each plan. ## How Leap uses tokens Tokens are consumed in three main ways when using Leap: * Messages between you and the AI. * The AI writing new code for your application. * The AI reading and analyzing your existing codebase, including any changes you've made. ## How Leap optimizes token usage We're always working to make Leap consume tokens in the most efficient way, and are investing heavily in building smart logic and advanced tools for optimizing what context is passed to the AI and have it produce only relevant output. This already includes strategies like: * Only including relevant chat history and change history from the current open **Change**, not all historical context. * Controlling the AI output and focusing it on writing functional and efficient code. ## Tips to reduce your token usage Here are some simple ways you can reduce token usage and improve performance: ### Merge early and often When you first send a prompt in Leap, it creates a **Change** for the ongoing chat with the AI. You can think of this as a branch. Whenever you have accomplished an atomic implementation in your application, we recommend clicking **Merge change** and continuing with a new one. You can think of this as merging a pull request. Merging early and often ensures the context passed to the AI is focused only on what is relevant for the changes you are currently working on. ### Use Scope context If you have a large codebase, manually defining what part of the codebase is send to the AI can be used to significantly optimize token usage. Click **Scope context** in the prompt text area to select which files and folders are relevant to the change you are working on. **Example:** If you are asking the AI to only make UI changes on a specific page, use the Scope context feature to select the relevant page. ### Avoid repeated "Attempt Fix" attempts Repeatedly clicking **Attempt Fix** can quickly consume unnecessary tokens. After an attempt, review the changes and refine your next request if needed. Not every issue can be fixed automatically, without providing more context to the AI, so it’s often worth debugging the error or making manual edits if fixes fail. ### Add error handling and logging If you're stuck in an error loop, prompt Leap to add detailed logging and stronger error handling. Leap is good at inserting useful logs at key steps, and these logs help the AI understand what’s going wrong and allow it to respond with more precise fixes in future attempts. ### Use the Undo functionality If something goes wrong, you can **Undo** the latest revision to immediately return to the previous state. Using Undo is more efficient than asking the AI to revert the change. Undoing a revision is permanent, there’s no redo, so make sure you're ready before using it. ### Use the Discard change functionality If you’ve made multiple revisions in a Change and aren’t happy with the result, you can revert to the latest merged state by clicking **Discard change** on the active Change. Discarding is more efficient than asking the AI to revert the changes. Discarding a change is permanent, there’s no un-discard, so make sure you're ready before using it. # Leap vs Bolt Source: https://docs.leap.new/comparisons/leap-vs-bolt Production-grade infrastructure vs browser-based development - when to use each approach Bolt excels at browser-based development and rapid prototyping with WebContainers. Leap builds production-grade distributed systems with real cloud infrastructure. ## Key differences | | Leap | Bolt | | --------------------------------------- | ------------------------------------ | ------------------------- | | **Approach** | Production-grade distributed systems | Browser-based development | | **Deploys to your own cloud (AWS/GCP)** | ✅ Yes | ❌ No | | **Real backend logic & microservices** | ✅ Yes | ❌ Limited | | **Infrastructure-as-code by default** | ✅ Yes | ❌ No | | **Built-in distributed tracing** | ✅ Yes | ❌ No | | **Multi-environment support** | ✅ Yes | ❌ Limited | | **Type-safe distributed systems** | ✅ Yes | ❌ No | | **Avoids vendor lock-in** | ✅ Yes | ❌ No | ## When to choose each **Choose Bolt for:** * Quick full-stack prototyping in the browser * Learning frameworks without local setup * Single applications deploying to Netlify/Cloudflare * Rapid experimentation and iteration **Choose Leap for:** * Production distributed systems with microservices * Real backend infrastructure and databases * Deployment to your own AWS/GCP account * Enterprise applications requiring scalability ## The difference **Bolt** generates single applications that work well for standalone projects and platform deployment. **Leap** generates complete distributed systems with multiple services, databases, and cloud infrastructure that scale to enterprise requirements. # Leap vs Cursor Source: https://docs.leap.new/comparisons/leap-vs-cursor System generation meets intelligent coding - better together than competing Cursor is an AI-powered code editor. Leap generates complete distributed systems. They work better together than apart. ## Key differences | | Leap | Cursor | | ----------------------------------- | --------------------------------- | -------------------------------- | | **Best for** | Starting new projects (0→1) | Working with existing code (1→N) | | **Primary use case** | Generate systems & infrastructure | Daily coding & refactoring | | **Generates distributed systems** | ✅ Yes | ❌ No | | **Works with any existing project** | ❌ No | ✅ Yes | | **Creates cloud infrastructure** | ✅ Yes | ❌ No | | **Enhanced IDE coding** | ❌ No | ✅ Yes | | **Production observability** | ✅ Yes | ❌ No | ## Why they're complementary **Use Leap to:** * Generate your system architecture and infrastructure * Create new services and major features * Set up databases and cloud deployment **Use Cursor to:** * Implement detailed business logic * Debug and optimize existing code * Refactor and add comprehensive testing ## Recommended workflow 1. **Generate foundation with Leap** - Complete distributed system in minutes 2. **Develop with Cursor** - AI-powered coding with [Encore optimization rules](https://encore.dev/docs/ts/quick-start#optional-add-encore-llm-instructions) 3. **Switch between tools** - GitHub integration keeps everything in sync **The combination saves months of architecture work** while providing the best AI-enhanced development experience. # Leap vs Lovable Source: https://docs.leap.new/comparisons/leap-vs-lovable Production-grade infrastructure vs rapid prototyping - when to use each approach Lovable excels at rapid frontend prototyping for non-technical users. Leap builds production-grade backend systems for professional developers. ## Key differences | | Leap | Lovable | | --------------------------------------- | ------------------------------- | ----------------- | | **Approach** | Production-grade infrastructure | Rapid prototyping | | **Deploys to your own cloud (AWS/GCP)** | ✅ Yes | ❌ No | | **Real backend logic & microservices** | ✅ Yes | ❌ No | | **Infrastructure-as-code by default** | ✅ Yes | ❌ No | | **Built-in distributed tracing** | ✅ Yes | ❌ No | | **Multi-environment support** | ✅ Yes | ❌ No | | **Type-safe distributed systems** | ✅ Yes | ❌ No | | **Avoids vendor lock-in** | ✅ Yes | ❌ No | ## When to choose each **Choose Lovable for:** * Quick frontend demos and validation * Non-technical founders building prototypes * Simple apps with basic Supabase integration * Speed over production architecture **Choose Leap for:** * Backend-heavy applications with real infrastructure * Production systems requiring scalability * Microservices and distributed architectures * Deployment to your own cloud ## The difference **Lovable** creates React frontends with basic backend integration - perfect for demos and validation. **Leap** creates complete distributed systems with proper backend services, databases, and cloud infrastructure - built for production from day one. # Leap vs Windsurf Source: https://docs.leap.new/comparisons/leap-vs-windsurf System generation meets accessible AI coding - perfect combination for growing teams Windsurf is a beginner-friendly AI IDE with clean UX. Leap generates production distributed systems. Perfect combination for accessible development. ## Key differences | | Leap | Windsurf | | ----------------------------------- | --------------------------------- | ----------------------------- | | **Best for** | Starting new projects (0→1) | Accessible AI coding (1→N) | | **Primary use case** | Generate systems & infrastructure | Beginner-friendly development | | **Generates distributed systems** | ✅ Yes | ❌ No | | **Works with any existing project** | ❌ No | ✅ Yes | | **Creates cloud infrastructure** | ✅ Yes | ❌ No | | **Intuitive AI for beginners** | ❌ No | ✅ Yes | | **Production observability** | ✅ Yes | ❌ No | ## Why they work well together **Use Leap to:** * Generate complete system architecture * Create backend services and databases * Set up production infrastructure and deployment **Use Windsurf to:** * Accessible AI-powered feature development * Intuitive multi-file editing with Cascade * Clean development experience without complexity ## Recommended workflow 1. **Generate foundation with Leap** - Production system with proper architecture 2. **Develop with Windsurf** - Accessible AI assistance for ongoing work 3. **Seamless transitions** - GitHub integration keeps everything synchronized # Connect AWS Account Source: https://docs.leap.new/deployment/aws Deploy your Leap application to your own AWS account through Encore Cloud Connect your AWS account to Encore Cloud to deploy your Leap application directly to your own AWS infrastructure. This gives you full data sovereignty while leveraging Encore's deployment automation. ## Prerequisites * Active AWS account with appropriate permissions * Ability to create IAM roles in your AWS account * Understanding of which AWS region you want to deploy to * Your application built and tested with Leap * Preview environment validated and working * Ready to deploy to production infrastructure ## Connection Process In your Leap project: 1. Go to the [Encore Cloud dashboard](https://app.encore.cloud/) 2. Select your application 3. Navigate to **App Settings** → **Integrations** → **Connect Cloud** 4. Select **Amazon Web Services (AWS)** Follow the detailed instructions provided on the Connect Cloud page to: * Create a new IAM Role in your AWS account * Configure the trust relationship with Encore Cloud * Attach the necessary permissions for infrastructure provisioning **Security requirement**: Make sure to check **"Require external ID"** and specify the external ID provided in the Encore Cloud instructions. This is critical for security. Back in Encore Cloud: * Enter the ARN of the IAM role you created * Verify the external ID matches what you configured * Test the connection to ensure Encore can assume the role Select which AWS region you want Encore Cloud to provision resources in: * Consider latency to your users * Review AWS region capabilities and compliance requirements * Factor in your existing AWS infrastructure location [Learn more about AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) ## What Gets Deployed When you deploy to your AWS account through Encore Cloud, the following infrastructure is automatically provisioned: **Container-based application hosting** * AWS services appropriate for your application architecture * Auto-scaling based on demand * Load balancing for high availability * Security groups with proper network isolation **Managed database services** * Amazon RDS for PostgreSQL (or your configured database) * Automated backups and maintenance * Multi-AZ deployment for production environments * Proper security configuration and access controls **Production-ready network configuration** * VPC with appropriate subnet configuration * Security groups following least-privilege principles * SSL/TLS certificates for secure communication * IAM roles and policies for service access **Observability integration** * CloudWatch integration for metrics and logs * Integration with Encore's monitoring dashboard * Alerting configuration for critical events * Performance monitoring and optimization insights ## IAM Permissions The IAM role you create needs appropriate permissions to provision and manage infrastructure in your AWS account. The exact permissions required will be specified in the Connect Cloud setup instructions, but typically include: **Essential AWS services for application deployment** * **Compute**: ECS, Fargate, or EC2 for running your application * **Database**: RDS for managed database services * **Networking**: VPC, subnets, security groups, and load balancers * **Storage**: S3 for application assets and backups **IAM and security service permissions** * **IAM**: Create and manage service roles * **Secrets Manager**: Store and manage application secrets * **Certificate Manager**: Provision SSL certificates * **CloudWatch**: Monitoring and logging **Recommended security configuration** ✅ **Use external ID**: Always require external ID for role assumption ✅ **Least privilege**: Only grant permissions necessary for deployment ✅ **Regular review**: Periodically review and update permissions ✅ **Condition policies**: Use condition policies to restrict access further ## Managing Your Deployment **Monitor and manage through Encore** * View application performance and health * Access logs and distributed tracing * Manage deployments and rollbacks * Configure environments and settings **Direct access to your infrastructure** * View and manage AWS resources directly * Access detailed CloudWatch metrics * Configure additional AWS services * Manage billing and cost optimization ## Important Considerations **Understanding infrastructure lifecycle** * Encore Cloud provisions infrastructure in your AWS account * Resources are billed directly to your AWS account * **Manual approval required** for resource deletion for safety * If you disconnect or delete environments, you must explicitly approve infrastructure deletion in the Encore Cloud dashboard **Controlling AWS costs** * Use AWS Cost Explorer to monitor spending * Set up billing alerts in your AWS account * Leverage existing AWS Reserved Instances or Savings Plans * Consider AWS resource optimization recommendations **Maintaining security standards** * Your data remains in your AWS account at all times * Leverage your existing AWS security policies * Use AWS CloudTrail for audit logging * Implement your organization's compliance requirements ## Troubleshooting **Common IAM role problems** **Problem**: Encore Cloud cannot assume the IAM role **Solution**: * Verify the external ID is correctly configured * Check that the trust relationship includes Encore's account * Ensure the role has necessary permissions * Confirm you're using the correct role ARN **Insufficient permissions during deployment** **Problem**: Deployment fails due to missing permissions **Solution**: * Review the permissions required in the Connect Cloud instructions * Check AWS CloudTrail logs for specific permission denials * Ensure the IAM role has all required service permissions * Contact support if you need clarification on required permissions **Deployment region problems** **Problem**: Resources cannot be created in selected region **Solution**: * Verify the region supports all required AWS services * Check for any organization-level region restrictions * Ensure your AWS account has appropriate limits in the region * Consider selecting an alternative region if needed ## Getting Help If you encounter issues during the AWS connection process: **Additional AWS resources** * [AWS IAM Roles Documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) * [AWS Regions and Availability Zones](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) * AWS Support for account-specific issues *** **Next steps**: After connecting your AWS account, you can deploy your application by clicking **Deploy** in your Leap project and selecting your AWS environment. The first deployment typically takes 10-15 minutes as infrastructure is provisioned. # Custom Domains Source: https://docs.leap.new/deployment/custom-domains Connect your Leap application to a custom domain When your Leap application is ready for production, you may want to serve it from your own domain rather than the default Encore-provided URL. This guide walks you through the process of connecting a custom domain to your Leap application. Custom domains are available for [Leap Pro plan](https://leap.new/#pricing) subscribers. ## Setting up a Custom Domain Follow these steps to connect your domain to your Leap application: 1. In your Leap project, click the **Deploy** button in the top-right corner 2. After deployment, click the **+ Custom Domain** button which will take you to the Domains settings page. 3. Click the **Add Domain** button to open the domain configuration modal Add Domain Modal In the Add Domain modal: 1. Enter your domain (e.g., `your-domain.com`) 2. The modal will show you the DNS record you need to add to your domain provider: ``` Type: CNAME DNS Record: api.your-domain.com (your subdomain) Value: custom-domain.encr.app ``` 3. Select the environment you want to assign the domain to. 4. Click **Add Domain** to complete the setup 5. Add the specified DNS record with your domain provider (see DNS Configuration section below) Your custom domain comes with DDoS protection powered by Cloudflare WAF. ## DNS Configuration After adding your domain, you'll need to set up the appropriate DNS records with your domain registrar. Select your provider below for specific instructions. 1. Log in to your Namecheap account 2. Go to **Domain List** and click **Manage** next to your domain 3. Select the **Advanced DNS** tab 4. Click **Add New Record** 5. Enter the following details: * Type: CNAME Record * Host: Enter your subdomain (e.g., `api` for `api.your-domain.com`) * Value: `custom-domain.encr.app` * TTL: Automatic 6. Click **Save All Changes** 1. Log in to your GoDaddy account 2. Navigate to **My Products** > **Domains** 3. Select the domain you want to use 4. Click **DNS** 5. Under **Records**, click **Add** 6. Select **CNAME** from the Type dropdown 7. Enter the following details: * Host: Enter your subdomain (e.g., `api` for `api.your-domain.com`) * Points to: `custom-domain.encr.app` * TTL: 1 Hour 8. Click **Save** 1. Log in to your Cloudflare account 2. Select your domain 3. Go to the **DNS** tab 4. Click **Add record** 5. Select **CNAME** from the Type dropdown 6. Enter the following details: * Name: Enter your subdomain (e.g., `api` for `api.your-domain.com`) * Target: `custom-domain.encr.app` * Proxy status: Proxied (recommended) 7. Click **Save** 1. Log in to your Google Domains account 2. Select your domain 3. Go to **DNS** 4. Scroll down to **Custom resource records** 5. Enter the following details: * Name: Enter your subdomain (e.g., `api` for `api.your-domain.com`) * Type: CNAME * TTL: 1h * Data: `custom-domain.encr.app` 6. Click **Add** For other DNS providers, you'll need to: 1. Log in to your domain registrar's account 2. Locate the DNS or Domain Management section 3. Look for an option to add a new DNS record 4. Create a CNAME record with: * Host/Name: Your subdomain (e.g., `api` for `api.your-domain.com`) or `@` for root domain * Value/Target/Points to: `custom-domain.encr.app` * TTL: 3600 (1 hour) or the lowest available value ## Verifying Your Domain After setting up the DNS record: 1. It may take some time for DNS changes to propagate (typically 15 minutes to 48 hours) 2. You can check the status of your domain on the Domains settings page 3. Once verified, your application will be accessible via your custom domain ## Troubleshooting If you encounter issues with your custom domain setup: * Verify that your DNS record is correct and matches the provided instructions * Check if your DNS changes have propagated using a tool like [dnschecker.org](https://dnschecker.org) * Ensure your domain doesn't have conflicting DNS records * Contact support via the Encore Cloud dashboard if you continue to experience issues # Connect Google Cloud Account Source: https://docs.leap.new/deployment/gcp Deploy your Leap application to your own GCP account through Encore Cloud Connect your Google Cloud Platform account to Encore Cloud to deploy your Leap application directly to your own GCP infrastructure. Encore provides a dedicated GCP Service Account for your application and guides you through the setup process. ## Prerequisites * Access to a GCP Organization account * **Organization Policy Administrator** role (required for setup) * Billing enabled on your GCP project * Understanding of which GCP region you want to deploy to * Your application built and tested with Leap * Preview environment validated and working * Ready to deploy to production infrastructure ## Connection Process In your Leap project: 1. Go to the [Encore Cloud dashboard](https://app.encore.cloud/) 2. Select your application 3. Navigate to **App Settings** → **Integrations** → **Connect Cloud** 4. Select **Google Cloud Platform (GCP)** Encore Cloud provides a unique GCP Service Account for your application: * Find your app's Service Account email on the Connect Cloud page * Copy this email address - you'll need it for the next steps * This Service Account will be used by Encore to provision infrastructure Update your GCP Organization's domain restricted sharing policy: * Add Encore Cloud to your allowed domains list * Follow the specific instructions provided on the Connect Cloud page * This allows Encore's Service Account to access your organization **Permission required**: You need the **Organization Policy Administrator** role to modify this policy. Provide the necessary permissions to Encore's Service Account: * Use the Service Account email from step 2 * Follow the detailed permission instructions on the Connect Cloud page * Grant access to provision infrastructure in your GCP project ## Required Permissions **Required for initial setup** If you don't have the Organization Policy Administrator role: 1. Ask your GCP Organization Administrator to grant you the role 2. Alternatively, have them complete the domain restriction setup for you **If you are a GCP Organization Administrator:** 1. Go to the [IAM & Admin page](https://console.cloud.google.com/iam-admin/iam) in GCP Console 2. Find your user account in the members list 3. Click the pencil icon to edit your account 4. Add the **Organization Policy Administrator** role 5. Click Save **Infrastructure provisioning permissions** The Encore Service Account needs permissions to: * Create and manage compute resources * Provision managed database services * Configure networking and security * Set up monitoring and logging * Manage IAM roles for your application Specific permissions will be detailed in the Connect Cloud setup instructions. ## What Gets Deployed When you deploy to your GCP account through Encore Cloud, the following infrastructure is automatically provisioned: **Cloud-native application hosting** * Google Cloud Run or Compute Engine services * Load balancing and auto-scaling * VPC and firewall configuration * SSL certificates and domain management **Managed database and storage** * Cloud SQL for managed databases * Cloud Storage for application assets * Automated backups and maintenance * Security and access controls **Enterprise security configuration** * IAM roles and service accounts * Security policies and firewall rules * Encryption at rest and in transit * Network isolation and access controls **Observability and management** * Cloud Monitoring integration * Cloud Logging for centralized logs * Integration with Encore's monitoring * Performance tracking and alerting ## Managing Multiple GCP Accounts **Working with multiple GCP accounts** If you have access to multiple GCP accounts: * Ensure you're logged in with the correct account * Verify the correct organization is selected in GCP Console * Double-check you're modifying policies for the right organization * Use the account switcher in GCP Console if needed **Understanding GCP organization hierarchy** * **Organization**: Top-level container for all GCP resources * **Folders**: Optional grouping for projects (if used) * **Projects**: Where your actual resources will be deployed * **Resources**: The infrastructure Encore provisions ## Troubleshooting Common Issues **Missing Organization Policy Administrator role** **Problem**: You can't access or modify the Domain restricted sharing policy **Solution**: * You need the **Organization Policy Administrator** role * Ask your GCP Organization Administrator to grant you this role * Alternatively, have them complete the setup for you * Follow the role assignment steps in the permissions section above **Service Account access issues** **Problem**: Unable to grant access to the Encore Cloud service account **Possible causes and solutions**: * **Domain restriction not configured**: Ensure you've added Encore Cloud to your Domain restricted sharing policy * **Wrong GCP account**: Verify you're logged in with the correct account * **Wrong organization**: Ensure the correct organization is selected in GCP Console * **Multiple accounts**: If using several GCP accounts, make sure you're working with the right one **Organization connectivity issues** **Problem**: Error message about missing Organization ID **Solution**: * Verify you've completed all steps in the Connect Cloud page * Ensure Encore Cloud has been granted access to your GCP Organization * Check that you're logged in with the correct GCP account * Confirm the correct organization is selected in GCP Console * If using multiple GCP accounts, verify you're working with the intended one **Insufficient permissions for infrastructure provisioning** **Problem**: Deployment fails due to missing permissions **Solution**: * Review the permission requirements in the Connect Cloud instructions * Ensure the Encore Service Account has all necessary permissions * Check GCP audit logs for specific permission denials * Verify you're working within the correct GCP project ## After Connection Once you've successfully connected your GCP account: * Encore Cloud will test the connection to your GCP account * You should see a success confirmation * Your GCP account will appear as an available deployment target Select which GCP region you want for your deployment: * Consider latency to your users * Review regional service availability * Factor in compliance and data residency requirements * Consider integration with existing GCP infrastructure * Click **Deploy** in your Leap project * Select your GCP environment * Monitor the deployment progress in Encore Cloud dashboard * First deployment typically takes 10-15 minutes ## Important Notes **Understanding infrastructure lifecycle** * Encore Cloud provisions infrastructure in your GCP account * Resources are billed directly to your GCP account * **Manual approval required** for resource deletion for safety * Always approve infrastructure deletion in Encore Cloud dashboard when disconnecting **Managing GCP costs** * All infrastructure costs appear in your GCP billing * Use GCP's cost management tools to monitor spending * Leverage existing GCP committed use discounts * Set up billing alerts in your GCP account **Maintaining your security posture** * Your data remains in your GCP account at all times * Leverage your existing GCP security policies * Use Cloud Audit Logs for compliance tracking * Implement your organization's security requirements ## Getting Help If you encounter issues during the GCP connection process: **Additional GCP resources** * [GCP IAM Documentation](https://cloud.google.com/iam/docs) * [Organization Policy Constraints](https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints) * GCP Support for account-specific issues *** **Next steps**: After connecting your GCP account, you can deploy your application by selecting your GCP environment in the deployment options. Monitor the deployment progress through the Encore Cloud dashboard. # Deployment Overview Source: https://docs.leap.new/deployment/overview Deploy your Leap applications to Encore Cloud or your own AWS/GCP infrastructure When you're ready to share your app with the world, it's time to deploy it. Leap apps can be deployed automatically using Leap's integration with Encore Cloud. Just click **Deploy** in the top-right corner of Leap to open the deployment dialog. From there, you can choose to deploy to a free Encore Cloud-hosted environment or connect your own AWS or GCP account. Deploy button Deploy Modal Encore Cloud's built-in hosting is ideal for small-scale projects and comes with [**usage limits**](https://encore.dev/docs/platform/management/usage). To remove these limits, you can deploy to your own AWS or GCP account, where resources are billed directly to you. **Same experience either way**: Whether you deploy to Encore's infrastructure or your own cloud, you get the same monitoring, scaling, and developer experience through Encore Cloud. ## Deploying to your own cloud With Encore Cloud you can automate deployments to your own AWS or GCP account. This requires an [Encore Cloud Pro subscription](https://encore.cloud/pricing), which enables Encore Cloud to orchestrate the deployment to your cloud provider. Here's what you get: * **One click deploys** - Encore Cloud handles CI/CD and orchestrates infrastructure provisioning * **Data sovereignty** - Your data stays in your cloud account * **Compliance** - Meet enterprise and regulatory requirements * **Cost control** - Use existing cloud discounts and reserved instances * **Security** - Deploy within your existing VPC and security models **Setup guides** Complete guide for AWS deployment Step-by-step GCP setup *** **Ready to deploy?** Start with one-click deployment to Encore infrastructure, then connect your cloud account when you're ready for production control. [Build your first app →](/getting-started/quickstart) # Meet Leap Source: https://docs.leap.new/getting-started/introduction AI developer agent that builds production-grade apps and deploys them to your own cloud