Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EduChain - Decentralized Educational Platform

A Web3-powered educational platform where teachers create tasks and students solve them through a stake-based incentive system. Built for hackathon with focus on education in the era of technology.

🎯 Key Features

For Teachers

  • Task Creation: Post educational tasks with customizable difficulty, categories, and rewards
  • Staking Mechanism: Stake tokens based on task quality and earn yield based on student success rates
  • Quality Metrics: Build reputation through high-quality tasks and student satisfaction
  • Dashboard: Track student progress, submissions, and task performance

For Students

  • Task Discovery: Browse and filter tasks by difficulty, category, and rewards
  • AI-Powered Recommendations: Get personalized task suggestions with transparent explanations
  • Stake to Learn: Stake tokens to attempt tasks, earn rewards upon completion
  • Collaborative Learning: Chat with teachers and AI assistant for guidance

Core Principles

πŸ” Ethical & Transparent

  • Algorithmic Transparency: All recommendations and evaluations come with clear explanations
  • Data Privacy: Students can view, export, and delete their personal data anytime
  • Fair Reputation: Reputation earned through participation, not wealth

πŸŽ“ Personalized Learning

  • Students choose which tasks to attempt
  • AI recommendations based on skill level and interests
  • Flexible learning paths

🀝 Collaboration

  • Built-in chat with AI assistance
  • Teacher-student communication
  • Peer learning support

πŸ›  Tech Stack

Frontend

  • Next.js 16 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - Beautiful component library
  • RainbowKit - Wallet connection
  • Wagmi - Web3 React hooks
  • Viem - Ethereum library

Backend

  • Supabase - PostgreSQL database with real-time subscriptions
  • Row Level Security (RLS) - Database-level access control
  • Supabase Auth - User authentication

Blockchain

  • Solidity - Smart contract development
  • Foundry - Smart contract framework
  • OpenZeppelin - Secure contract libraries
  • ERC-20 Token (EDU) - Platform token for staking/rewards

πŸ“‚ Project Structure

smarthack/
β”œβ”€β”€ frontend/              # Next.js frontend application
β”‚   β”œβ”€β”€ app/              # App router pages
β”‚   β”‚   β”œβ”€β”€ dashboard/    # Dashboard pages
β”‚   β”‚   β”‚   β”œβ”€β”€ teacher/  # Teacher dashboard
β”‚   β”‚   β”‚   └── student/  # Student dashboard
β”‚   β”‚   β”œβ”€β”€ settings/     # User settings & privacy
β”‚   β”‚   └── tasks/        # Task pages
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ ui/          # UI components (shadcn)
β”‚   β”‚   β”œβ”€β”€ TaskCard.tsx
β”‚   β”‚   β”œβ”€β”€ ChatInterface.tsx
β”‚   β”‚   └── DataPrivacyPanel.tsx
β”‚   └── lib/             # Utilities & configs
β”‚       β”œβ”€β”€ types/       # TypeScript types
β”‚       β”œβ”€β”€ supabase/    # Supabase client & queries
β”‚       └── wagmi.ts     # Web3 configuration
β”œβ”€β”€ web3/                # Smart contracts
β”‚   └── src/
β”‚       β”œβ”€β”€ EduToken.sol         # ERC-20 token
β”‚       └── TaskStaking.sol      # Staking contract
└── supabase/            # Database
    └── migrations/      # SQL migrations

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Foundry (for smart contracts)
  • Supabase account

1. Clone the Repository

git clone <your-repo-url>
cd smarthack

2. Setup Frontend

cd frontend
npm install

Create .env.local:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id

Run development server:

npm run dev

3. Setup Supabase

  1. Create a new Supabase project
  2. Run the migration file in SQL editor:
supabase/migrations/001_initial_schema.sql

4. Setup Smart Contracts

cd web3
forge install OpenZeppelin/openzeppelin-contracts
forge build

Deploy contracts:

forge script script/Deploy.s.sol --rpc-url <your-rpc-url> --broadcast

πŸ“Š Database Schema

Core Tables

  • profiles: User profiles with wallet addresses and reputation
  • tasks: Educational tasks created by teachers
  • task_submissions: Student submissions and grades
  • staking_transactions: Token staking records
  • task_ratings: Student ratings of tasks
  • teacher_ratings: Student ratings of teachers
  • chat_rooms: Collaboration spaces
  • chat_messages: Messages with AI support
  • recommendation_explanations: AI recommendation reasoning
  • user_data_access_log: Privacy compliance tracking
  • notifications: User notifications

πŸ”— Smart Contracts

EduToken (ERC-20)

  • Platform token for staking and rewards
  • Mintable by contract owner
  • Burnable by token holders

