Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain Login System

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.

Features

  • 🔐 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

Tech Stack

Frontend

  • React
  • Vite
  • Chakra UI
  • Web3-React
  • Ethers.js
  • React Router

Backend

  • Node.js
  • Express
  • JWT Authentication
  • Winston Logger

Smart Contracts

  • Solidity
  • OpenZeppelin
  • Hardhat

Prerequisites

  • Node.js (v14 or higher)
  • MetaMask or any Web3 wallet
  • npm or yarn package manager
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/bucky-ops/blockchain-login-system.git
cd blockchain-login-system
  1. Install frontend dependencies:
npm install
  1. Install backend dependencies:
cd backend
npm install
  1. Install smart contract dependencies:
cd ../contracts
npm install
  1. Create environment files:

Frontend (.env):

VITE_CONTRACT_ADDRESS=your_contract_address_here
VITE_BACKEND_URL=http://localhost:5000

Backend (.env):

PORT=5000
NODE_ENV=development
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
FRONTEND_URL=http://localhost:3000
LOG_LEVEL=info

Contracts (.env):

PRIVATE_KEY=your_wallet_private_key
GOERLI_RPC_URL=your_goerli_rpc_url
ETHERSCAN_API_KEY=your_etherscan_api_key

Running the Application

  1. Start the backend server:
cd backend
npm run dev
  1. In a new terminal, start the frontend:
# In the root directory
npm run dev
  1. Deploy the smart contract (optional for development):
cd contracts
npm run deploy:local

The application will be available at:

Usage

  1. Connect your MetaMask wallet
  2. Sign the authentication message
  3. Access the dashboard
  4. Manage your profile and permissions

Security Features

  • Message signing for authentication
  • JWT-based session management
  • Protected routes
  • Rate limiting
  • Secure wallet connection handling
  • Role-based access control
  • Emergency pause functionality

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please open an issue in the GitHub repository or contact the maintainers.

Acknowledgments

  • OpenZeppelin for secure smart contract libraries
  • MetaMask for wallet integration
  • The Ethereum community for their excellent documentation

About

The blockchain-login-system project provides a secure authentication solution leveraging blockchain technology. Its primary purpose is to enable decentralized, tamper-proof login and identity management for modern web applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages