Giter Site home page Giter Site logo

luizstacio / fuel-microblog-dapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hummusonrails/fuel-microblog-dapp

1.0 0.0 0.0 598 KB

A small example dApp building a personal microblog using Fuel

License: Other

TypeScript 85.66% CSS 5.18% HTML 3.53% Sway 5.63%

fuel-microblog-dapp's Introduction

Fuel Sample dApp: Microblog

License: Apache 2.0 Code of Conduct Made with Love

This is a sample dApp that demonstrates how to use Fuel to build a simple personal microblog. It is a simple web application that allows users to post short messages to a public feed. The messages are stored in a Fuel contract on-chain and can be read by anyone. The application is built on the frontend using React and the Fuel TypeScript SDK, and on the backend using Sway, the Rust DSL for smart contract development. The contract is deployed to Fuel.

Getting Started

Installation

Frontend

To install the frontend, run the following commands:

cd frontend
npm install

Backend

To build the backend, run the following commands:

cd blog-contract
forc build

You must have the forc build tools installed prior to running forc build. To install the forc build tools, follow this step by step guide.

You can install the entire forc toolchain with one command:

curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh

Once installed, make sure you are set to the correct Fuel testnet, as of the time of this writing that is `beta-4``, but you should always check the docs to ensure you are using the latest testnet. To set the testnet, run the following command:

fuelup toolchain install beta-4
fuelup default beta-4

Once the smart contract is built using forc build, you can deploy it to the Forc testnet using the following command:

forc deploy --testnet

Running the Application

Once you have finished building your contract and deploying it, you are ready to run your frontend and interact with your contract.

The output from the forc deploy --testnet command provided you with your smart contract ID, copy that ID and return back to the ./frontend folder, rename the .env.sample file to .env and update the environment variable value called REACT_APP_CONTRACT_ID with your smart contract ID.

Then, start your React app by running npm start from the ./frontend folder. This will start your React app on port 3000 by default.

You can access it in your browser at http://localhost:3000.

Code of Conduct

Please read the CODE_OF_CONDUCT.md for details on the code of conduct for this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.