How ashrafbeshtawi/landlord works
Project type and purpose
• This is a blockchain-enabled full-stack DApp called “LandLordToken (LND)”.
• It consists of:
• A Solidity smart contract (ERC-20 token + profit-claim logic)
• A backend/service layer that signs profit claims (implemented as Next.js API routes)
• A Next.js frontend for users to connect wallets, view balances, and claim tokens
• A local Hardhat node (or any Ethereum‐compatible RPC endpoint) for development/deployment
File structure
• Top level:
• docker-compose.yml: orchestrates the Next.js service and a local Hardhat node
• nextjs/: frontend & backend (Next.js app)
• web3/: smart contract source, Hardhat config, deployment scripts, tests
• nextjs/:
• src/app/page.tsx, layout.tsx + components/: UI pages and React components
• src/app/api/balance/route.ts & api/signature/route.ts: backend endpoints
• store/, theme/: client global state and styling
• web3/:
• contracts/: Solidity files (using OpenZeppelin)
• scripts/deploy.js: deploys contracts
• hardhat.config.js: network & compiler settings
• test/: contract unit tests
Extract architecture insights from README
• Smart contract flows:
1. Owner calls distributeProfits(amount) on the contract
2. Contract records snapshot time & excludes owner
3. Backend computes individual entitlements at snapshot time
4. Backend signs messages (ECDSA) for each claimant
5. User submits signed claim to claimProfit(), contract verifies signature & transfers tokens
• Tech stack:
• Solidity 0.8.x, Hardhat, Ethers.js v6, OpenZeppelin
• Next.js (TypeScript), React, Tailwind/CSS