TaskStaking

  • Teachers stake when creating tasks
  • Students stake when attempting tasks
  • Automatic reward distribution based on success
  • Yield calculation based on task quality and success rate
  • Emergency withdraw functionality

🎨 Key Components

TaskCard

Displays task information with:

  • Difficulty badge
  • Reward and stake amounts
  • Success rate
  • Teacher reputation
  • Category and tags

ChatInterface

Real-time chat with:

  • Teacher-student messaging
  • AI assistant integration
  • Message history
  • Auto-responses to questions

DataPrivacyPanel

GDPR-compliant features:

  • View all personal data
  • Export data as JSON
  • Delete account and data
  • Algorithmic transparency explanations

πŸ”’ Security Features

  1. Row Level Security (RLS): Database-level access control
  2. Smart Contract Auditing: Using OpenZeppelin standards
  3. ReentrancyGuard: Protection against reentrancy attacks
  4. Input Validation: Both frontend and database level
  5. Private Keys: Never exposed to frontend

🌟 Unique Features

Transparent AI Recommendations

Every task recommendation comes with an explanation showing:

  • Why it was recommended
  • Relevance score
  • Contributing factors (skill match, success rate, etc.)

Fair Reputation System

Reputation grows through:

  • Creating quality tasks (+1 point)
  • Completing tasks (+1 point)
  • High ratings (+5 points)
  • Success rate bonuses (+10 for >70%)
  • Consistent activity (+2/week)

Important: Reputation cannot be bought or transferred!

Data Privacy First

Students have full control:

  • View what data is collected and why
  • Export complete data history
  • Delete all personal data
  • Track who accessed their data

πŸ… Proof-of-Learning Badges (NFT Credentials)

Concept: Transform top achievements into verifiable credentials on the blockchain.

When a student completes a task and receives 5 stars from their teacher, they don't just earn tokens - they unlock the ability to mint a Proof-of-Learning Badge.

How It Works (Hackathon Implementation):

  1. Achievement Trigger: Student gets 5-star review β†’ System displays: "πŸŽ‰ Congratulations! You're eligible to mint your Python Expert Badge!"

  2. Mint Experience:

    • Big prominent button: [✨ MINT YOUR BADGE]
    • On click: Beautiful loading animation with blockchain-themed messaging:
      • "⛓️ Anchoring proof to blockchain..."
      • "🎨 Generating badge artwork..."
      • "βœ… Confirming transaction..."
  3. Badge Display: After "minting", the badge appears:

    • In student's profile
    • As a visual certificate (SVG/PNG)
    • With metadata: task title, date, teacher signature, skill verified

The Pitch (Why This Matters):

  • For Students: Portable proof of skills that can be displayed in Web3 profiles/portfolios
  • For Employers: Verifiable credentials showing actual skill completion, not just claims
  • For Education: Transforms grades into blockchain-backed credentials
  • For Web3: Real-world utility of NFTs beyond speculation

Technical Implementation (Hackathon Version):

  • Frontend-only with realistic UX/UI
  • Pre-designed badge templates
  • Simulated blockchain interaction (animations + messaging)
  • Database stores badge records
  • Uses Web3 terminology: "Mint", "NFT", "Soulbound Token (SBT)", "On-Chain Proof"

Future Enhancement (Post-Hackathon):

  • Real smart contract integration (ERC-721 or ERC-1155)
  • On-chain metadata storage (IPFS)
  • True Soulbound Tokens (non-transferable)
  • Cross-platform verification

πŸ’‘ Hackathon Strategy: This feature demonstrates understanding of Web3 utility while staying within time constraints. It's about the concept and UX, not full blockchain implementation.

πŸ“ˆ Future Enhancements

  • NFT certificates for completed tasks (Proof-of-Learning Badges - Hackathon Version βœ…)
  • Full blockchain NFT minting (real smart contracts)
  • DAO governance for platform decisions
  • Advanced AI tutoring integration
  • Multi-chain support
  • Mobile app (React Native)
  • Peer review system
  • Task marketplace
  • Learning analytics dashboard

🀝 Contributing

This is a hackathon project! Feel free to fork and improve.

πŸ“„ License

MIT License - feel free to use for educational purposes

πŸ† Hackathon Theme: Education in the Era of Technology

This platform addresses:

  • βœ… Personalized learning through AI
  • βœ… Active participation through gamification
  • βœ… Creativity through flexible task selection
  • βœ… Transparency in algorithmic decisions
  • βœ… Data privacy and ethical technology
  • βœ… Fair access (reputation β‰  wealth)
  • βœ… Teacher-student collaboration

Built with ❀️ for education and Web3

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages