Skip to content

zeynepkaynak/WorldConnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ World ID Pool

A modern Next.js application that leverages World ID verification for secure authentication and enables users to connect with each other through a sophisticated friend management system. Built with cutting-edge technologies including Next.js 14, TypeScript, Tailwind CSS, and Aceternity UI.

๐Ÿš€ Features

๐Ÿ” World ID Authentication

  • Secure Login: Users authenticate using World ID verification system
  • Session Management: JWT-like session tokens with secure expiration handling
  • Privacy First: No personal data stored, only World ID nullifier hash
  • Seamless Integration: IDKit integration for smooth user experience

๐Ÿ‘ค Personal Profile System

  • Unique User Profiles: Each verified user gets a personalized profile
  • Username Customization: Users can set and update their display names
  • Profile Analytics: View account creation date and activity status
  • Secure Session Handling: Persistent sessions across browser refreshes

๐ŸŽฏ Friend Connection System

  • Dual Connection Methods:
    • ๐Ÿ“ฑ QR Code Sharing: Generate and scan personal QR codes
    • ๐Ÿ”ค Friend Codes: 6-character alphanumeric codes for easy sharing
  • Friend Requests: Send, receive, accept, or reject friend requests
  • Real-time Updates: Instant friend list updates without page refresh
  • Friend Management: View all connected friends with their details

๐ŸŽจ Modern UI/UX

  • Aceternity UI: Beautiful, modern interface components
  • Aurora Background: Stunning animated background effects
  • Responsive Design: Optimized for all device sizes
  • Dark Theme: Elegant dark mode design
  • Toast Notifications: User-friendly feedback system

๐Ÿ› ๏ธ Technology Stack

Frontend

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • Aceternity UI - Modern UI component library
  • shadcn/ui - High-quality component system
  • Framer Motion - Smooth animations and transitions

Backend

  • Next.js API Routes - Serverless API endpoints
  • World ID Integration - Secure identity verification
  • Session Management - Custom session handling system
  • RESTful Architecture - Clean API design patterns

Additional Libraries

  • IDKit - World ID verification SDK
  • QRCode - QR code generation
  • Sonner - Toast notification system
  • Lucide React - Beautiful icon library
  • UUID - Unique identifier generation

๐Ÿ“‹ Prerequisites

Before running this project, make sure you have:

  • Node.js (v18 or later)
  • npm or yarn package manager
  • World ID App ID (for production use)

๐Ÿš€ Quick Start

1. Clone the Repository

git clone https://github.com/your-username/worldid-pool.git
cd worldid-pool

2. Install Dependencies

npm install
# or
yarn install

3. Environment Setup

Create a .env.local file in the root directory:

# World ID Configuration
NEXT_PUBLIC_WLD_APP_ID=your_world_id_app_id
NEXT_PUBLIC_WLD_ACTION=verify_human

# Development Settings
NODE_ENV=development

4. Run Development Server

npm run dev
# or
yarn dev

5. Open Application

Navigate to http://localhost:3000 in your browser.

๐Ÿ“– How It Works

๐Ÿ” Authentication Flow

  1. World ID Verification

    • User clicks "Verify with World ID" button
    • World ID app opens for biometric verification
    • Cryptographic proof is generated and verified
    • Unique nullifier hash is created for the user
  2. Session Creation

    • System generates a secure session token
    • User profile is created or retrieved
    • Session token is stored in browser localStorage
    • User is redirected to their profile page
  3. Profile Access

    • Session token validates user identity
    • Profile data is fetched from secure storage
    • User gains access to all platform features

๐Ÿ‘ฅ Friend System

  1. Profile Generation

    • Each user receives a unique 6-character friend code
    • Personal QR code is generated containing the friend code
    • Both can be shared to connect with others
  2. Friend Requests

    User A                    User B
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Scans QR Code   โ”‚ โ”€โ”€โ”€โ–บ โ”‚ Receives Request โ”‚
    โ”‚ or Enters Code  โ”‚      โ”‚ in Profile      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚                        โ”‚
             โ”‚                        โ–ผ
             โ”‚               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚               โ”‚ Accept/Reject   โ”‚
             โ”‚               โ”‚ Decision        โ”‚
             โ”‚               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚                        โ”‚
             โ–ผ                        โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Friends List    โ”‚ โ—„โ”€โ”€โ–บ โ”‚ Friends List    โ”‚
    โ”‚ Updated         โ”‚      โ”‚ Updated         โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    
  3. Connection Management

    • View all pending friend requests
    • Accept or reject requests with one click
    • Browse connected friends list
    • Real-time status updates

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/                      # API Routes
โ”‚   โ”‚   โ”œโ”€โ”€ v1/login/            # World ID authentication
โ”‚   โ”‚   โ”œโ”€โ”€ profile/             # User profile management
โ”‚   โ”‚   โ””โ”€โ”€ friends/             # Friend system APIs
โ”‚   โ”œโ”€โ”€ profile/                 # Profile page
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx            # Main profile interface
โ”‚   โ”œโ”€โ”€ globals.css             # Global styles
โ”‚   โ”œโ”€โ”€ layout.tsx              # Root layout
โ”‚   โ””โ”€โ”€ page.tsx                # Landing page
โ”œโ”€โ”€ components/                  # React Components
โ”‚   โ”œโ”€โ”€ ui/                     # UI Components
โ”‚   โ”‚   โ”œโ”€โ”€ button.tsx          # Button component
โ”‚   โ”‚   โ”œโ”€โ”€ card.tsx            # Card component
โ”‚   โ”‚   โ”œโ”€โ”€ input.tsx           # Input component
โ”‚   โ”‚   โ”œโ”€โ”€ tabs.tsx            # Tabs component
โ”‚   โ”‚   โ”œโ”€โ”€ avatar.tsx          # Avatar component
โ”‚   โ”‚   โ”œโ”€โ”€ badge.tsx           # Badge component
โ”‚   โ”‚   โ””โ”€โ”€ aurora-background.tsx # Aurora background
โ”‚   โ”œโ”€โ”€ world-id-login.tsx      # World ID login component
โ”‚   โ”œโ”€โ”€ icons.tsx               # Icon definitions
โ”‚   โ””โ”€โ”€ aurora-background-demo.tsx # Demo component
โ”œโ”€โ”€ lib/                        # Utility Libraries
โ”‚   โ”œโ”€โ”€ storage.ts              # Global storage management
โ”‚   โ””โ”€โ”€ utils.ts                # Helper functions
โ””โ”€โ”€ types/                      # TypeScript Definitions
    โ””โ”€โ”€ index.ts                # Type definitions

