Social NFT Marketplace trên Base Sepolia - Chia sẻ khoảnh khắc của bạn dưới dạng NFT.
Metabased là một nền tảng mạng xã hội phi tập trung cho phép người dùng chia sẻ bài đăng, biến chúng thành NFT và giao dịch trên marketplace. Xây dựng trên Base Sepolia testnet với Dynamic Labs authentication và Supabase PostgreSQL.
- Đăng nhập bằng ví crypto (Dynamic Labs)
- Đăng bài và chia sẻ nội dung
- Mint NFT từ bài đăng
- Marketplace mua/bán NFT
- Hệ thống follow, like, comment
- Tin nhắn giữa người dùng
- Admin dashboard quản lý hệ thống
- Frontend: Next.js 14 (App Router), React 18, TypeScript
- Styling: Tailwind CSS, Framer Motion
- Authentication: Dynamic Labs (Wallet-based)
- Database: Supabase PostgreSQL
- Blockchain: Base Sepolia Testnet
- Smart Contracts: Solidity (NFT721, NFT1155, Marketplace)
- Deployment: Vercel
metabased/
├── contracts/ # Smart contracts
│ ├── marketplace.sol
│ ├── nft721.sol
│ └── nft1155.sol
├── database/ # SQL schemas
│ └── postgresupabase.sql # Supabase PostgreSQL
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # Kiến trúc hệ thống
│ ├── SUPABASE_SETUP.md # Hướng dẫn setup Supabase
│ └── README.md # File này
├── src/ # Source code
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # Auth routes (login, logout)
│ │ ├── (public)/ # Public routes
│ │ ├── (user)/ # Protected user routes
│ │ ├── (admin)/ # Admin routes
│ │ └── api/ # API Routes
│ ├── components/ # React components
│ ├── lib/ # Utilities & configs
│ ├── providers/ # Context providers
│ ├── types/ # TypeScript types
│ └── docker-compose.yml # Docker config
└── .env.example # Environment template
- Frontend: Next.js 14 App Router
- Backend: Next.js API Routes
- Database: Supabase PostgreSQL
- Blockchain: Base Sepolia
Flow: Client -> API Routes -> Supabase -> Smart Contracts
git clone <repository-url>
cd metabasedcd src
npm installSupabase la bat buoc tu hien tai. Xem hướng dẫn chi tiết tại docs/SUPABASE_SETUP.md
# Development
npm run dev
# Production build
npm run build
npm startTruy cập: http://localhost:3000
- Sử dụng TypeScript cho type safety
- Component naming: PascalCase
- File naming: kebab-case hoặc PascalCase (components)
- Commit messages: Conventional Commits
Khi thay đổi database schema:
- Cập nhật file SQL trong
database/ - Chay migration tren Supabase
- Test ky
- Deploy production sau khi xac nhan data integrity
POST /api/auth/verify
// Verify JWT token từ Dynamic LabsGET /api/users/profile?wallet=0x...
POST /api/users/profile
PUT /api/users/profileGET /api/posts
POST /api/posts
GET /api/posts/[postId]
DELETE /api/posts/[postId]Xem đầy đủ tại ARCHITECTURE.md
- Push code lên GitHub
- Connect repository với Vercel
- Cấu hình environment variables
- Deploy
# Hoặc dùng Vercel CLI
vercel --prodCần cấu hình đầy đủ các biến trong .env.example tại Vercel Dashboard.
# Run tests
npm test
# E2E tests
npm run test:e2e- Kiểm tra
.env.localđã đúng chưa - Check Supabase project status
- Verify
NEXT_PUBLIC_DYNAMIC_ENV_IDđúng - Check JWKS URL
- Kiểm tra network (Base Sepolia)
- Xóa
.next/folder - Clear node_modules và reinstall
- Fork repository
- Tạo feature branch
- Commit changes
- Push to branch
- Tạo Pull Request
MIT License
- GitHub Issues cho bug reports
- Next.js team
- Dynamic Labs
- Supabase
- Base (Coinbase L2)