BlockDock is a decentralized e-municipality grievance management system built on the Ethereum blockchain. It enables citizens to file grievances, government administrators to manage funds and projects, and ensures transparency and immutability through blockchain technology.
- User Registration and Authentication: Citizens can register and log in to access the system.
- Grievance Filing: Users can submit grievances which are stored on the blockchain.
- Role-Based Access Control: Separate dashboards for Users, Admin Heads, and Government Admins.
- Fund Management: Government admins can allocate funds to admin heads for projects.
- Project Tracking: Admin heads can create and manage ongoing projects.
- Token-Based Economy: Internal token system for fund transfers within the system.
- Transparent Ledger: All transactions and changes are recorded on the blockchain for auditability.
- Frontend: React.js with React Router for navigation, Chart.js for data visualization, and Ethers.js for blockchain interaction.
- Backend/Smart Contracts: Solidity smart contracts deployed using Hardhat.
- Blockchain: Ethereum (compatible with local networks like Hardhat Network).
- Development Tools: Hardhat for contract compilation and testing, MetaMask for wallet integration.
Before running this project, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- Git
- A web3 wallet like MetaMask (for interacting with the blockchain)
-
Clone the Repository:
git clone https://github.com/ashwinsdk/block-dock.git cd block-dock -
Install Backend Dependencies:
cd backend npm install -
Install Frontend Dependencies:
cd ../block-dock npm install -
Set Up Environment Variables:
- Create a
.envfile in thebackenddirectory. - Add your Ethereum network configuration (e.g., for local Hardhat network or testnets like Sepolia).
- Create a
-
Navigate to the backend directory:
cd backend -
Compile the contracts:
npx hardhat compile
-
Deploy to local network:
npx hardhat run scripts/deploy-localhost.js --network localhost
Or deploy to a testnet (ensure your
.envis configured):npx hardhat run scripts/deploy.js --network <network-name>
-
Note the deployed contract address and update the frontend contract JSON files if necessary.
-
Start the Backend (Local Blockchain):
cd backend npx hardhat node -
Deploy Contracts to Local Network (in a new terminal):
cd backend npx hardhat run scripts/deploy-localhost.js --network localhost -
Start the Frontend:
cd ../block-dock npm start -
Open http://localhost:3000 in your browser.
- Register and log in.
- File grievances through the dashboard.
- View status of submitted grievances.
- Access government funds and ongoing projects information.
- View and update grievance statuses.
- Request funds from government admins.
- Create and manage projects.
- Monitor token balances.
- Assign admin heads.
- Approve fund requests.
- View all users, grievances, projects, and fund requests.
- Manage overall system funds.
block-dock/
├── backend/ # Smart contracts and deployment scripts
│ ├── contracts/ # Solidity contracts (EM.sol)
│ ├── scripts/ # Deployment and interaction scripts
│ └── hardhat.config.js # Hardhat configuration
├── block-dock/ # React frontend
│ ├── src/
│ │ ├── admin/ # Admin head components
│ │ ├── govt/ # Government admin components
│ │ ├── user/ # User components
│ │ └── App.js # Main app component
│ └── public/ # Static assets
├── docs/ # Documentation
└── README.md # This file
npx hardhat compile: Compile smart contractsnpx hardhat test: Run contract testsnpx hardhat node: Start local Ethereum networknpx hardhat run scripts/deploy-localhost.js --network localhost: Deploy to local network
npm start: Start development servernpm run build: Build for productionnpm test: Run tests
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Hardhat and React
- Inspired by the need for transparent governance systems
- Ethereum community for blockchain infrastructure
For questions or support, please open an issue on GitHub or contact the maintainers.