๐Ÿ”ง API Endpoints

Authentication

  • POST /api/v1/login - World ID verification and session creation
  • GET /api/v1/session/verify - Session validation

Profile Management

  • GET /api/profile - Fetch user profile data
  • PUT /api/profile - Update user profile information

Friend System

  • GET /api/friends - Get friends list and pending requests
  • POST /api/friends - Send friend request
  • PUT /api/friends - Accept/reject friend request

๐ŸŽฎ Usage Guide

Getting Started

  1. Visit the Homepage: Open the application in your browser
  2. World ID Verification: Click "Verify with World ID" and complete biometric verification
  3. Profile Creation: Your profile is automatically created upon successful verification
  4. Explore Features: Navigate through your profile tabs to explore all features

Connecting with Friends

  1. Share Your Code:
    • Go to "QR Code" tab to show your QR code
    • Or share your 6-character friend code from "Profile" tab
  2. Add Friends:
    • Go to "Friends" tab
    • Enter a friend's code or scan their QR code
    • Send friend request
  3. Manage Requests:
    • Check "Friends" tab for incoming requests
    • Accept or reject requests as desired
    • View your friends list

Profile Customization

  1. Update Username: Change your display name in the "Profile" tab
  2. View Details: See your World ID, friend code, and account information
  3. Logout: Securely end your session when done

๐Ÿ”’ Security Features

  • World ID Verification: Cryptographic proof of human identity
  • Session Management: Secure token-based authentication
  • Privacy Protection: No personal data storage
  • Request Validation: All API endpoints validate session tokens
  • Rate Limiting: Built-in protection against abuse

๐ŸŽฏ Development

Running Tests

# Check TypeScript types
npm run type-check

# Lint code
npm run lint

# Build for production
npm run build

Environment Variables

# Required for World ID
NEXT_PUBLIC_WLD_APP_ID=app_staging_xxx
NEXT_PUBLIC_WLD_ACTION=verify_human

# Optional
NODE_ENV=development

๐Ÿš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect repository to Vercel
  3. Configure environment variables
  4. Deploy automatically

Other Platforms

  • Netlify: Static site deployment
  • Railway: Full-stack deployment
  • Heroku: Container deployment

๐Ÿ›ฃ๏ธ Roadmap

Upcoming Features

  • Database Integration: Replace in-memory storage with persistent database
  • Real World ID Verification: Implement production World ID verification
  • Profile Images: Upload and manage profile pictures
  • QR Scanner: In-app QR code scanning functionality
  • Friend Groups: Organize friends into custom groups
  • Activity Feed: See friend activities and updates
  • Mobile App: React Native companion app
  • Advanced Privacy: Enhanced privacy controls

Technical Improvements

  • Rate Limiting: Implement API rate limiting
  • Caching: Add Redis caching layer
  • WebSockets: Real-time friend updates
  • Push Notifications: Browser push notifications
  • Analytics: User behavior analytics
  • SEO Optimization: Enhanced search engine optimization

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the Repository
  2. Create Feature Branch: git checkout -b feature/amazing-feature
  3. Commit Changes: git commit -m 'Add amazing feature'
  4. Push to Branch: git push origin feature/amazing-feature
  5. Open Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use Tailwind CSS for styling
  • Write clear commit messages
  • Add tests for new features
  • Update documentation

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • World ID Team - For the amazing identity verification system
  • Aceternity UI - For beautiful UI components
  • Next.js Team - For the excellent React framework
  • Vercel - For seamless deployment platform

๐Ÿ“ž Support

  • Documentation: Check this README and inline comments
  • Discussions: Join GitHub Discussions for questions
  • Email: Contact the development team

Built with โค๏ธ for ETH Global Hackathon

Connecting humans in the digital world through verified identity and meaningful relationships.

About

Secure social platform with World ID biometric verification & QR friend codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors