Skip to main content

Examples and Templates

Examples

Examples are small, scoped projects that are meant to demonstrate how to implement core pieces of functionality within the RADFish ecosystem. Each example includes a detailed README.md file about the purpose of each example, and the reasoning behind the design pattern, and the best practices utilized in each.

These examples are meant to be a reference for any RADFish project. While these examples can certainly be used as a starting point to build out a new RADFish application, we still suggest starting with a fresh react-javascript template (see below).

You can visualize the source code for each example at the open source repository for the overall RADFish boilerplate. Each of these examples can be cloned and run separately as you are working with each from the RADFish CLI. To learn more about how to run these scripts, please reference the running examples section of this documentation

Below are a list of pre-built examples that you can use as a starting point for your application. With exception of the Main example, these are all scoped to one core feature. Whereas the Main example encapsulates many of these features into a more fully built example. Note that the Main example may be more complex than you may like if you are just familiarizing yourself with the RADFish ecosystem.

  1. Main
  2. Computed Form Fields
  3. Conditional Form Fields
  4. Field Validators
  5. Mock API
  6. Multistep Form
  7. Network Status
  8. On Device Storage
  9. Persisted Form
  10. Server Sync
  11. Simple Table

Templates

Templates are meant to be a clean starting point for a new RADFish project. These templates are framework specific. Note that at the time of this writing, only the react-javascript template is supported, though new frameworks/languages are planned to be supported in the future!

The template will come pre-configured with everything you need to get up and running to start coding your new project as quickly as possible. This will include the core modules of RADFish, including service-worker configuration, application routing, and offline storage.

If you want to create a new project based from the react-javascript library, you can execute the following RADFish CLI command, similar to how you run examples: npx @nmfs-radfish/create-radfish-app my-app --template react-javascript

This will create a new RADFish project named my-app in your current working directory. Happy hacking!

Note: The react-javascript template is the default, so running npx @nmfs-radfish/create-radfish-app my-app will create the same project without needing to specify the template.