A Next.js 15 marketplace application with Ethereum authentication, Zero-Knowledge integrations, and MongoDB backend. Built with modern web3 technologies and TurboPack for development efficiency.
- Wallet-based authentication (Ethereum/SIWE)
- Secure session management
- MongoDB database integration
- IPFS file storage via Pinata
- Blockchain interaction with Wagmi/Viem
- Responsive UI with Radix + Tailwind
- Form validation with Zod + React Hook Form
- State management with Zustand
- TypeScript support
- End-to-end testing with Cypress
- NextAuth.js (v4.24) - Authentication framework
- RainbowKit (v2.2) - Wallet connection UI
- SIWE (v3.0) - Sign-In with Ethereum protocol
- iron-session - Encrypted cookie sessions
-
Wallet Connection
Users connect Ethereum wallet via RainbowKit modal -
SIWE Signature
Frontend generates SIWE message:const message = new SiweMessage({ domain: window.location.host, address: walletAddress, statement: 'Sign in to zk-Marketplace', uri: window.location.origin, version: '1', chainId: 1, nonce: await getNonce(), })
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.js. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
- Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
$ forge build$ forge test$ forge fmt$ forge snapshot$ anvil$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --helpHere is a detailed README for the contracts folder:
This folder contains the smart contracts for our project, written in Solidity. The contracts are designed to be deployed on the Ethereum blockchain and interact with each other to provide a specific functionality.
OpenZeppelin Contracts is a library of reusable, secure, and tested smart contracts written in Solidity. It provides a set of pre-built contracts that can be used as building blocks for more complex applications. OpenZeppelin Contracts is widely used in the Ethereum ecosystem and is considered a standard for building secure and reliable smart contracts.
The following contracts are included in this folder:
Marketplace.sol: This contract represents a marketplace where users can buy and sell NFTs.AdvancedERC1155.sol: This contract represents an NFT that can be minted, transferred, and burned.ERC1155Marketplace.sol: This contract represents a marketplace for ERC1155 tokens.
The ABI (Application Binary Interface) is a JSON file that describes the contract's interface, including its functions, variables, and events.
Marketplace.abi.jsonAdvancedERC1155.abi.jsonERC1155Marketplace.abi.json
The bytecode is the compiled version of the contract that can be deployed on the Ethereum blockchain.
Marketplace.bytecodeAdvancedERC1155.bytecodeERC1155Marketplace.bytecode
The source code is the original Solidity code for each contract.
Marketplace.solAdvancedERC1155.solERC1155Marketplace.sol
The documentation for each contract is generated using the NatSpec format and can be found in the following files:
Marketplace.natspec.jsonAdvancedERC1155.natspec.jsonERC1155Marketplace.natspec.json
The OpenZeppelin Contracts library is included in this folder and can be found in the lib directory.
lib/openzeppelin-contracts
The following dependencies are required to compile and deploy the contracts:
@openzeppelin/contracts: ^5.3.0@openzeppelin/test-helpers: ^0.5.11hardhat: ^2.9.3solidity: ^0.8.20
The contracts can be deployed using the hardhat CLI tool. See the deploy.js script for more information.
The contracts can be tested using the hardhat CLI tool. See the test.js script for more information.
The contracts in this folder are licensed under the MIT License.
Contributions to this project are welcome. Please see the CONTRIBUTING.md file for more information.