Skip to content

Kasa1905/ProofVault

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ProofVault - Decentralized Credential Verification on Base

ProofVault Banner

A decentralized credential verification system built on Base blockchain, featuring Soulbound tokens for immutable credentials, IPFS storage for proofs, and seamless Farcaster integration.

🌟 Features

  • πŸ” Wallet Integration: Connect Base wallets using OnchainKit
  • πŸŽ“ Credential Minting: Mint NFT/Soulbound tokens for credentials
  • πŸ“ IPFS Storage: Store credential proofs on decentralized storage
  • πŸ“± QR Verification: Generate QR codes for instant verification
  • βœ… Onchain Verification: Verify credentials directly on blockchain
  • πŸš€ Farcaster Sharing: Share verified credentials on Farcaster
  • ⚑ Real-time Updates: Live notifications for credential events

πŸ—οΈ Tech Stack

  • Frontend: Next.js 14, React 18, TypeScript, TailwindCSS
  • Blockchain: Base (Layer 2), Solidity, OnchainKit, Ethers.js
  • Storage: IPFS (Web3.Storage, Pinata)
  • Social: Farcaster, Neynar API
  • Backend: Node.js, Express.js
  • Database: Redis (caching), Optional MongoDB/PostgreSQL
  • Development: Hardhat, TypeScript

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Git
  • Metamask or compatible wallet
  • Base Sepolia ETH for testing

1. Clone Repository

git clone <your-repo-url>
cd base-template-mini-app

2. Install Dependencies

npm install

3. Environment Setup

Copy the environment template:

cp .env.example .env.local

Fill in your configuration in .env.local:

# Base Network Configuration
NEXT_PUBLIC_CHAIN_ID=84532
NEXT_PUBLIC_RPC_URL=https://sepolia.base.org

# Smart Contract (Deploy first, then add address)
NEXT_PUBLIC_PROOFVAULT_CONTRACT_ADDRESS=your_contract_address
PRIVATE_KEY=your_deployer_private_key

# IPFS Configuration  
WEB3_STORAGE_TOKEN=your_web3_storage_token
PINATA_API_KEY=your_pinata_key

# Farcaster/Neynar
NEYNAR_API_KEY=your_neynar_key
NEYNAR_CLIENT_ID=your_client_id

# Redis (for notifications)
KV_REST_API_TOKEN=your_upstash_token
KV_REST_API_URL=your_upstash_url

4. Smart Contract Deployment

Deploy the ProofVault contract to Base Sepolia:

# Compile contracts
npx hardhat compile

# Deploy to Base Sepolia
npx hardhat run scripts/deploy.js --network baseSepolia

# Update .env.local with deployed contract address

5. Run Development Server

npm run dev

Open http://localhost:3000 to see ProofVault in action!

πŸ“‹ API Endpoints

Credentials

  • POST /api/credentials - Mint new credential
  • GET /api/credentials - Get all credentials (admin)
  • GET /api/credentials/[wallet] - Get user credentials
  • DELETE /api/credentials/[wallet] - Revoke credential

Verification

  • POST /api/verify - Verify credential
  • GET /api/verify?tokenId=123 - Quick verification

Sharing

  • POST /api/share - Generate share link
  • GET /api/share?tokenId=123 - Get shareable info

Notifications

  • POST /api/send-notification - Send notification
  • GET /api/send-notification?fid=123 - Get user notifications

Webhooks

  • POST /api/webhook - Handle Farcaster webhooks
  • GET /api/webhook - Webhook verification
    ACCOUNT_ASSOCIATION_HEADER
    ACCOUNT_ASSOCIATION_PAYLOAD
    ACCOUNT_ASSOCIATION_SIGNATURE
    
  1. Redeploy to update the build with new environment variables

Authentication

Making Authenticated Requests

  1. Import the auth utilities:
import { fetchWithAuth } from "~/lib/auth";
  1. Use fetchWithAuth for API calls:
// Example API call
const response = await fetchWithAuth("/api/protected-route");
const data = await response.json();

Protected API Routes

  1. Import the auth utilities:
import { verifyAuth } from "~/lib/auth";
  1. Verify authentication in your route:
