A secure, decentralized authentication system that uses blockchain wallets for user authentication. This system provides a modern, secure, and user-friendly way to authenticate users using their blockchain wallets.
- 🔐 Wallet-based authentication using MetaMask
- 🔑 Passwordless login through cryptographic signatures
- 🔄 Cross-chain compatibility
- 🛡️ Role-based access control
- 📱 Modern, responsive UI with Chakra UI
- 🔍 On-chain user management
- 📊 Login tracking and analytics
- 🚀 Easy integration with existing applications
- React
- Vite
- Chakra UI
- Web3-React
- Ethers.js
- React Router
- Node.js
- Express
- JWT Authentication
- Winston Logger
- Solidity
- OpenZeppelin
- Hardhat
- Node.js (v14 or higher)
- MetaMask or any Web3 wallet
- npm or yarn package manager
- Git
- Clone the repository:
git clone https://github.com/bucky-ops/blockchain-login-system.git
cd blockchain-login-system- Install frontend dependencies:
npm install- Install backend dependencies:
cd backend
npm install- Install smart contract dependencies:
cd ../contracts
npm install- Create environment files:
Frontend (.env):
VITE_CONTRACT_ADDRESS=your_contract_address_here
VITE_BACKEND_URL=http://localhost:5000Backend (.env):
PORT=5000
NODE_ENV=development
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
FRONTEND_URL=http://localhost:3000
LOG_LEVEL=infoContracts (.env):
PRIVATE_KEY=your_wallet_private_key
GOERLI_RPC_URL=your_goerli_rpc_url
ETHERSCAN_API_KEY=your_etherscan_api_key- Start the backend server:
cd backend
npm run dev- In a new terminal, start the frontend:
# In the root directory
npm run dev- Deploy the smart contract (optional for development):
cd contracts
npm run deploy:localThe application will be available at:
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
- Connect your MetaMask wallet
- Sign the authentication message
- Access the dashboard
- Manage your profile and permissions
- Message signing for authentication
- JWT-based session management
- Protected routes
- Rate limiting
- Secure wallet connection handling
- Role-based access control
- Emergency pause functionality
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.
- OpenZeppelin for secure smart contract libraries
- MetaMask for wallet integration
- The Ethereum community for their excellent documentation