A comprehensive decentralized application for managing government tenders using blockchain technology, built with Next.js, Tailwind CSS, and Web3.
- Role-Based Access Control: Government users can create tenders, vendors can submit bids
- Filecoin Integration: Official documents stored on Filecoin Calibration testnet
- Smart Contract Management: Tender and bid management on Sepolia testnet
- Modern UI: Clean, responsive interface built with Tailwind CSS
The DApp uses several smart contracts deployed on Sepolia testnet:
- TenderContract: Manages tender creation and lifecycle
- BidSubmissionContract: Handles bid submissions and evaluations
Create a .env file in the root directory with cp .env.example .env:
# Sepolia Testnet Configuration
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
# Alchemy API Key
ALCHEMY_API_KEY="YOUR_API_KEY"
# Wallet Private Key
PRIVATE_KEY=""
# Infura API Key
NEXT_PUBLIC_INFURA_API_KEY="YOUR_API_KEY"
# WalletConnect Project ID
NEXT_PUBLIC_PROJECT_ID="YOUR_API_KEY"
# Filecoin Calibration Testnet Private Key (for document uploads)
PRIVATE_KEY=your_filecoin_private_key_here
# Optional: Contract Addresses (if different from defaults)
TENDER_CONTRACT_ADDRESS=YOUR_CONTRACT
BID_SUBMISSION_CONTRACT_ADDRESS=YOUR_CONTRACT- Clone the repository:
git clone <https://github.com/Althara-Labs/althara-dapp>
cd althara-dapp- Install dependencies:
npm install-
Set up environment variables (see Environment Setup above)
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Connect Wallet: Use MetaMask or another Web3 wallet
- Verify Role: Ensure your wallet has GOVERNMENT_ROLE assigned (ask an admin or use /admin)
- Create Tender:
- Navigate to
/tenders/create-tender - Fill in tender details (title, description, budget, deadline)
- Upload official documents (PDF, DOC, DOCX, TXT)
- Pay service fee (0.01 ETH)
- Submit tender
- Navigate to
- Connect Wallet: Use MetaMask or another Web3 wallet
- Browse Tenders: View available tenders on the main page
- Submit Bids:
- Select a tender
- Provide bid details and price
- Upload proposal documents
- Pay bid submission fee
The DApp uses the Synapse SDK to upload documents to Filecoin Calibration testnet:
- Network: Calibration testnet
- RPC URL: https://api.calibration.node.glif.io/rpc/v1
- Storage: Documents are stored with Content Identifiers (CIDs)
- Supported Formats: PDF, DOC, DOCX, TXT (max 10MB)
createTender(description, budget, requirementsCid): Create a new tenderhasRole(role, account): Check if account has specific rolegetTenderDetails(tenderId): Get tender informationmarkTenderComplete(tenderId): Mark tender as completed
submitBid(tenderId, price, description, proposalCid): Submit a bidacceptBid(tenderId, bidId): Accept a submitted bidrejectBid(tenderId, bidId): Reject a submitted bid
Handles file uploads to Filecoin:
- Method: POST
- Content-Type: multipart/form-data
- Parameters:
file: File to upload
- Response:
{ "cid": "bafy...", "filename": "document.pdf", "size": 12345, "type": "application/pdf" }
src/
├── app/
│ ├── api/
│ │ └── upload-document/
│ │ └── route.ts
│ ├── tenders/
│ │ ├── create-tender/
│ │ │ └── page.tsx
│ │ └── page.tsx
│ └── page.tsx
├── components/
│ └── landing/
└── lib/
└── contracts/
└── index.ts
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
- Web3: wagmi, viem
- Blockchain: Ethereum (Sepolia), Filecoin (Calibration)
- Storage: Synapse SDK for Filecoin
- Styling: Tailwind CSS
- Smart Contracts: Deploy to Sepolia testnet
- Filecoin: Use Calibration testnet for document storage
- Frontend: Test with MetaMask connected to Sepolia
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue on Github
- Contact the development team
- Check the documentation