This guide will walk you through setting up ElimuChain for development.
- Node.js 16+
- npm or yarn
- MetaMask browser extension
- Supabase account
- Git
-
Clone the repository:
git clone https://github.com/ElimuChain/elimuchain.git cd elimuchain
-
Install dependencies:
npm install
-
Create environment variables file:
cp .env.example .env
-
Create a new Supabase project
-
Get your project URL and anon key from the project settings
-
Update
.env
with your Supabase credentials:VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Run the database migrations:
-- Available in supabase/migrations/
-
Deploy the ElimuChain smart contract:
# Using your preferred deployment method (Hardhat, Truffle, etc.)
-
Add the contract address to
.env
:VITE_CONTRACT_ADDRESS=your_contract_address
-
Start the development server:
npm run dev
-
Open http://localhost:5173 in your browser
Run the test suite:
npm run test
-
Build the application:
npm run build
-
Deploy the
dist
directory to your hosting provider
If you're having issues with MetaMask:
- Ensure MetaMask is installed
- Connect to the correct network
- Unlock your wallet
If Supabase connection fails:
- Verify your environment variables
- Check if the database is accessible
- Ensure RLS policies are correctly configured