Skip to content

JenksyGuo/ipfs-node-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dwetransfer IPFS Demo App

This web application is created to demonstrate how files can be uploaded to ipfs in an simple react application.

The project uses ipfs-http-client package to interface with the ipfs core API. It also relies on the ipfs daemon/service running on localhost:5001 port.

This project was bootstrapped with Create React App.

Dec-10-2021 20-59-59

How does it work?

The single page react application will take one or more files uploaded via a simple HTML form and use the ipfs.addAll() method provided by ipfs-http-client package to interface with IPF core APIs. The application must run side by side with a IPF node on the server to access IPF network.

The app will display the successful ipfs.io gateway url of the uploaded resources for user to download.

The intention is user can uplaod to ipfs gateway and have the links sent to a friend via email to received and download temporarily.

The future state of the app will be to provide permanent storage solution by integrating to a pinning service such as Pinata to allow users get the permanent links for a fee.

File Upload Page

Screen Shot 2021-12-10 at 9 19 59 pm

Successfully uploaded to IPFS

Screen Shot 2021-12-10 at 9 20 13 pm

Error with IPFS node

Screen Shot 2021-12-10 at 9 22 17 pm

Before you run

Navigate to /dwetransfer direction, you can build the project by running:

yarn or npm install

Screen Shot 2021-12-10 at 8 35 44 pm

Don't forget to start your ipfs daemon on your local machine/server:

ipfs daemon

and ensure the services are listening on https://localhost:5001

Screen Shot 2021-12-10 at 8 32 52 pm

A quick test is to visit the ipfs webui at https://localhost:5001/webui

Screen Shot 2021-12-10 at 8 34 41 pm

If you can see the web UI then you are all good to go.

To run the application

Navigate to /dtransfer directory, you can run:

yarn start or npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

To package the application for deployment

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

CD/CI Deployment (powered by Fleek)

The application is hosted via IPFS partner Fleek. Fleek integrates with Github.com and continuously integration and deploy the main branch into the IPFS network and provide a Web 2.0 url link for the users to visit.

Whatever is merged into main branch, fleek will recieved a github.com webhook to pull down the latest branch to build using some kind of workers.

Currently the deployed site is live at: https://patient-union-5647.on.fleek.co/

Screen Shot 2021-12-10 at 9 34 12 pm

Feature backlog

If I had more time, I would work on:

  • add "Email to:" & "Sent from:" email inputs, and integrate with an email service to send an email
  • improve error handling by mapping IPFS error with user actionable instructions
  • integrate with pinning service to provide long term storage for a fee
  • integrate with a crypto wallet to take payment for premium featuers like permanent storage

Development Challenges

  • Fleek services was extremely easy to use but I was not able to find the secret/api key management service which cause me to drop the scope for limited time
  • Proper use of state and props in react needs to be respected to avoid funky frontend lifecycle issues
  • Unsure if Fleek is able to handle server side logic, so I have not created a backend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published