{"id":13651845,"url":"https://github.com/shawntabrizi/substrate-society","last_synced_at":"2025-08-24T18:37:56.631Z","repository":{"id":39261154,"uuid":"234365865","full_name":"shawntabrizi/substrate-society","owner":"shawntabrizi","description":"A basic front-end for the Substrate Society pallet","archived":false,"fork":false,"pushed_at":"2023-01-05T05:15:51.000Z","size":20212,"stargazers_count":6,"open_issues_count":27,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T14:17:57.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.shawntabrizi.com/substrate-society/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawntabrizi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-16T16:46:18.000Z","updated_at":"2022-07-11T16:22:45.000Z","dependencies_parsed_at":"2023-02-03T12:31:33.487Z","dependency_job_id":null,"html_url":"https://github.com/shawntabrizi/substrate-society","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"substrate-developer-hub/substrate-front-end-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawntabrizi%2Fsubstrate-society","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawntabrizi%2Fsubstrate-society/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawntabrizi%2Fsubstrate-society/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawntabrizi%2Fsubstrate-society/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawntabrizi","download_url":"https://codeload.github.com/shawntabrizi/substrate-society/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250334112,"owners_count":21413512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:00:52.868Z","updated_at":"2025-04-22T22:32:22.824Z","avatar_url":"https://github.com/shawntabrizi.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# Substrate Front End Template\n\nThis template allows you to create a front-end application that connects to a\n[Substrate](https://github.com/paritytech/substrate) node back-end with minimal\nconfiguration. To learn about Substrate itself, visit the\n[Substrate Developer Hub](https://substrate.dev).\n\nThe template is built with [Create React App](https://github.com/facebook/create-react-app)\nand [Polkadot js API](https://polkadot.js.org/api/). Familiarity with these tools\nwill be helpful, but the template strives to be self-explanatory. To learn how\nthis template was built, visit the\n[Substrate Front-End Tutorial](https://substrate.dev/docs/en/tutorials/substrate-front-end/).\n\n## Using The Template\n\n### Installation\n\nThe code can be installed using [git](https://git-scm.com/) and [yarn](https://yarnpkg.com/).\n\n```bash\n# Clone the repository\ngit clone https://substrate-developer-hub/substrate-front-end-template.git\ncd ./substrate-front-end-template\n```\n\n```bash\nyarn install\n```\n\n## Usage\n\nYou can start the template in development mode to connect to a locally running node\n\n```bash\nyarn start\n```\n\nYou can also build the app in production mode,\n\n```bash\nyarn build\n```\nand open `build/index.html` in your favorite browser.\n\n## Configuration\n\nThe template's configuration is stored in the `src/config` directory, with\n`common.json` being loaded first, then the environment-specific json file,\nand finally environment variables, with precedence.\n\n* `development.json` affects the development environment\n* `test.json` affects the test environment, triggered in `yarn test` command.\n* `production.json` affects the production environment, triggered in\n`yarn build` command.\n\nSome environment variables are read and integrated in the template `config` object,\nincluding:\n\n* `REACT_APP_PROVIDER_SOCKET` overriding `config[PROVIDER_SOCKET]`\n* `REACT_APP_DEVELOPMENT_KEYRING` overriding `config[DEVELOPMENT_KEYRING]`\n\nMore on [React environment variables](https://create-react-app.dev/docs/adding-custom-environment-variables).\n\nWhen writing and deploying your own front end, you should configure:\n\n* `CUSTOM_TYPES` in `src/config/common.json`. See\n  [Extending types](https://polkadot.js.org/api/start/types.extend.html).\n* `PROVIDER_SOCKET` in `src/config/production.json` pointing to your own\n  deployed node.\n* `DEVELOPMENT_KEYRING` in `src/config/common.json` be set to `false`.\n  See [Keyring](https://polkadot.js.org/api/start/keyring.html).\n\n## Reusable Components\n\n### useSubstrate Custom Hook\n\nThe custom hook `useSubstrate` provides access to the Polkadot js API and thus the\nkeyring and the blockchain itself. Specifically it exposes this API.\n\n```js\n{\n  socket,\n  types,\n  keyring,\n  keyringState,\n  api,\n  apiState,\n}\n```\n\n- `socket` - The remote provider socket it is connecting to.\n- `types` - The custom types used in the connected node.\n- `keyring` - A keyring of accounts available to the user.\n- `keyringState` - One of `\"READY\"` or `\"ERROR\"` states. `keyring` is valid\nonly when `keyringState === \"READY\"`.\n- `api` - The remote api to the connected node.\n- `apiState` - One of `\"CONNECTING\"`, `\"READY\"`, or `\"ERROR\"` states. `api` is valid\nonly when `apiState === \"READY\"`.\n\n\n### TxButton Component\n\nThe [TxButton](./src/substrate-lib/components/TxButton.js) handles basic\n[query](https://polkadot.js.org/api/start/api.query.html) and\n[transaction](https://polkadot.js.org/api/start/api.tx.html) requests to the\nconnected node. You can reuse this component for a wide variety of queries and\ntransactions. See [src/Transfer.js](./src/Transfer.js) for a transaction example\nand [src/ChainState.js](./src/ChainState.js) for a query example.\n\n### Account Selector\n\nThe [Account Selector](./src/AccountSelector.js) provides the user with a unified way to\nselect their account from a keyring. If the Balances module is installed in the runtime,\nit also displays the user's token balance. It is included in the template already.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawntabrizi%2Fsubstrate-society","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawntabrizi%2Fsubstrate-society","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawntabrizi%2Fsubstrate-society/lists"}