### Example SQL Migration File Structure Source: https://docs.lovable.dev/tips-tricks/external-deployment-hosting This example illustrates the naming convention and chronological order for SQL migration files in the 'supabase/migrations/' folder. Migrations should be run in the order they appear, based on the timestamp in the filename, from earliest to latest. ```sql 20251008155159_[hash].sql # first - earliest 20251008155215_[hash].sql # second ``` -------------------------------- ### Example Prompts for Lovable Plan Mode Source: https://docs.lovable.dev/features/plan-mode Illustrates how to activate Plan mode and provides examples of specific prompts for various use cases, including feature implementation, exploration, debugging, and code review. ```text Add email/password authentication with password reset. Users should stay logged in for 30 days. Use Lovable Cloud. ``` ```text What's the best way to implement real-time notifications in this project? Walk me through the options and their tradeoffs. ``` ```text Users report the login form doesn't work on mobile. Help me figure out why. ``` ```text Break down the implementation of a shopping cart feature. What components, database tables, and API endpoints will I need? ``` ```text Review my current authentication setup. What security improvements should I make? ``` -------------------------------- ### Prompt Lovable for Backend-Only Supabase Docker Compose Setup Source: https://docs.lovable.dev/tips-tricks/external-deployment-hosting Prompt the Lovable agent to create a Docker Compose setup for a self-hosted Supabase backend. This excludes the frontend container, allowing for separate frontend development or hosting. ```text Create a Docker Compose setup for a self-hosted Supabase backend only (no frontend container) ``` -------------------------------- ### GET / (Build with URL) Source: https://docs.lovable.dev/integrations/build-with-url This endpoint triggers the Lovable application builder by passing a prompt and optional reference images via URL parameters. The request is processed automatically when the autosubmit parameter is set to true. ```APIDOC ## GET https://lovable.dev/ ### Description Triggers the automated creation of a Lovable application based on a provided prompt and optional reference images. ### Method GET ### Endpoint https://lovable.dev/?autosubmit=true# ### Parameters #### Query Parameters - **autosubmit** (boolean) - Required - Must be set to 'true' to automatically process the request. - **prompt** (string) - Required - Text describing the application to build (max 50,000 chars). Must be URL encoded. - **images** (string) - Optional - Up to 10 publicly accessible image URLs (JPEG, PNG, WebP). Must be URL encoded. ### Request Example https://lovable.dev/?autosubmit=true#prompt=Create%20a%20todo%20app&images=https://example.com/design.png ### Response #### Success Response (200) - **Redirect** - The user is redirected to the Lovable workspace selection or authentication flow, followed by automatic app generation. #### Response Example N/A (Browser redirect to Lovable application builder) ``` -------------------------------- ### Prompting - Role-Based Access Control (Shell) Source: https://docs.lovable.dev/tips-tricks/best-practice Example prompt demonstrating how to specify role-based access control for UI components. This helps ensure that only intended roles can access or interact with certain features. ```shell I want users with the role Investor to access this component, but not Admins. ``` -------------------------------- ### Clone Repository and Initialize Project Source: https://docs.lovable.dev/tips-tricks/external-deployment-hosting Commands to clone a GitHub repository and navigate into the project directory to begin the deployment process. ```bash git clone cd ``` -------------------------------- ### Deploying Application to a Manual Server Source: https://docs.lovable.dev/tips-tricks/external-deployment-hosting Commands to clone, build, and transfer a Lovable application to a remote server. It includes environment variable injection and file transfer methods using scp or rsync. ```bash git clone cd npm ci VITE_SUPABASE_URL= \ VITE_SUPABASE_PUBLISHABLE_KEY= \ npm run build scp -r dist/* user@your-server:/var/www/html/ rsync -avz dist/ user@your-server:/var/www/html/ ``` -------------------------------- ### Plan Mode - Specific Implementation Guidance (Shell) Source: https://docs.lovable.dev/tips-tricks/best-practice Example prompt for providing detailed instructions within Plan mode, including the page, feature, expected behavior, components to avoid, and best practices from specific frameworks. ```shell On page /settings, implement [feature]. The expected behavior is [XYZ]. Please don’t touch component A, layout B, or shared logic unless necessary. Follow best practices from Tailwind / Supabase / X. ``` -------------------------------- ### Prompt Lovable for Full Stack Docker Compose Deployment Source: https://docs.lovable.dev/tips-tricks/external-deployment-hosting Request the Lovable agent to generate a Docker Compose setup that bundles both the frontend and a self-hosted Supabase stack. This is suitable for fully self-contained deployments. ```text Dockerize this project with a self-hosted Supabase backend bundled in Docker Compose ``` -------------------------------- ### Prompting - Guardrails (Shell) Source: https://docs.lovable.dev/tips-tricks/best-practice Example prompt illustrating how to set guardrails by specifying files or components that should not be edited. This prevents unintended modifications to critical parts of the codebase. ```shell Do not edit /shared/Layout.tsx. ```