Skip to content
HackerEEOPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CryptoLaunch - IDO Launchpad Platform

A production-ready, full-stack crypto token launchpad platform where blockchain projects can launch token sales and users can participate in investments. Built with modern technologies and best practices.


πŸ“š Complete Documentation Available!

New to the project? We have comprehensive, beginner-friendly documentation covering everything from setup to deployment!

🎯 Quick Links

Document Description For
πŸ“– Documentation Index Start here! Overview of all docs Everyone
πŸš€ Setup Guide Zero to running in 30 minutes Beginners
πŸ›οΈ Architecture System design explained Developers
πŸ“ Folder Structure Every file explained New developers
πŸ” Environment Variables All .env variables Everyone
πŸ”— Smart Contracts Contract integration Blockchain devs
πŸš€ Deployment Production deployment DevOps
πŸ“– Best Practices Coding standards Developers
πŸ› Troubleshooting Common issues Everyone

πŸŽ“ Learning Paths

Complete Beginner?

  1. Documentation Index β†’ Understand what CryptoLaunch is
  2. Setup Guide β†’ Get it running locally
  3. Folder Structure β†’ Learn the codebase

Developer Joining the Project?

  1. Setup Guide β†’ Install and configure
  2. Architecture β†’ Understand system design
  3. Best Practices β†’ Follow standards

Deploying to Production?

  1. PRODUCTION_AUDIT_REPORT.md β†’ Review security audit
  2. CRITICAL_FIXES.md β†’ Fix vulnerabilities
  3. Deployment Guide β†’ Deploy safely

TypeScript React Vite TailwindCSS Supabase Ethereum

✨ Features

For Users

  • πŸ”— Web3 Wallet Integration: MetaMask and WalletConnect support
  • πŸ’Ž Project Discovery: Browse and filter token launches by status, raised amount, and more
  • πŸ“Š Real-Time Data: Live project statistics and countdown timers
  • πŸ’° Investment Management: Track your portfolio, investments, and claimable tokens
  • 🎨 Beautiful UI: Glassmorphism design with smooth animations
  • πŸ“± Fully Responsive: Optimized for mobile, tablet, and desktop

For Admins

  • πŸ›  Project Management: Create, edit, and delete projects
  • πŸ“ˆ Analytics Dashboard: Monitor platform performance
  • πŸ‘₯ User Management: View and manage platform users
  • πŸ”’ Role-Based Access: Secure admin panel with authentication

Technical Features

  • ⚑ Lightning Fast: Optimized bundle size with code splitting
  • πŸ” Secure: Row Level Security (RLS) policies, input sanitization, XSS protection
  • 🎯 Type-Safe: Full TypeScript coverage with strict mode
  • πŸ§ͺ Production-Ready: Error boundaries, loading states, and comprehensive error handling
  • β™Ώ Accessible: WCAG 2.1 AA compliant
  • πŸ”„ Real-Time: Supabase real-time subscriptions for live updates

πŸ›  Tech Stack

Frontend

  • React 18 - UI library with latest features
  • TypeScript - Type safety and better DX
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first CSS framework
  • Framer Motion - Animation library
  • Recharts - Chart library for data visualization
  • Zustand - Lightweight state management
  • React Router - Client-side routing
  • Ethers.js - Ethereum library for Web3 interactions

Backend & Database

  • Supabase - Backend-as-a-Service
    • PostgreSQL database
    • Real-time subscriptions
    • Row Level Security
    • Edge Functions (serverless)
    • Authentication

Blockchain

  • Multi-Chain Support - Arbitrum, Base, Polygon, Optimism, Ethereum, Sepolia
  • MetaMask & WalletConnect - Browser wallet integration
  • Ethers.js v6 - Modern Ethereum library
  • Smart Contract Integration - IDO pools, token vesting, whitelists

πŸ“‹ Prerequisites

  • Node.js 18+ and npm/yarn/pnpm
  • MetaMask or compatible Web3 wallet
  • Supabase account (free tier works)
  • RPC provider account (Alchemy, Infura, or QuickNode)

🌐 Supported Networks

Network Chain ID Type Explorer
Arbitrum One 42161 Mainnet arbiscan.io
Base 8453 Mainnet basescan.org
Optimism 10 Mainnet optimistic.etherscan.io
Polygon 137 Mainnet polygonscan.com
Ethereum 1 Mainnet etherscan.io
Sepolia 11155111 Testnet sepolia.etherscan.io

