### Install and Run Project Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Use these commands to install project dependencies and start the development server. ```bash pnpm install pnpm dev ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/hello_world/linux/CMakeLists.txt Initializes CMake version and project name. Sets the binary name and application ID. Configures installation path and build type. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) set(BINARY_NAME "hello_world") set(APPLICATION_ID "com.example.hello_world") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() # Configure build options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### FastForge Exe Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/exe.md Configure Inno Setup options for your executable. Ensure `AppId` is unique for each application. Specify publisher details, display name, and whether to create a desktop icon. You can also customize the installation directory name and the setup icon file. ```yaml # The value of AppId uniquely identifies this application. # Do not use the same AppId value in installers for other applications. app_id: 5B599538-42B1-4826-A479-AF079F21A65D publisher: LeanFlutter publisher_url: https://github.com/leanflutter/fastforge display_name: Hello 世界 create_desktop_icon: true # See: https://jrsoftware.org/ishelp/index.php?topic=setup_defaultdirname # install_dir_name: "D:\\HELLO-WORLD" # This path is relative to the root directory of your project; The format of icon file must be ico, can not be png or others # setup_icon_file: windows\runner\resources\app_icon.ico locales: - en - zh ``` -------------------------------- ### Install Fastforge CLI Locally Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/cli/README.md Install the fastforge CLI globally on your system using cargo. After installation, you can run `fastforge` commands directly. ```bash cargo install --path crates/fastforge fastforge --help ``` -------------------------------- ### Example dmg_maker execution Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/dmg_maker/README.md A concrete example demonstrating how to run dmg_maker with specific JSON configuration and DMG output paths. ```bash cargo run -p dmg_maker -- \ crates/dmg_maker/examples/standard.json \ crates/dmg_maker/examples/sample.dmg ``` -------------------------------- ### Build all example DMGs Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/dmg_maker/README.md Execute a shell script to build all the example DMG files provided with the dmg_maker project. ```bash ./crates/dmg_maker/examples/build_examples.sh ``` -------------------------------- ### Fastforge Configuration Example Source: https://github.com/fastforgedev/fastforge/blob/dev/README.md Example `distribute_options.yaml` file for configuring releases. It specifies variables, output directory, and release jobs for different platforms and distribution targets. Ensure API keys are replaced with your own. ```yaml variables: PGYER_API_KEY: "your api key" # Replace with your own API keys output: dist/ releases: - name: dev jobs: # Build and publish APK to PGYER - name: release-dev-android package: platform: android target: apk build_args: target-platform: android-arm,android-arm64 dart-define: APP_ENV: dev publish_to: pgyer # Build and publish IPA to PGYER - name: release-dev-ios package: platform: ios target: ipa build_args: export-options-plist: ios/dev_ExportOptions.plist dart-define: APP_ENV: dev publish_to: pgyer ``` -------------------------------- ### Install Executable and Data Files Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/CMakeLists.txt Installs the application executable, ICU data file, Flutter library, and bundled plugin libraries into a relocatable bundle. The installation prefix is configured to create a clean bundle directory. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Install appdmg Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/dmg.md Install the appdmg global CLI tool. This is a prerequisite for creating DMG files. ```bash npm install -g appdmg ``` -------------------------------- ### Installation Rules for Application Bundle Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/hello_world/linux/CMakeLists.txt Configures the installation process to create a relocatable application bundle. It cleans the bundle directory, installs the executable, Flutter data, libraries, and assets. ```cmake # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install appimagetool Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/appimage.md Downloads and installs the `appimagetool` utility, which is essential for building AppImage files. Ensure the downloaded file is executable and moved to a directory in your system's PATH. ```bash wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" chmod +x appimagetool mv appimagetool /usr/local/bin/ ``` -------------------------------- ### Run Shell UI Kit Examples Source: https://github.com/fastforgedev/fastforge/blob/dev/packages/shell_uikit/example/README.md Navigate to the shell_uikit package directory and use the dart run command to execute specific examples. ```bash # Navigate to the shell_uikit package directory cd packages/shell_uikit # Run the progress bar example dart run example/progress_bar_example.dart # Run the spinner example dart run example/spinner_example.dart ``` -------------------------------- ### Initialize Build Bundle Directory Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/CMakeLists.txt Sets the installation prefix to a bundle directory within the project's binary directory. This ensures that 'installing' creates a self-contained, relocatable bundle. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() ``` -------------------------------- ### Create an API Route Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Define an API route using `createFileRoute` and the `server` property. This example creates a '/api/hello' route with a GET handler that returns a JSON response. ```tsx import { createFileRoute } from '@tanstack/react-router' import { json } from '@tanstack/react-start' export const Route = createFileRoute('/api/hello')({ server: { handlers: { GET: () => json({ message: 'Hello, World!' }), }, }, }) ``` -------------------------------- ### Custom Inno Setup Template Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/exe.md To use a custom Inno Setup template, add the `script_template` option to your `make_config.yaml` file, specifying the path to your custom `.iss` file. This allows for advanced control over the generated Inno Setup script. ```yaml script_template: inno_setup.iss ``` -------------------------------- ### Example Custom Publish Script Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/custom.md A basic shell script demonstrating how to access the artifact path and implement custom publishing logic. Ensure the script is executable. ```sh #!/bin/sh set -e echo "Publishing artifact: $ARTIFACT_PATH" # Add your custom publish logic here ``` -------------------------------- ### Create a Server Function Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Define a server function using `createServerFn` from `@tanstack/react-start`. This example creates a GET request handler that returns the current server time. ```tsx import { createServerFn } from '@tanstack/react-start' const getServerTime = createServerFn({ method: 'GET', }).handler(async () => { return new Date().toISOString() }) ``` -------------------------------- ### Install locate Package Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/appimage.md Installs the 'locate' package on Ubuntu/Debian-based systems, which is a requirement for AppImage creation. ```bash sudo apt install locate ``` -------------------------------- ### Install Firebase CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/firebase.md Install the Firebase CLI globally using npm. This is a prerequisite for using Firebase services from the command line. ```bash npm install -g firebase-tools ``` -------------------------------- ### Get dmg_maker help Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/dmg_maker/README.md Display the help message for the dmg_maker command-line tool to understand available options and usage. ```bash cargo run -p dmg_maker -- --help ``` -------------------------------- ### Install Fastforge CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/cli.md Activate the Fastforge CLI globally using Dart's package manager. ```bash dart pub global activate fastforge ``` -------------------------------- ### Install parse_app_package Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/tools/parse-app-package.md Installs the parse_app_package tool globally using Dart's package manager. ```bash dart pub global activate parse_app_package ``` -------------------------------- ### Install Flutter Assets Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/CMakeLists.txt Installs Flutter assets to the application bundle's data directory. It first removes any existing assets to ensure a clean installation. ```cmake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install( CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Example Distribution Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/distribute-options.md This configuration defines build and publish jobs for both Android and iOS applications targeting the Pgyer platform. It includes environment variables, output directory, and specific build arguments for each platform. ```yaml variables: PGYER_API_KEY: 'your api key' output: dist/ releases: - name: dev jobs: # Build and publish your apk pkg to pgyer - name: release-dev-android package: platform: android target: apk build_args: flavor: dev target-platform: android-arm,android-arm64 dart-define: APP_ENV: dev publish_to: pgyer # Build and publish your ipa pkg to pgyer - name: release-dev-ios package: platform: ios target: ipa build_args: flavor: dev export-options-plist: ios/dev_ExportOptions.plist dart-define: APP_ENV: dev publish_to: pgyer ``` -------------------------------- ### Install p7zip on macOS Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/zip.md Use Homebrew to install the p7zip package, which is a requirement for creating zip archives. ```bash brew install p7zip ``` -------------------------------- ### Configure Firebase Hosting in `distribute_options.yaml` Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/firebase-hosting.md Configure your `distribute_options.yaml` file to specify the output directory, release name, and Firebase Hosting as the publishing target. This setup automates the release process. ```yaml output: dist/ releases: - name: dev jobs: - name: web-direct package: platform: web target: direct publish: target: firebase-hosting args: project-id: your-project-id ``` -------------------------------- ### Configure Release Jobs for Android and iOS Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/getting-started.md Define release configurations, including package details and publishing targets. This example configures jobs for building and publishing APK for Android and IPA for iOS to Pgyer. ```yaml releases: - name: dev jobs: # Build and publish your apk pkg to pgyer - name: release-dev-android package: platform: android target: apk build_args: flavor: dev target-platform: android-arm,android-arm64 dart-define: APP_ENV: dev publish_to: pgyer # Build and publish your ipa pkg to pgyer - name: release-dev-ios package: platform: ios target: ipa build_args: flavor: dev export-options-plist: ios/dev_ExportOptions.plist dart-define: APP_ENV: dev publish_to: pgyer ``` -------------------------------- ### GitHub Actions CI/CD Integration for Fastforge Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/getting-started.md Use this GitHub Actions workflow to automate the installation of Fastforge and trigger a release. Ensure your API_KEY is set as a secret in your repository. ```yaml jobs: build-and-release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 - name: Install Fastforge run: dart pub global activate fastforge - name: Build and release run: fastforge release --name production env: API_KEY: ${{ secrets.API_KEY }} ``` -------------------------------- ### Configure Vercel Publishing in `distribute_options.yaml` Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/vercel.md Configure your `distribute_options.yaml` file to specify Vercel as a publishing target for your releases. This setup allows for automated deployments. ```yaml output: dist/ releases: - name: dev jobs: - name: web-direct package: platform: web target: direct publish: target: vercel args: org-id: your-org-id project-id: your-project-id ``` -------------------------------- ### PKG Build Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/pkg.md Add this `make_config.yaml` file to your project's `macos/packaging/pkg` directory to configure the PKG build. Specify the installation path and the signing identity. ```yaml install-path: /Applications sign-identity: ``` -------------------------------- ### Flutter and GTK Dependency Setup Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/hello_world/linux/CMakeLists.txt Includes the Flutter managed directory and finds the GTK+ 3.0 package using PkgConfig. Defines the application ID as a preprocessor macro. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") # Flutter library and tool build rules. add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Build Project for Production Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Run this command to create a production build of your application. ```bash pnpm build ``` -------------------------------- ### Build and Run Fastforge CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/cli/README.md Build the fastforge crate and show its help message. Run commands from the repository root. ```bash # From repository root cargo build -p fastforge # Show help cargo run -p fastforge -- --help ``` -------------------------------- ### Build Windows Executable Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/exe.md Use the FastForge CLI to package your application for Windows as an executable. This command initiates the build process using the configuration defined in your project. ```bash fastforge package --platform windows --targets exe ``` -------------------------------- ### Build AppImage Package Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/appimage.md Command to initiate the AppImage packaging process using FastForge for the Linux platform. ```bash fastforge package --platform linux --targets appimage ``` -------------------------------- ### Publish App to AppGallery via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/appgallery.md Use the `fastforge publish` command to upload your app package to AppGallery. Ensure the path to your app package and the AppGallery app ID are correctly specified. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-ohos.app \ --targets appgallery \ --appgallery-app-id ``` -------------------------------- ### Clean Build Bundle Directory Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/CMakeLists.txt Removes the contents of the build bundle directory before installation to ensure a clean state. This is executed as an installation code step. ```cmake install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) ``` -------------------------------- ### Install AOT Library Conditionally Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/CMakeLists.txt Installs the AOT library to the bundle's library directory, but only for non-Debug build types. This ensures that debug builds do not include the AOT library. ```cmake if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Publish a Package with Fastforge Source: https://github.com/fastforgedev/fastforge/blob/dev/README.md Use this command to publish a specific package. Ensure the path to the APK is correct and specify the target platform. ```bash fastforge publish --path dist/your-app-1.0.0+1-android.apk --targets pgyer ``` -------------------------------- ### Run RPM Packaging Command Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/rpm.md Execute the FastForge command to package your application for the Linux platform as an RPM. Ensure your `make_config.yaml` is correctly set up in the `linux/packaging/rpm` directory. ```bash fastforge package --platform linux --targets rpm ``` -------------------------------- ### Configure Publisher API Key Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/getting-started.md Define variables for sensitive information like API keys. This example shows how to configure the Pgyer API key. ```yaml variables: PGYER_API_KEY: 'your api key' ``` -------------------------------- ### Package Application using MSIX Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/msix.md Run this command in your terminal to package your application for Windows using the MSIX target. Ensure your `make_config.yaml` is correctly set up. ```bash fastforge package --platform windows --targets msix ``` -------------------------------- ### Package Application as Zip Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/zip.md Command to package your application for the Linux platform into a zip archive using FastForge. ```bash fastforge package --platform linux --targets zip ``` -------------------------------- ### Basic Fastforge Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/getting-started.md Set the output directory for build artifacts. This file should be placed in your project's root. ```yaml output: dist/ ``` -------------------------------- ### Define Billing Route Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/content/blog/second-post.mdx Use `createFileRoute` to define a route for the billing page. This setup is typically used for top-level routes that correspond to distinct product domains. ```tsx export const Route = createFileRoute('/billing/')({ component: BillingPage, }) ``` -------------------------------- ### Route with Data Loader Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Example of a route that uses the `loader` functionality in TanStack Router to fetch data before rendering. This fetches people data from the SWAPI API. ```tsx import { createFileRoute } from '@tanstack/react-router' export const Route = createFileRoute('/people')({ loader: async () => { const response = await fetch('https://swapi.dev/api/people') return response.json() }, component: PeopleComponent, }) ``` -------------------------------- ### Use Environment Variables in Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/getting-started.md Demonstrates how to reference environment variables within the Fastforge configuration file for sensitive data like API keys. ```yaml variables: API_KEY: ${PGYER_API_KEY} # Uses the PGYER_API_KEY environment variable ``` -------------------------------- ### Publish with Custom Target via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/custom.md Use the `fastforge publish` command with the `custom` target and specify the script path using `--publish-arg command`. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-android.apk \ --targets custom \ --publish-arg command=./scripts/publish.sh ``` -------------------------------- ### Analyze App Package with Fastforge Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/cli/README.md Analyze an application package (e.g., .apk, .ipa). Supported formats include .aab, .apk, .ipa, .dmg. Output can be redirected to a JSON file. ```bash # Analyze an app package. Supported: .aab/.apk/.ipa/.dmg cargo run -p fastforge -- analyze /path/to/app.apk # Write output to a JSON file cargo run -p fastforge -- analyze /path/to/app.apk -o analysis.json ``` -------------------------------- ### Root Layout with Header Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Example of a root layout component in TanStack Router. It includes meta tags, a header with navigation links, and renders the route content and scripts. ```tsx import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router' export const Route = createRootRoute({ head: () => ({ meta: [ { charSet: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { title: 'My App' }, ], }), shellComponent: ({ children }) => (
{children} ), }) ``` -------------------------------- ### AppImage Configuration (make_config.yaml) Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/appimage.md A sample YAML configuration file for AppImage packaging. Customize fields like `display_name`, `icon`, `keywords`, `generic_name`, `actions`, `categories`, `startup_notify`, and `include` to define your application's metadata and bundling preferences. ```yaml display_name: Hello World icon: assets/logo.png keywords: - Hello - World - Test - Application generic_name: Cool Application actions: - name: Say Hi label: say-hi arguments: - --say - hi - name: Say Bye label: say-bye arguments: - --say - bye categories: - Music startup_notify: true # You can specify the shared libraries that you want to bundle with your app # # fastforge automatically detects the shared libraries that your app # depends on, but you can also specify them manually here. # # The following example shows how to bundle the libcurl library with your app. # # include: # - libcurl.so.4 include: [] # You can also specify [metainfo](https://www.freedesktop.org/software/appstream/metainfocreator/#/) file # which contains metadata of the app. # metainfo: linux/packaging/myappid.appdata.xml ``` -------------------------------- ### Create a Server Function Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/website/README.md Defines a server function using `createServerFn` to handle GET requests and return the current server time. This function can be called from client components. ```tsx import { createServerFn } from '@tanstack/react-start' const getServerTime = createServerFn({ method: 'GET', }).handler(async () => { return new Date().toISOString() }) // Use in a component function MyComponent() { const [time, setTime] = useState('') useEffect(() => { getServerTime().then(setTime) }, []) return
Server time: {time}
} ``` -------------------------------- ### Publish Artifact to App Center via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/appcenter.md Use the `fastforge publish` command to upload your application artifact to App Center. Specify the artifact path, target, owner name, app name, and distribution group. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-android.apk \ --targets appcenter --appcenter-owner-name \ --appcenter-app-name \ --appcenter-distribution-group ``` -------------------------------- ### Use Server Function in Component Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Example of how to use a server function within a React component. It fetches the server time using `useEffect` and updates the component's state. ```tsx // Use in a component function MyComponent() { const [time, setTime] = useState('') useEffect(() => { getServerTime().then(setTime) }, []) return
Server time: {time}
} ``` -------------------------------- ### Run PKG Build Command Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/pkg.md Execute this command in your terminal to initiate the PKG build process for macOS. ```bash fastforge package --platform macos --targets pkg ``` -------------------------------- ### Publish to Play Store via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/playstore.md Use the `fastforge publish` command to upload your Android App Bundle (AAB) to the Play Store. Specify the path to your artifact, the target as 'playstore', your package name, and the desired track (e.g., 'alpha'). ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-android.aab \ --targets playstore \ --playstore-package-name 'org.leanflutter.examples.hello_world' / --playstore-track alpha ``` -------------------------------- ### Publish IPA to App Store Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/appstore.md Use the `fastforge publish` command to upload your iOS application package (IPA) to the App Store. Specify the path to your artifact and the target platform. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-ios.ipa \ --targets appstore / ``` -------------------------------- ### Configure AppGallery Publishing in distribute_options.yaml Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/appgallery.md Configure AppGallery publishing settings, including API credentials and the app ID, within the `distribute_options.yaml` file. This allows for automated configuration of release jobs. ```yaml variables: APP_GALLERY_CLIENT_ID: 'your client id' APP_GALLERY_CLIENT_SECRET: 'your client secret' output: dist/ releases: - name: dev jobs: - name: release-dev-ohos package: platform: ohos # AppGallery expects the 'app' package format target: app build_args: # optional, defaults to 'default' and corresponds to product name in OHOS flavor: default publish: target: appgallery args: # The App ID of your application on AppGallery Connect app-id: 'your app id' ``` -------------------------------- ### Configure Qiniu Publishing in distribute_options.yaml Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/qiniu.md Configure Qiniu publishing settings within your `distribute_options.yaml` file. This includes setting credentials, bucket details, and save key prefix for releases. ```yaml variables: QINIU_ACCESS_KEY: your access key QINIU_SECRET_KEY: your secret key output: dist/ releases: - name: dev jobs: - name: release-dev-android package: platform: android target: apk # Publish to qiniu publish: target: qiniu args: bucket: your bucket bucket-domain: https://dl.example.com savekey-prefix: myapp/ ``` -------------------------------- ### Package Android App as APK Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/apk.md Use this command to package your Android application into an APK file. Ensure the platform is set to 'android' and the target is 'apk'. ```bash fastforge package --platform android --targets apk ``` -------------------------------- ### Run dmg_maker with JSON config Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/dmg_maker/README.md Execute the dmg_maker tool, providing a path to a JSON configuration file and the desired output DMG file path. ```bash cargo run -p dmg_maker -- ``` -------------------------------- ### Release Application Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/cli.md Releases your application based on the configuration file (`distribute_options.yaml`), packaging and publishing it. Requires a release name. ```bash fastforge release --name dev ``` -------------------------------- ### Run Tests with Vitest Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/studio/README.md Execute this command to run the project's tests using Vitest. ```bash pnpm test ``` -------------------------------- ### Package Application to DMG Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/dmg.md Execute the FastForge packaging command for macOS, targeting the DMG platform. Ensure you have the necessary configuration file in place. ```bash fastforge package --platform macos --targets dmg ``` -------------------------------- ### Package App for OHOS Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/app.md Use this command to package your application for the OHOS platform. Ensure you have the necessary build tools and configurations set up for OHOS. ```shell fastforge package --platform ohos --targets app ``` -------------------------------- ### Configure App Center Distribution Options in YAML Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/appcenter.md Configure App Center publishing settings within a `distribute_options.yaml` file. This includes API token, output path, release name, and specific job configurations for publishing. ```yaml variables: # See: https://appcenter.ms/settings/apitokens APPCENTER_API_TOKEN: output: dist/ releases: - name: dev jobs: - name: release-dev-android package: platform: android target: apk build_args: target-platform: android-arm # Publish to appcenter publish: target: appcenter args: owner-name: app-name: distribution-group: ``` -------------------------------- ### Build Flutter App with Custom Arguments Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/app_builder/README.md Demonstrates how to use FlutterAppBuilder to initiate a build for a specific platform and architecture, passing custom build arguments including flavor and dart-define variables. ```rust use app_builder::FlutterAppBuilder; use serde_json::{Map, Value, json}; fn run_build() -> anyhow::Result<()> { let builder = FlutterAppBuilder::default(); let mut args = Map::::new(); args.insert("flavor".into(), Value::String("dev".into())); args.insert("dart-define".into(), json!({ "APP_ENV": "dev" })); let result = builder.build("android", Some("apk"), args, None)?; println!("{}", result.to_json_compatible()); Ok(()) } ``` -------------------------------- ### Run dmg_maker tests Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/dmg_maker/README.md Execute the test suite for the dmg_maker crate using Cargo. ```bash cargo test -p dmg_maker ``` -------------------------------- ### RPM Packaging Configuration Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/makers/rpm.md Configure RPM packaging options by creating a `make_config.yaml` file. This file specifies metadata such as icon, summary, group, vendor, packager details, license, URL, display name, keywords, generic name, categories, and startup notification. ```yaml icon: assets/logo.png summary: A really cool application group: Application/Emulator vendor: Kingkor Roy Tirtho packager: Kingkor Roy Tirtho packagerEmail: krtirtho@gmail.com license: GPLv3 url: https://github.com/fastforgedev/fastforge display_name: Hello World keywords: - Hello - World - Test - Application generic_name: Cool Application categories: - Cool - Awesome startup_notify: true # You can also specify [metainfo](https://freedesktop.org/software/appstream/docs/chap-Quickstart.html) file # which contains metadata of the app. # metainfo: linux/packaging/myappid.appdata.xml ``` -------------------------------- ### Publish to GitHub Releases via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/github.md Use the `fastforge publish` command with the `github` target to upload artifacts to a GitHub release. Specify the artifact path, target, repository owner, and repository name. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-android.apk \ --targets github \ --github-repo-owner 'leanflutter' \ --github-repo-name 'fastforge' ``` -------------------------------- ### Publish to Qiniu via CLI Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/qiniu.md Use this command to publish a specific artifact to Qiniu. Specify the artifact path, target, bucket name, bucket domain, and an optional save key prefix. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-android.apk \ --targets qiniu \ --qiniu-bucket your-bucket \ --qiniu-bucket-domain https://dl.example.com \ --qiniu-savekey-prefix myall/ ``` -------------------------------- ### Build Android APK with Fastforge Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/cli/README.md Build an Android APK directly, bypassing packaging and publishing steps. Allows specifying build flavors and Dart defines. ```bash # Build Android APK directly (without package/publish) cargo run -p fastforge -- build --platform android --target apk --build-flavor dev --build-dart-define APP_ENV=dev ``` -------------------------------- ### Configure Play Store Release in distribute_options.yaml Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/playstore.md Define your release configuration in `distribute_options.yaml` to automate Play Store publishing. Specify the output directory, release name, build job for AAB, and publish details including package name and track. ```yaml output: dist/ releases: - name: dev jobs: - name: build-aab package: platform: android target: aab build_args: target-platform: android-arm # Publish to playstore publish: target: playstore args: package-name: org.leanflutter.examples.hello_world track: alpha ``` -------------------------------- ### Configure GitHub Publishing in `distribute_options.yaml` Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/github.md Configure GitHub publishing settings within the `distribute_options.yaml` file. This includes setting the GITHUB_TOKEN, output directory, and release job details, specifying the GitHub target and repository information. ```yaml variables: GITHUB_TOKEN: your personal access token, See[https://docs.github.com/cn/enterprise-server@3.2/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token] output: dist/ releases: - name: dev jobs: - name: release-dev-android package: platform: android target: apk build_args: target-platform: android-arm # Publish to github publish: target: github args: repo-owner: Repository owner repo-name: Repository name ``` -------------------------------- ### Run App Builder Tests Source: https://github.com/fastforgedev/fastforge/blob/dev/crates/app_builder/README.md Command to execute the tests for the app_builder crate with offline mode enabled. ```bash cargo test -p app_builder --offline ``` -------------------------------- ### Publish to Firebase Hosting Source: https://github.com/fastforgedev/fastforge/blob/dev/apps/docs/en/publishers/firebase-hosting.md Use this command to publish your web artifacts to Firebase Hosting. Ensure you replace `your-project-id` with your actual Firebase Project ID. ```bash fastforge publish \ --path dist/1.0.0+1/hello_world-1.0.0+1-web \ --targets firebase-hosting \ --firebase-hosting-project-id your-project-id ``` -------------------------------- ### Find System Libraries with PkgConfig Source: https://github.com/fastforgedev/fastforge/blob/dev/examples/custom_binary_name/linux/flutter/CMakeLists.txt Uses PkgConfig to find and import targets for GTK, GLib, and GIO, which are essential system-level dependencies for Flutter on Linux. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ```