Lockie is a decentralized web3 application built using Next.js, Wagmi, Viem, and Foundry. It allows users to upload question papers to IPFS, store the IPFS hash on the Ethereum Sepolia testnet, and retrieve and view the stored question papers.
- Upload Question Papers: Users can upload question papers, which are stored on IPFS.
- Store IPFS Hashes: The IPFS hash of the uploaded question paper is stored on the Ethereum Sepolia testnet.
- Retrieve and View: Users can retrieve and view question papers using their index numbers.
- Next.js: A React framework for server-side rendering and building static web applications.
- Wagmi: A collection of React hooks for Ethereum.
- Viem: A library for building and interacting with Ethereum DApps.
- Ethereum Sepolia: A testnet for Ethereum development.
- Foundry: A smart contract development toolkit.
- IPFS: A peer-to-peer hypermedia protocol for storing and sharing content.
- Node.js and npm installed
- Foundry installed
- Metamask or another web3 wallet
-
Clone the repository:
git clone https://github.com/your-username/lockie.git cd lockie
-
Install dependencies::
npm install
-
Set up environment variables: Create a .env.local file in the root directory and add your environment variables.
NEXT_PUBLIC_ALCHEMY_RPC=your-alchemy-project-rpc NEXT_PUBLIC_SEPOLIA_PRIVATE_KEY=your-sepolia-private-key NEXT_PUBLIC_IPFS_API_URL=your-ipfs-api-url
-
Compile smart contracts with Foundry::
forge build
-
Deploy the smart contracts::
forge create --private-key $NEXT_PUBLIC_SEPOLIA_PRIVATE_KEY src/YourContract.sol:YourContract --rpc-url $NEXT_PUBLIC_ALCHEMY_RPC
-
Running the Application:
-
Start the development server::
npm run dev
-
Open the application:
Open http://localhost:3000 in your browser.