Code Monkey home page Code Monkey logo

blockchain-based-crowdfunding-dapp's Introduction

Blockchain-based-Crowdfunding-DApp

Supply is about Making a Crowdfunding Decentralized App using Blockchain Technology on top of Ethereum Network.

Description

The project involves creating a Blockchain-powered App designed for Decentralized Crowdfunding, emphasizing transparency, security, and decentralization. It utilizes Smart Contracts, which are immutable artificial contacts responsible for enforcing agreements without the possibility of alteration after deployment....

Features

We have two primary actors:

  • Investor/ Donator/ Fundraiser.
  • Campaign launcher.

Investors can:

  • Login with Meta Mask Wallet
  • Donate to campaigns
  • Refund Money
  • View Campaigns

Campaign launchers can:

  • Launch Campaign
  • Close Campaign
  • Edit Campaign
  • View Campaign
  • Login with MetaMask
  • Withdraw Funds

The Frontend was made by ReactJS, the Backend by NodeJS, the Blockchain by Solidity, testing was by Mocha, Chai and Jest.

Architecture

It has A frontend connected to both Blockchain and Backend, Blockchain is for verifying transactions and backend to serve and store information to the backend database (MongoDB). It also uses decentralized file storage called IPFS for image storage.

Principles Used

  • Test Driven Development: Since once Smart contracts are deployed to the Blockchain Network, it can not be changed. A Test Driven Development approach was made to write tests and mocks as scenarios and then write the required code to pass these tests.

API Security:

  • JWT authentication.
  • Define CORS policy to allow only specific domains.
  • Implemented Header security using the Helmet package.
  • Passwords are hashed using an irreversible algorithm bcrypt.
  • Implemented a strict endpoint validation system using Joi.

API Versioning:

All routes are versioned by default GET - api/v1.

API Features:

  • CRUD (Create, Read, Update, Delete) for all resources using RESTful API design.
  • Index Pagination - Search - Sort - Select - Filter.
  • API Versioning (v1).
  • Best Practices & Clean Code (MVC, SOLID, DRY, KISS).
  • Error Handling System (Generic error handler middleware with Correct HTTP Status Code & Error message).

API Documentation:

All Endpoints (overview):

Campaign routes:

  • GET - api/v1/ - get campaigns.
  • POST - api/v1/ - add campaigns.
  • GET - api/v1/donations/:campaignId/:address - get user donations.
  • GET - api/v1/:campaignId - get campaign by ID.
  • GET - api/v1/profiles/:address - get campaign User.
  • PATCH - api/v1/:id - get campaigns.
  • DELETE - api/v1/:id - Delete campaign.
  • GET - api/v1/uploadImage - Upload image for the campaign.

Reward routes:

  • GET - api/v1/ - get rewards.
  • GET - api/v1/profiles/:address - get user rewards.

How to use:

  1. First of all, you have to configure the .env file using your credentials like MongoDB URL, Password, etc.
  2. Second, install dependencies from the frontend, backend, and blockchain folders by navigating into the folder using cd <folder-name> and
npm install
npm run dev

It will run the project's frontend and backend on ports configured in the .env file. You should deploy the blockchain part using either a fake mainnet by using Alchemy's API key or deploy it on the Sapoli testnet.

How to run tests

 npm run test

How to Deploy the Contract

Navigate to the blockchain folder and

 npm run deploy

and chooose one account from multiple ones to be your private and public key addresses and configure them and add them to the wallet (MetaMask)

prices fluctionation problem:

We faced price fluctuations in cryptocurrencies in general, so we decided to use stable coins that are backed by the US dollar. We used DAI and converted currencies, whether it is ETH or any other tokenized currency.

Technologies used

blockchain-based-crowdfunding-dapp's People

Contributors

amir380-a avatar

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.