This is the frontend application for the CookieJar smart contract. It allows users to interact with the smart contract, including withdrawing funds as a whitelisted member.
- Connect your wallet through various providers
- View your whitelisted status
- Withdraw funds if you're whitelisted
- Modern UI built with React, Tailwind CSS, and shadcn components
Before you begin, make sure you have:
- Node.js (v16 or later)
- npm or yarn
- A deployed CookieJar contract (see the contract README for deployment instructions)
- Access to environment variables (detailed below)
This application requires the following environment variables to function properly:
VITE_INFURA_KEY- Infura API key for connecting to Ethereum networksVITE_CONTRACT_ADDRESS- The address of your deployed CookieJar contractVITE_WALLET_CONNECT_PROJECT_ID- WalletConnect project ID for wallet integration
- Visit Infura and sign up for an account
- Create a new project (you can name it "CookieJar" or whatever you prefer)
- Once created, you'll see your project's API key
- Copy this key for use in your environment variables
This is the address of your deployed CookieJar contract. If you've followed the deployment guide in the contract README, you should have this address.
Example: 0xE9D12E97bd19376c93c73198c2f64eAbE246912b
- Visit WalletConnect Cloud
- Sign up or log in to your account
- Create a new project (you can name it "CookieJar")
- Once created, you'll receive a Project ID
- Copy this ID for use in your environment variables
- Clone the repository:
git clone https://github.com/your-username/cookiejar.git
cd cookiejar/frontend- Install dependencies:
npm install
# or
yarn- Create a
.envfile in the frontend root directory with your environment variables:
VITE_INFURA_KEY=your_infura_api_key_here
VITE_CONTRACT_ADDRESS=your_contract_address_here
VITE_WALLET_CONNECT_PROJECT_ID=your_walletconnect_project_id_here
- Start the development server:
npm run dev
# or
yarn dev- Open your browser and navigate to
http://localhost:5173to see the application running.
- Push your code to a GitHub repository
- Go to Vercel and sign up or log in
- Click "New Project" and import your GitHub repository
- Add your environment variables in the Vercel project settings
- Deploy the project
- Push your code to a GitHub repository
- Go to Netlify and sign up or log in
- Click "New site from Git" and select your GitHub repository
- Add your environment variables in the Netlify project settings
- Deploy the project
- Build the production version:
npm run build
# or
yarn build- The built files will be in the
distfolder. You can deploy these files to any static hosting service like:- Amazon S3
- GitHub Pages
- Firebase Hosting
- Any other static hosting provider
You can customize the application by:
- Modifying UI components in the
src/componentsdirectory - Changing styles in the
src/stylesdirectory - Adding new functionality by extending the existing codebase