Home

Awesome

create-cosmos-app

<p align="center" width="100%"> <img height="148" src="https://user-images.githubusercontent.com/545047/186589196-e75c9540-86a7-4a71-8096-207be9a4216f.svg" /> </p> <p align="center" width="100%"> <a href="https://www.npmjs.com/package/create-cosmos-app"><img height="20" src="https://img.shields.io/npm/dt/create-cosmos-app"></a> <a href="https://github.com/cosmology-tech/create-cosmos-app/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a> <a href="https://www.npmjs.com/package/create-cosmos-app"><img height="20" src="https://img.shields.io/github/package-json/v/cosmology-tech/create-cosmos-app?filename=packages%2Fcreate-cosmos-app%2Fpackage.json"></a> </p>

Set up a modern Cosmos app by running one command ⚛️

https://user-images.githubusercontent.com/545047/192061992-f0e1106d-f4b2-4879-ab0a-896f22ee4f49.mp4

Overview

First, install create-cosmos-app globally using npm:

npm install -g create-cosmos-app

Then, create your new Cosmos app by running the following command:

# you can also use `cca` instead of `create-cosmos-app` for shortcut ;)
create-cosmos-app

During the setup process, you'll be prompted to enter the name of your app. For example:

> name: my-app

Once the app is created, move into the app directory and start the development server:

cd my-app
yarn && yarn dev

Now your app should be running on http://localhost:3000!

Get Started Immediately

You don’t need to install or configure cosmjs, keplr, nextjs, webpack or Babel.

Everything is preconfigured, ready-to-go, so you can focus on your code!

Education & Resources

🎥 Checkout our videos to learn to learn more about create-cosmos-app and tooling for building frontends in the Cosmos!

Checkout cosmos-kit for more docs as well as cosmos-kit/react for getting cosmjs stargate and cosmjs signers.

Creating an App

To create a new app, you may choose one of the following methods:

global install

npm install -g create-cosmos-app

Then run the command:

create-cosmos-app

we also made an alias cca if you don't want to type create-cosmos-app:

cca

npx

npx create-cosmos-app

npm

npm init cosmos-app

Yarn

yarn create cosmos-app

Examples

The create-cosmos-app tool provides a range of examples to help you understand and test various features and integrations. By executing the examples, you can quickly see how to implement specific functionalities in your Cosmos app.

cca --example

If you know the example name, you can do

cca --example <example-name>

Alternatively, you can use the shorthand -e flag to achieve the same:

cca -e <example-name>

This command will generate a new project configured with the selected example, allowing you to dive into the code and functionality right away.

Stake Tokens

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/186589196-e75c9540-86a7-4a71-8096-207be9a4216f.svg" /> </p>

Initiate and manage staking operations directly within your application, allowing users to stake tokens securely and efficiently.

cca --name stake-example --example stake-tokens

Vote Proposal

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/186589196-e75c9540-86a7-4a71-8096-207be9a4216f.svg" /> </p>

Facilitate on-chain governance by enabling users to vote on proposals, enhancing community engagement and decision-making.

cca --name vote-example --example vote-proposal

Authz

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/186589196-e75c9540-86a7-4a71-8096-207be9a4216f.svg" /> </p>

Leverage the Authz module to grant and manage authorizations, allowing users to perform actions on behalf of others.

cca --name authz-example --example authz

grpc-web and grpc-gateway

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/186589196-e75c9540-86a7-4a71-8096-207be9a4216f.svg" /> </p>

Integrate gRPC-web and gRPC-gateway in your app for robust and efficient communication between your Cosmos SDK blockchain and web clients.

cca --name grpc-example --example grpc-web-grpc-gateway

Swap Tokens

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/184519024-2d34bf20-2440-4837-943f-4915a46409f5.svg" /> </p>

Utilize osmojs for streamlined token swapping capabilities within your Osmosis app.

cca --name swap-example --example swap-tokens

Provide Liquidity

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/184519024-2d34bf20-2440-4837-943f-4915a46409f5.svg" /> </p>

Use osmojs to enable liquidity provision features, enhancing the DeFi experience in your app.

cca --name liquidity-example --example provide-liquidity

Asset List

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/184519024-2d34bf20-2440-4837-943f-4915a46409f5.svg" /> </p>

Create and manage an asset list, offering comprehensive insights into the available assets, and empower your application with Inter-Blockchain Communication (IBC) capabilities for transferring tokens across different chains.

cca --name asset-list-example --example asset-list

NFT

<p align="center" width="100%"> <img height="48" src="https://user-images.githubusercontent.com/545047/184694732-f4a3d397-14fb-415a-9562-a532f510f812.png" /> </p>

Incorporate NFT functionalities into your Stargaze app using stargazejs, enabling seamless NFT minting, transfer, and management.

cca --name nft-example --example nft

Options

ArgumentDescriptionDefault
--repoSet custom repository for cca templatesNone
--installAutomatically install dependenciestrue
--printCmdPrint the command to run after setuptrue
-n, --nameProvide a project nameNone
-e, --exampleProvide an example nameNone
-t, --templateDefine the template to useNone
-b, --fromBranchSpecify the branch to use for cloningNone

Development

Because the nature of how template boilerplates are generated, we generate yarn.lock files inside of nested packages so we can fix versions to avoid non-deterministic installations.

When adding packages, yarn workspaces will use the root yarn.lock. It could be ideal to remove it while adding packages, and when publishing or pushing new changes, generating the nested lock files.

In the root, to remove all nested lock files:

yarn locks:remove

When you need to remove/generate locks for all nested packages, simply run yarn locks in the root:

yarn locks

Related

Checkout these related projects:

Credits

🛠 Built by Cosmology — if you like our tools, please consider delegating to our validator ⚛️

Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.