A Web3 project that solves the problem of people registering for events but not attending. The platform uses smart contracts and financial commitments to ensure participant accountability and fair reward distribution.
Event organizers often face issues where participants register but don't show up, leading to inefficient resource allocation and unreliable attendance. ATFI addresses this by requiring financial commitments that are either returned upon attendance or distributed to attending participants.
- Smart Contract Integration: Ethereum/Base Sepolia blockchain for secure financial commitments
- Multi-Wallet Support: Works with both Privy Gmail-linked wallets and external wallets like MetaMask
- Event Management: Complete event lifecycle from creation to settlement
- QR Code Check-ins: Modern check-in system with QR code validation
- Reward Distribution: Automated reward distribution to attending participants
- Yield Generation: Staked funds generate yield through DeFi protocols while events are active
- Next.js 15.5.4 - React framework with Turbopack
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Flowbite React - UI component library
- Privy - Wallet authentication and management
- Ethers.js - Ethereum interaction library
- Go - REST API server
- Gin - HTTP web framework
- PostgreSQL - Primary database
- pgx - PostgreSQL driver
- Solidity - Smart contract language
- Foundry - Smart contract development framework
- Base Sepolia - Testnet deployment
- ERC-4626 - Vault standard
- Morpho Protocol - Yield generation
Project Lead: Albary - GitHub Team Member: Wijdan - GitHub
- Node.js 18+ - Install Node.js
- Go 1.21+ - Install Go
- PostgreSQL - Install PostgreSQL
- Git - Install Git
-
Clone the repository
git clone <repository-url> cd atfi-project
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envwith your configuration:# Privy Configuration NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id NEXT_PUBLIC_PRIVY_APP_SECRET=your_privy_app_secret # Database Configuration DATABASE_URL=postgres://user:password@localhost/atfi_db?sslmode=disable # Blockchain Configuration NEXT_PUBLIC_BASE_SEPOLIA_RPC=https://base-sepolia-rpc.publicnode.com NEXT_PUBLIC_FACTORY_CONTRACT_ADDRESS=0x...
-
Start development server
npm run dev
The application will be available at http://localhost:3000
-
Navigate to backend directory
cd backend -
Install Go dependencies
go mod download
-
Set up environment variables
cp .env.example .env
Edit
.envwith your configuration:DATABASE_URL=postgres://user:password@localhost/atfi_db?sslmode=disable PORT=8080 RPC_URL=https://base-sepolia-rpc.publicnode.com
-
Start backend server
go run main.go
The API will be available at http://localhost:8080
atfi-project/
βββ src/
β βββ components/ # React components
β β βββ features/ # Feature-specific components
β β βββ layout/ # Layout components
β β βββ ui/ # UI components
β βββ pages/ # Next.js pages
β βββ hooks/ # Custom React hooks
β βββ utils/ # Utility functions
β βββ types/ # TypeScript type definitions
β βββ services/ # API and blockchain services
βββ backend/
β βββ handlers/ # HTTP handlers
β βββ models/ # Data models
β βββ middleware/ # HTTP middleware
β βββ main.go # Application entry point
βββ sc/ # Smart contracts
β βββ src/ # Solidity contracts
β βββ test/ # Contract tests
β βββ foundry.toml # Foundry configuration
βββ README.md
npm run testcd sc
forge testcd backend
go test ./...- Landing Page - Marketing and introduction
- Home Page - Dashboard and event discovery
- Sign-in Page - Authentication with Privy
- Create Event Page - Event creation flow
- Event Management Page - Organizer dashboard
- Event Guests Page - Participant management
- Check-in Page - QR code scanning and validation
- Discover Page - Enhanced event discovery
- Calendar Page - Personal event calendar
-
Feature Development
- Create feature branches from
main - Follow conventional commit messages
- Test locally before pushing
- Create feature branches from
-
Smart Contract Development
- Use Foundry for contract testing
- Deploy to Base Sepolia for testing
- Verify contracts on Etherscan
-
API Development
- Follow RESTful conventions
- Include proper error handling
- Add API documentation
- Privy Authentication: Seamless wallet creation via Gmail
- MetaMask Support: External wallet integration
- Smart Wallet Selection: Automatic wallet choice based on user setup
- FactoryATFi: Creates vault contracts for events
- VaultATFi: Manages event stakes and rewards with yield generation
- ERC-4626 Compliance: Standardized vault interface
- Creation: Organizer creates event with stake requirements
- Registration: Participants stake USDC to join
- Active Period: Funds generate yield through DeFi protocols
- Check-in: QR code validation at event
- Settlement: Rewards distributed to attendees
- Browser DevTools for React debugging
- Privy Dashboard for authentication monitoring
- Network tab for API debugging
- Structured logging with request/response details
- Database connection monitoring
- Health check endpoints available
- Etherscan Base Sepolia for transaction monitoring
- Foundry test output for contract debugging
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Verify
NEXT_PUBLIC_PRIVY_APP_IDis correct - Check Privy dashboard for app configuration
- Ensure proper CORS settings
- Check if MetaMask is installed and unlocked
- Verify network is set to Base Sepolia
- Ensure wallet has sufficient gas fees
- Clear Next.js cache:
rm -rf .next - Reinstall dependencies:
rm -rf node_modules package-lock.json && npm install - Check TypeScript configuration
- Verify PostgreSQL is running
- Check connection string in
.env - Ensure database exists and is accessible
- Check application console logs
- Verify environment variables are set correctly
- Test API endpoints independently
- Review smart contract events and errors
The ATFI platform consists of:
- Frontend: React-based user interface with Web3 integrations
- Backend: RESTful API for data persistence and business logic
- Blockchain: Smart contracts for financial commitments and rewards
- Database: PostgreSQL for user profiles, events, and check-in records
Built with β€οΈ using Next.js, Go, Ethereum, and PostgreSQL