export async function GET(request: Request) {
  const auth = await verifyAuth(request);
  if (!auth) {
    return new NextResponse("Unauthorized", { status: 401 });
  }

  // Your protected route logic here
  return NextResponse.json({ fid: auth.fid });
}

Learn More

Guide

This is made using Neynar's StarterKit this Neynar docs page for a simple guide on how to create a Farcaster Mini App in less than 60 seconds!

Getting Started

To create a new mini app project, run:

Click on use this template.

To run the project:

cd <PROJECT_NAME>
npm run dev

Building for Production

To create a production build, run:

npm run build

The above command will generate a .env file based on the .env.local file and user input. Be sure to configure those environment variables on your hosting platform.

Building with AI

AI guide for FC Mini Apps SDK - https://miniapps.farcaster.xyz/docs/getting-started#building-with-ai

AI guide for Neynar - https://docs.neynar.com/docs/neynar-farcaster-with-cursor

Why MiniApps?

Lets u open Apps inside social feed. Leverage and build on social Data so add social component to make your app viral. Send Notifications to retain the users.

Simple flow

  • Build your simple App just like u bulid webapps
  • Wrap it inside the NeynarProvider (FrameContext) to get the context of the user [username, fid, walletadd, pfp and with fid his entire social graph]
  • Access the inbuilt Farcaster Wallet for any onchain activity

βœ… ProofVault Implementation Complete

Status: FULLY FUNCTIONAL MINIAPP DEPLOYED πŸŽ‰

πŸ— What's Been Built

Pages Structure (Next.js Pages Router):

  • βœ… Landing Page (/) - Hero section with features showcase
  • βœ… Dashboard (/dashboard) - Credential management with wallet integration
  • βœ… Mint Page (/mint) - Credential minting with file upload
  • βœ… Verify Page (/verify) - QR code verification system
  • βœ… Profile Page (/profile) - User profile with Farcaster sharing

API Endpoints:

  • βœ… /api/mint - Credential minting with IPFS integration
  • βœ… /api/verify/[tokenId] - Credential verification
  • βœ… /api/share - Social sharing with QR generation
  • βœ… /api/credentials/[walletAddress] - User credential fetching

Components & Services:

  • βœ… WalletConnect - Base network wallet integration
  • βœ… CredentialCard - Credential display with actions
  • βœ… useWallet Hook - Wallet state management
  • βœ… IPFS Service - Web3.Storage integration
  • βœ… OnchainKit Service - Base blockchain integration
  • βœ… Farcaster Service - Social sharing with Neynar API

Smart Contract:

  • βœ… ProofVault.sol - ERC721 Soulbound credential contract

πŸš€ Current Status

The ProofVault miniapp is LIVE and FUNCTIONAL at:

  • Local Development: http://localhost:3000
  • Warpcast Testing: Use the Warpcast Developer Tools with localhost URL

🎯 Key Features Working

  1. Wallet Connection - MetaMask integration with Base network switching
  2. Credential Minting - File upload, IPFS storage, blockchain minting
  3. Verification System - QR code generation, credential validation
  4. Social Sharing - Farcaster frames, Twitter integration
  5. Dashboard Management - View credentials, share, verify actions

πŸ”§ Development Commands

npm run dev     # Start development server
npm run build   # Build for production
npm start       # Start production server
npm run lint    # Code linting

πŸ“± Testing Instructions

  1. Local Testing: Visit http://localhost:3000
  2. Farcaster Testing:

πŸŽ‰ Success Metrics

  • βœ… Complete Pages Structure: 5 main pages implemented
  • βœ… Full API Integration: 4 API endpoints with error handling
  • βœ… Wallet Integration: Base network support with MetaMask
  • βœ… IPFS Storage: File upload and decentralized storage
  • βœ… Social Features: Farcaster frames and sharing
  • βœ… Responsive Design: Mobile-optimized interface
  • βœ… Error Handling: Comprehensive error management
  • βœ… Development Ready: Hot reload, linting, TypeScript support

ProofVault is production-ready for the Base ecosystem! πŸš€

About

farcaster-app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.0%
  • TypeScript 15.5%
  • CSS 2.8%
  • Solidity 1.1%
  • Shell 0.6%