-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add app create
command
#404
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
--- | ||
title: Create Flow app from scaffold | ||
sidebar_title: Create App | ||
description: How to create a Flow app with recommended structure | ||
--- | ||
|
||
The Flow CLI provides a command to create an app from examples | ||
and templates. | ||
|
||
```shell | ||
flow app create | ||
``` | ||
|
||
## Example Usage | ||
|
||
```shell | ||
> flow app create my-app | ||
|
||
Enumerating objects: 349, done. | ||
Counting objects: 100% (349/349), done. | ||
Compressing objects: 100% (261/261), done. | ||
Total 349 (delta 55), reused 347 (delta 53), pack-reused 0 | ||
? Which do you want to start with? Template | ||
? Which API template you want to start with? express | ||
? Which Cadence template you want to start with? default | ||
? Which Web template you want to start with? react | ||
|
||
Created /path/to/my-app | ||
Api express | ||
Cadence default | ||
Web react | ||
``` | ||
|
||
## Arguments | ||
sideninja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Path | ||
|
||
- Name: `path` | ||
- Valid Input: Path | ||
|
||
A relative path to the app location. Can be a new folder name or existing empty folder. | ||
You can start with a full featured example or a custom template. | ||
|
||
If you start with an example, there are some exmples included (may not up-to-date): | ||
|
||
- `kitty-items`: An app based on CryptoKitties. ([Repo](https://github.com/onflow/kitty-items)) | ||
|
||
If you start with a template, there will be 3 folder `api`, `cadence`, and `web`. | ||
|
||
- `api`: Backend service will be put in here, you can provide functions which cannot be | ||
implemented in client side, such as draw, whitelist registration, KYC, or some works can be | ||
offloaded from client side, such as DEX price, NFT lists. Following are some templates | ||
included (may not up-to-date): | ||
_ `default`: Leave it blank for you. | ||
_ `express`: A popular web framework for node. Check out [Express.js](https://expressjs.com/) | ||
for details. | ||
- `cadence`: Contracts will be put in here. Following are some templates included (may not | ||
up-to-date): | ||
- `default`: Leave it blank for you. | ||
- `web`: Frontend app will be put in here, users will use the app to interact with your Cadence | ||
contracts. Check out [fcl.js](https://github.com/onflow/fcl-js) to get more details. Following | ||
are some templates included (may not up-to-date): | ||
_ `default`: Leave it blank for you. | ||
_ `react`: A popular frontend framework supported by Facebook. Check out | ||
[React.js](https://reactjs.org/) for details. | ||
_ `react-ts`: `react` and added TypeScript inside. | ||
_ `vue`: A popular frontend framework. Check out [Vue.js](https://vuejs.org/) for details. | ||
|
||
## Flags | ||
|
||
### Host | ||
|
||
- Flag: `--host` | ||
- Valid inputs: an IP address or hostname. | ||
- Default: `127.0.0.1:3569` (Flow Emulator) | ||
|
||
Specify the hostname of the Access API that will be | ||
used to execute the command. This flag overrides | ||
any host defined by the `--network` flag. | ||
|
||
### Network | ||
|
||
- Flag: `--network` | ||
- Short Flag: `-n` | ||
- Valid inputs: the name of a network defined in the configuration (`flow.json`). | ||
- Default: `emulator` | ||
|
||
Specify which network you want the command to use for execution. | ||
sideninja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Filter | ||
|
||
- Flag: `--filter` | ||
- Short Flag: `-x` | ||
- Valid inputs: a case-sensitive name of the result property. | ||
|
||
Specify any property name from the result you want to return as the only value. | ||
|
||
### Output | ||
|
||
- Flag: `--output` | ||
- Short Flag: `-o` | ||
- Valid inputs: `json`, `inline` | ||
|
||
Specify the format of the command results. | ||
|
||
### Save | ||
|
||
- Flag: `--save` | ||
- Short Flag: `-s` | ||
- Valid inputs: a path in the current filesystem. | ||
|
||
Specify the filename where you want the result to be saved | ||
|
||
### Log | ||
|
||
- Flag: `--log` | ||
- Short Flag: `-l` | ||
- Valid inputs: `none`, `error`, `debug` | ||
- Default: `info` | ||
|
||
Specify the log level. Control how much output you want to see during command execution. | ||
|
||
### Configuration | ||
|
||
- Flag: `--config-path` | ||
- Short Flag: `-f` | ||
- Valid inputs: a path in the current filesystem. | ||
- Default: `flow.json` | ||
|
||
Specify the path to the `flow.json` configuration file. | ||
You can use the `-f` flag multiple times to merge | ||
several configuration files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is here something missing in the question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question I mean is if a user wants to start from an (example) app that can be built and run (kitty-items) with changing very few or no code or a template have only necessary files (framework, scaffold). Since I'm not a native English speaker, could you recommend a clear and succinct question, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.. maybe you can set it up like this? (idk, maybe look at create-react-app for inspiration!)