Examples and Templates
Examples are small projects designed to demonstrate RADFish ecosystem. Templates are meant to be a clean starting point for a new RADFish project.
Examples
Each exammple is scoped to teach developers how to implement core pieces of functionality. Examples include a detailed README.md file that explains its purpose, design pattern, and best practices.
These examples are meant to be a reference for any RADFish project. These examples can serve as a starting point to build out a new RADFish application. However, we recommend starting with a fresh react-javascript template.
The source code for each example is in the open source repo for radfish-monorepo boilerplate. Each example can be cloned and run separately as you are working with each from the RADFish CLI. To learn how to run these scripts, refer to the running examples section.
List of Examples
Here's a list of pre-built examples that you can use as a starting point for your application. These examples are scoped to one core feature.
- Computed Form Fields
- Conditional Form Fields
- Field Validators
- Form Structure
- Mock API
- Multistep Form
- Network Status
- On Device Storage
- Persisted Form
- Server Sync
- Simple Table
Templates
These templates are framework-specific. At the time of this writing, only the react-javascript template is supported. New templates for other frameworks and other languages are planned for the future!
Templates come pre-configured with everything to start coding your new project right away. This includes RADFish core modules, service-worker configuration, application routing, and offline storage.
Creating a new project based on a template is similar to running an example. If you want to create a new project from the react-javascript library, execute this RADFish CLI command:
npx @nmfs-ocio/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. Running npx @nmfs-ocio/create-radfish-app my-app will create the same project without needing to specify the template.
Template Directory Structure
Once you scaffold a new template radfish app, you'll be given the following file structure:
my-app
├── babel.config.js
├── index.html
├── mocks
│ ├── browser.js
│ └── handlers.js
├── node_modules/
├── package-lock.json
├── package.json
├── public
│ ├── icons
│ ├── manifest.json
│ ├── mockServiceWorker.js
│ ├── noaafavicon.png