This is a Next.js app that allows users to store their data as a JSON object on IPFS (InterPlanetary File System).
- Input form for users to enter their name, amount of plastic collected, and location.
- Uploads user data as a JSON object to IPFS.
- Retrieves and displays user data using the CID (Content Identifier) provided by IPFS.
- Node.js (v14 or above)
- IPFS daemon running locally (Make sure to start the IPFS daemon with
ipfs daemon
)
-
Clone the repository:
-
Install dependencies
npm install
-
Run IPFS daemon on port:5001
ipfs daemon
-
Make sure that your IPFS daemon's configuration file ( that you can find at "~/.ipfs/config" on your machine allows CORS requests from the NextJS app's domain. You can do this by adding the following lines to the "API" section of the config file:
"API": { "HTTPHeaders": { "Access-Control-Allow-Origin": ["http://localhost:3000"] } }
-
Start the development server:
npm run dev