{"id":29124851,"url":"https://github.com/hirosystems/platform-template-fundraising-dapp","last_synced_at":"2025-10-13T16:43:11.703Z","repository":{"id":276870515,"uuid":"927931249","full_name":"hirosystems/platform-template-fundraising-dapp","owner":"hirosystems","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-09T14:50:46.000Z","size":5635,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-26T11:56:55.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://platform-template-fundraising-dapp-front-end.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirosystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-05T19:24:03.000Z","updated_at":"2025-05-09T14:50:50.000Z","dependencies_parsed_at":"2025-02-10T22:31:22.501Z","dependency_job_id":"3089f377-214b-49b8-8512-8a247165443c","html_url":"https://github.com/hirosystems/platform-template-fundraising-dapp","commit_stats":null,"previous_names":["hirosystems/platform-template-fundraising-dapp"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/hirosystems/platform-template-fundraising-dapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fplatform-template-fundraising-dapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fplatform-template-fundraising-dapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fplatform-template-fundraising-dapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fplatform-template-fundraising-dapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirosystems","download_url":"https://codeload.github.com/hirosystems/platform-template-fundraising-dapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fplatform-template-fundraising-dapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262667299,"owners_count":23345534,"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":"2025-06-29T21:06:59.240Z","updated_at":"2025-10-13T16:43:06.652Z","avatar_url":"https://github.com/hirosystems.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STX/sBTC Fundraising App\n\n![Fundraising on Stacks](./screenshot.png)\n\nThis is a simple crypto fundraising web page built on Stacks. It lets people run a campaign to raise funds in STX and sBTC.\n\nThis example app is intended for educational purposes only. The provided smart contracts have not been audited.\n\n## Development\n\nTo run this app with a Stacks Devnet (private development blockchain environment), follow these steps:\n\n1. **Start Devnet in Hiro Platform**\n\n   - Log into the [Hiro Platform](https://platform.hiro.so)\n   - Navigate to your project and start Devnet (do not opt to update the Devnet deployment plan, as it's pre-configured with some contract calls to initialize the project)\n   - Copy your API key from either:\n     - The Devnet Stacks API URL: `https://api.platform.hiro.so/v1/ext/\u003cYOUR-API-KEY\u003e/stacks-blockchain-api`\n     - Or from https://platform.hiro.so/settings/api-keys\n\n2. **Configure Local Environment**\n\nInstall dependencies:\n```bash\nnpm install\n```\n\n\nCreate an `.env` file using the existing `.env.example` file:\n```bash\ncp front-end/.env.example front-end/.env\n```\n\n\nAdd your Hiro Platform API key to the renamed `front-end/.env` file:\n```bash\nNEXT_PUBLIC_PLATFORM_HIRO_API_KEY=your-api-key-here\n```\n\n3. **Start the Frontend Application**\n\nStart the Next.js application from the front-end directory.\n```bash\ncd front-end\nnpm run dev\n```\n\n\nVisit `[http://localhost:3000](http://localhost:3000)` in your browser to view and interact with the marketplace. If Devnet is running, your test wallets will already be funded and connected for testing.\n\n## Customization\n\nTo customize this app for your fundraiser, edit the files `front-end/src/constants/campaign.ts` and `front-end/public/campaign-details.md`. Add images for the carousel to the `front-end/public/campaign` folder.\n\nThe given Devnet deployment plan (found in `clarity/deployments/default.devnet-plan.yaml`) includes steps to initialize the campaign with a given funding goal. You can customize this plan as desired.\n\nWhen you're ready to deploy in Testnet or Mainnet, you can choose to add similar steps to your testnet/mainnet deployment plans, or you can initialize your campaign manually by calling the `fundraising.initialize-campaign` function on-chain.\n\n## About the Smart Contracts\n\nThis app uses a Clarity smart contract which handles the collection of funds.\n\n### `fundraising.clar`\n\n- Allows the contract owner to initialize the campaign with a fundraising goal in USD\n- Accepts donations in STX or sBTC\n- Tracks individual contributions\n- Lets the beneficiary (contract owner) withdraw the raised funds if the goal is hit\n- Allows the beneficiary to cancel the campaign and refund the contributions to the donors at any point\n\n## Testing with Devnet\n\nThe Hiro Platform's Devnet is a sandboxed, personal blockchain environment for testing your dApps before deploying them to the testnet or mainnet. Each time you start a new Devnet, it will reset the blockchain state and deploy your project contracts from scratch.\n\nThis is useful because deployments to the blockchain are permanent and cannot be undone. Ensure you have tested your contracts thoroughly in your Devnet before promoting them to Testnet or Mainnet.\n\nIf you make changes to your contract, you will need to push your changes and restart Devnet for the contract changes to appear in your Devnet.\n\n### 1. Start Devnet and Deploy Contracts\n\n1. Open your project in the Hiro Platform\n2. Click \"Start Devnet\" to initialize your testing environment (the contracts will be automatically deployed per your deployment plan)\n3. You should see your contracts deployed no later than block 45 in the Devnet dashboard\n\n### 2. Testing Smart Contract Functions\n\nSmart contract functions can be tested directly from your Platform dashboard.\n\n1. Select the Devnet tab to confirm that your contracts are deployed and Devnet is running\n2. Click \"Interact with Devnet\" and then \"Call functions\"\n3. Select your contract and the function you want to test from the dropdown menus\n4. Use one of the pre-funded devnet wallets as the caller and another as the recipient (if needed)\n5. Click \"Call function\" to execute the function, which will either succeed or fail based on the function's logic and the caller's permissions\n6. Once the function has been submitted, you can watch for the transaction to resolve on-chain in the Devnet dashboard and confirm that the function executed as expected\n\nRemember that any changes to the contracts will require restarting Devnet and redeploying the contracts.\n\n### 3. Integration Testing\n\nWith Devnet running, you can test your front-end functionality and validate that it's working in the same way you just tested the fundraising functions.\n\n1. Confirm that your Devnet is running in the Platform dashboard and `npm run dev` is running in the front-end directory\n2. Navigate to [http://localhost:3000](http://localhost:3000) to view and interact with the fundraising app\n3. View your campaign and test the contribution, refunding, and withdrawal functionality using the pre-funded wallets. Use the wallet picker in the upper right corner to choose between different test wallets.\n4. Navigate to the Devnet dashboard in the Platform to view the transactions as they are submitted and resolved on-chain.\n\nYou do not need to restart Devnet to test changes to your front-end.\n\n## Next Steps\n\nOnce you've thoroughly tested your dApp in Devnet and are confident in its functionality, you can proceed to testing on the Stacks Testnet before launching on Mainnet.\n\n### Moving to Testnet\n\n1. Use the [Stacks Testnet Faucet](https://explorer.hiro.so/sandbox/faucet?chain=testnet) to get test STX tokens\n3. Update the environment variables in your `.env` file to add values for `NEXT_PUBLIC_CONTRACT_DEPLOYER_TESTNET_ADDRESS` and `NEXT_PUBLIC_CONTRACT_DEPLOYER_MAINNET_ADDRESS`. Add the STX wallet address you plan to deploy the contract with.\n4. Deploy your contracts to the Testnet using the Platform dashboard and your deployment plan\n5. Test your application with real network conditions and transaction times\n6. Verify your contract interactions in the [Testnet Explorer](https://explorer.hiro.so/?chain=testnet)\n\n### Launching on Mainnet\n\nWhen you're ready to launch your app:\n\n1. Ensure you have real STX tokens for deployment and transaction costs\n2. Update your deployment configuration to target Mainnet\n3. Deploy your contracts through the Platform dashboard\n4. Update your frontend environment variables to point to Mainnet\n5. Launch your application and begin processing real transactions!\n\nRemember: Mainnet deployments are permanent and involve real cryptocurrency transactions. Double-check all contract code and frontend integrations before deploying to Mainnet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fplatform-template-fundraising-dapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirosystems%2Fplatform-template-fundraising-dapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fplatform-template-fundraising-dapp/lists"}