Recommended for production: Arbitrum One or Base (lowest gas fees)

πŸš€ Quick Start

1. Clone the Repository

git clone <repository-url>
cd crypto-launchpad

2. Install Dependencies

npm install

3. Environment Setup

Copy .env.example to .env and configure:

cp .env.example .env

Required variables:

# Supabase
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_SUPABASE_ANON_KEY=your_anon_key

# Network (default: Arbitrum One)
VITE_CHAIN_ID=42161
VITE_RPC_URL=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY
VITE_EXPLORER_BASE_URL=https://arbiscan.io

# WalletConnect
VITE_WALLETCONNECT_PROJECT_ID=your_project_id

See .env.example for all options and DEPLOYMENT.md for detailed setup.

4. Database Setup

The database tables are already created with proper RLS policies. To seed with mock data:

npm run seed

5. Run Development Server

npm run dev

Visit http://localhost:3000 to see the app.

6. Build for Production

npm run build

πŸ“ Project Structure

crypto-launchpad/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/             # Base UI components (Button, Card, Modal, etc.)
β”‚   β”‚   β”œβ”€β”€ layout/         # Layout components (Navbar, Footer)
β”‚   β”‚   β”œβ”€β”€ home/           # Homepage components
β”‚   β”‚   └── projects/       # Project-related components
β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”œβ”€β”€ Projects.tsx
β”‚   β”‚   β”œβ”€β”€ ProjectDetail.tsx
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   └── Admin.tsx
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ services/           # API services
β”‚   β”œβ”€β”€ store/              # Zustand stores
β”‚   β”œβ”€β”€ lib/                # Library configurations
β”‚   β”œβ”€β”€ config/             # App configuration
β”‚   β”œβ”€β”€ types/              # TypeScript types
β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”œβ”€β”€ App.tsx             # Main app component
β”‚   β”œβ”€β”€ main.tsx            # Entry point
β”‚   └── index.css           # Global styles
β”œβ”€β”€ scripts/                # Utility scripts
β”‚   └── seed-database.ts    # Database seeding script
β”œβ”€β”€ public/                 # Static assets
└── supabase/              # Supabase migrations and functions

πŸ—„ Database Schema

Projects Table

  • Stores token launch projects with details like token info, sale dates, and funding goals
  • Includes vesting schedule configuration

Investments Table

  • Records user investments in projects
  • Tracks tokens purchased and claimed amounts

Users Table

  • User profiles linked to wallet addresses
  • Admin role management

πŸ” Security Features

  1. Row Level Security (RLS): Database-level security policies
  2. Input Sanitization: All user inputs are sanitized
  3. XSS Protection: Content rendering is escaped
  4. Secure Wallet Connection: Safe Web3 provider interactions
  5. Rate Limiting: API call protection (ready for implementation)
  6. Environment Variables: Sensitive data stored securely

🎨 Design System

