### Clone and Setup Project Source: https://github.com/michael/editable-website/blob/main/README.md Steps to clone the editable-website repository from GitHub and navigate into the project directory to begin setup. ```bash git clone https://github.com/michael/editable-website.git cd editable-website ``` -------------------------------- ### Start Development Server Source: https://github.com/michael/editable-website/blob/main/README.md Launches the SvelteKit development server, allowing for live reloading and testing of the website during development. ```bash npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/michael/editable-website/blob/main/README.md Installs all necessary Node.js packages required for the SvelteKit project using npm. ```bash npm install ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/michael/editable-website/blob/main/README.md Copies the example environment file and sets crucial configuration parameters such as the SQLite database path, admin password, and the application's origin URL. ```bash DB_PATH=./data/db.sqlite3 ADMIN_PASSWORD=xxxxxxxxxxxx ORIGIN=http://localhost:5173 ``` -------------------------------- ### Imprint Page Svelte Component Source: https://github.com/michael/editable-website/blob/main/README.md Example Svelte component for an 'Imprint' page, demonstrating the use of editable text components (`PlainText`, `RichText`) and site navigation elements. ```svelte Imprint {#if showUserMenu} (showUserMenu = false)}>
Edit page
{/if} {#if editable} {/if}

</h1> <div class="prose md:prose-xl pb-12 sm:pb-24"> <RichText multiLine {editable} bind:content={imprint} /> </div> </div> </div> <Footer counter="/imprint" /> ``` -------------------------------- ### Preview Production Build Source: https://github.com/michael/editable-website/blob/main/README.md Serves the production build locally to preview the final application before deployment. ```bash npm run preview ``` -------------------------------- ### Initial Fly.io Deployment Source: https://github.com/michael/editable-website/blob/main/README.md Steps to create a new Fly.io application and deploy your site. This includes setting up build secrets for the deployment process. ```shell cd myapp fly apps create # Follow prompts to name your app and choose an organization cp fly.toml.example fly.toml # Edit fly.toml to set app = "your-app-name" and source = "your_app_data" fly deploy \ --build-secret DB_PATH="./data/db.sqlite3" \ --build-secret ADMIN_PASSWORD="your-super-secret-admin-password" \ --build-secret ORIGIN="https://myapp.fly.dev" ``` -------------------------------- ### Seed SQLite Database Source: https://github.com/michael/editable-website/blob/main/README.md Initializes the SQLite database by applying the schema defined in the SQL file. ```bash sqlite3 data/db.sqlite3 < sql/schema.sql ``` -------------------------------- ### Build Production Version Source: https://github.com/michael/editable-website/blob/main/README.md Creates an optimized production build of the SvelteKit application, ready for deployment. ```bash npm run build ``` -------------------------------- ### Fly.io CLI and SQLite for Database Backups and Restore Source: https://github.com/michael/editable-website/blob/main/README.md Procedures for backing up and restoring a SQLite database on Fly.io using SSH console and SFTP. Includes integrity checks and remote/local file operations. ```APIDOC Fly CLI & SQLite - Backup and Restore: Backup Process (Remote): 1. Access the application's console: fly ssh console 2. Create a backup of the SQLite database: sqlite3 data/db.sqlite3 ".backup data/backup-db.sqlite3" 3. (Optional) Perform an integrity check on the backup: sqlite3 data/backup-db.sqlite3 "PRAGMA integrity_check;" 4. Exit the remote console: CTRL+D 5. Download the backup file locally: rm -rf data/db.* fly sftp get data/backup-db.sqlite3 data/db.sqlite3 Restore Process (Production): 1. Prevent writes to the application (if possible): (Manual step or application-level lock) 2. Create a remote backup before proceeding: fly ssh console sqlite3 data/db.sqlite3 ".backup data/backup-db.sqlite3" sqlite3 data/backup-db.sqlite3 "PRAGMA integrity_check;" rm -rf data/db.* Exit the remote console (CTRL+D) 3. Upload the local backup file to the production server: fly sftp shell cd app/data put data/db.sqlite3 Exit SFTP client (CTRL+D) 4. Restart the application to load the new database: fly apps restart ``` -------------------------------- ### Fly.io CLI Commands for Domain Management Source: https://github.com/michael/editable-website/blob/main/README.md Commands to manage IP addresses and SSL certificates for your Fly.io application, enabling custom domain connections. ```APIDOC Fly CLI - Domain Management: fly ips list -a <your-app-name> - Description: Lists the IPv4 and IPv6 addresses assigned to your Fly.io application. - Parameters: - -a, --app: The name of your Fly.io application. - Returns: A list of IP addresses. fly certs create -a <your-app-name> <your-domain.com> - Description: Creates an SSL certificate for your custom domain. - Parameters: - -a, --app: The name of your Fly.io application. - <your-domain.com>: The custom domain name for which to create a certificate. - Usage: Requires A and AAAA records to be set up at your DNS provider pointing to the app's IP addresses. fly certs show -a <your-app-name> <your-domain.com> - Description: Shows the status of SSL certificates for your custom domain. - Parameters: - -a, --app: The name of your Fly.io application. - <your-domain.com>: The custom domain name. - Returns: Certificate status and details. ``` -------------------------------- ### Page Server Logic Reference Source: https://github.com/michael/editable-website/blob/main/README.md Reference to the server-side logic file for a SvelteKit page, typically handling data fetching and mutations. ```javascript src/routes/imprint/+page.server.js ``` -------------------------------- ### ProseMirror Schema Reference Source: https://github.com/michael/editable-website/blob/main/README.md Reference to the file defining the ProseMirror schemas used for rich text editing within the application. ```javascript src/lib/prosemirrorSchemas.js ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.