Colors

  • Primary: Purple (#8B5CF6)
  • Cyan: #06B6D4
  • Accent Blue: #3B82F6
  • Accent Pink: #EC4899
  • Background: Dark navy (#0F172A)
  • Card: Glassmorphism effect (rgba(255,255,255,0.05))

Components

  • Glassmorphism cards with backdrop blur
  • Gradient buttons and text
  • Smooth animations and transitions
  • Loading skeletons for better UX
  • Toast notifications for user feedback

πŸ“± Responsive Design

  • Mobile First: Optimized for small screens
  • Breakpoints:
    • Mobile: < 768px
    • Tablet: 768px - 1024px
    • Desktop: > 1024px
  • Touch Friendly: Large tap targets and mobile navigation

πŸ§ͺ Features Walkthrough

Homepage

  1. Hero Section: Eye-catching introduction with CTA buttons
  2. Stats Cards: Real-time platform statistics
  3. Featured Projects: Showcase of top projects
  4. Newsletter: Email signup (UI ready)

Projects Listing

  1. Advanced Filters: Filter by status, search, and sort options
  2. Grid/List Views: Different viewing modes
  3. Real-Time Updates: Live project data
  4. Pagination: Efficient data loading

Project Detail Page

  1. Comprehensive Info: All project details and tokenomics
  2. Interactive Charts: Pie charts for token distribution
  3. Investment Interface: Simple investment flow
  4. Countdown Timers: Real-time sale countdowns
  5. Social Links: Connect with project teams

User Dashboard

  1. Portfolio Overview: Total invested, tokens, and claimables
  2. Investment History: Detailed transaction history
  3. Claim Interface: Easy token claiming
  4. Performance Tracking: Investment analytics

Admin Panel

  1. Project Management: Full CRUD operations
  2. Create Projects: Multi-step project creation form
  3. Analytics: Platform performance metrics
  4. User Management: View and manage users

πŸ”„ Web3 Integration

Smart Contracts

The platform includes production-ready smart contracts in contracts/:

  • IDOPool.sol: Main investment pool contract
  • TokenVesting.sol: Token vesting with cliff and linear release
  • Whitelist.sol: Merkle proof whitelist verification
  • LaunchpadFactory.sol: Factory for deploying new IDO pools
  • MockERC20.sol: Test token for development

Contract Hooks

Custom React hooks for contract interactions (src/contracts/hooks/):

// Investment hook
const { poolInfo, invest, claim, refund } = useIDOPool(poolAddress);

// Vesting hook  
const { vestingSchedule, release, releasableAmount } = useTokenVesting(vestingAddress);

// Token balance hook
const { balance, allowance, approve } = useTokenBalance(tokenAddress, userAddress);

Wallet Connection

  • MetaMask support out of the box
  • WalletConnect integration
  • Network switching to Sepolia testnet
  • Balance display and transaction handling

Transaction Flow

  1. User connects wallet
  2. Selects investment amount
  3. Gas estimation is displayed
  4. User reviews and confirms transaction
  5. Transaction modal shows pending state
  6. On-chain transaction is verified by Supabase Edge Function
  7. Investment recorded in database with verified on-chain data

Supported Networks

  • Ethereum Mainnet (Chain ID: 1)
  • Sepolia Testnet (Chain ID: 11155111)
  • Arbitrum One (Chain ID: 42161)
  • Base (Chain ID: 8453)
  • Polygon (Chain ID: 137)

πŸ§ͺ Testing

Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm test -- --watch

# Run tests with UI
npm run test:ui

# Generate coverage report
npm run test:coverage

Test Files

Tests are located in src/contracts/hooks/__tests__/:

  • useIDOPool.test.ts - IDO Pool hook tests
  • useTokenVesting.test.ts - Vesting hook tests
  • useTokenBalance.test.ts - Token balance hook tests

Demo Investment Script

Test the investment flow on Sepolia:

# Set environment variables
export PRIVATE_KEY=your_private_key
export IDO_POOL_ADDRESS=deployed_pool_address
export SEPOLIA_RPC_URL=https://rpc.sepolia.org

# Run demo
node scripts/demo-invest.js

Contract Tests

Run Hardhat tests for smart contracts:

cd contracts
npm test

# Run specific test
npx hardhat test test/IDOPool.test.ts

# Run with coverage
npx hardhat coverage

Security Tests (Foundry)

Run fuzz tests:

cd contracts
forge test -vvv

# Run specific fuzz test
forge test --match-contract IDOPoolFuzzTest -vvv

πŸš€ Deployment

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Netlify

# Install Netlify CLI
npm i -g netlify-cli

# Deploy
netlify deploy --prod

Environment Variables

Make sure to set these in your deployment platform:

  • VITE_SUPABASE_URL
  • VITE_SUPABASE_SUPABASE_ANON_KEY

πŸ› Troubleshooting

Wallet Connection Issues

  • Ensure MetaMask is installed
  • Check you're on Sepolia testnet
  • Clear browser cache and reload

Database Errors

  • Verify Supabase credentials in .env
  • Check RLS policies are enabled
  • Ensure tables are created

Build Errors

  • Delete node_modules and reinstall
  • Clear Vite cache: rm -rf .vite
  • Check TypeScript errors: npm run build

πŸ“š Additional Resources

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.

πŸ™ Acknowledgments

  • Design inspired by DAO Maker and Polkastarter
  • Icons from Heroicons
  • Images from Unsplash

Built with ❀️ using React, TypeScript, and Supabase

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages