TxT project
文章目录
- 前言
- TxT project introduction ~
- TxT: A Next.js-Based Blockchain Data Analytics and Social Platform
- 📑 Table of Contents
- Introduction
- Tech Stack
- Core Features
- 1. Data Analytics & Monitoring
- 2. Membership System
- 3. DeFi Staking
- 4. Social Features
- 5. Gamification
- Web3 Wallet Integration
- Platform Highlights
- Conclusion
前言
TxT project introduction ~
TxT: A Next.js-Based Blockchain Data Analytics and Social Platform
TxT is an integrated platform that combines blockchain data analytics + social networking + DeFi.
It targets crypto investors and traders, offering data tracking tools, community interaction, and investment services.
Tech stack: Next.js + TypeScript + Vite + UnoCSS + Web3
📑 Table of Contents
- Introduction
- Tech Stack
- Core Features
- Data Analytics & Monitoring
- Membership System
- DeFi Staking
- Social Features
- Gamification
- Web3 Wallet Integration
- Platform Highlights
- Conclusion
Introduction
TxT is designed as an all-in-one crypto investment platform that includes:
- On-chain data analytics (wallet tracking, candlestick charts, contract monitoring, price alerts)
- Membership tiers (two-level system with tiered access permissions)
- DeFi staking (dual-pool staking + MANNA token staking)
- Social networking (community groups, AI Q&A, sharing system)
- Gamification (points, red packets, gift cards, daily check-in rewards)
- Web3 integration (MetaMask / WalletConnect with BSC contracts)
Tech Stack
- Next.js: SSR + SSG, SEO optimized
- TypeScript: type safety, maintainability
- Vite: fast development build tool
- UnoCSS: atomic CSS with flexibility
- ethers.js / Web3.js: blockchain wallet and contract interaction
- WebSocket: real-time push notifications & live market data
Core Features
1. Data Analytics & Monitoring
- Track whale wallet activities
- Professional candlestick charts
- Smart contract monitoring & event alerts
Code Example: Candlestick Chart Component
// components/Chart.tsx
"use client";
import { createChart } from "lightweight-charts";
import { useEffect, useRef } from "react";export default function Chart({ data }: { data: any[] }) {const chartRef = useRef<HTMLDivElement>(null);useEffect(() => {if (!chartRef.current) return;const chart = createChart(chartRef.current, { width: 600, height: 300 });const candleSeries = chart.addCandlestickSeries();candleSeries.setData(data);}, [data]);return <div ref={chartRef} className="w-full h-80" />;
}
2. Membership System
- Operator (100 USDT)
- VIP Member (50 USDT)
- Different data access levels + referral structure
Code Example: Buy Membership via Smart Contract
import { ethers } from "ethers";
import membershipABI from "@/abis/membership.json";export async function buyMembership(level: number) {if (!window.ethereum) throw new Error("Wallet not found");const provider = new ethers.BrowserProvider(window.ethereum);const signer = await provider.getSigner();const contract = new ethers.Contract("0xMembershipContractAddress",membershipABI,signer);const price = level === 1 ? ethers.parseUnits("50", 6) : ethers.parseUnits("100", 6);const tx = await contract.buy(level, { value: price });return tx.wait();
}
3. DeFi Staking
-
Dual staking pools:
- Pool A: fixed rewards (30-day cycle)
- Pool B: flexible rewards
-
MANNA token staking
-
Profit-sharing distribution
Code Example: Stake MANNA Tokens
import stakingABI from "@/abis/staking.json";export async function stakeManna(amount: string) {const provider = new ethers.BrowserProvider(window.ethereum);const signer = await provider.getSigner();const contract = new ethers.Contract("0xStakingContract", stakingABI, signer);const tx = await contract.stake(ethers.parseUnits(amount, 18) // MANNA token uses 18 decimals);return tx.wait();
}
4. Social Features
- Community groups & friend system
- AI-powered Q&A assistant
- Market insights sharing + like interactions
Code Example: Post a Status Update
// app/api/post/route.ts
import { NextRequest, NextResponse } from "next/server";
import { db } from "@/lib/db";export async function POST(req: NextRequest) {const body = await req.json();const post = await db.post.create({data: { content: body.content, authorId: body.userId },});return NextResponse.json(post);
}
5. Gamification
- Points system (reward user actions)
- Red packet & gift cards
- Daily check-in rewards
Code Example: Daily Check-in
// app/api/signin/route.ts
import { db } from "@/lib/db";
import { NextRequest, NextResponse } from "next/server";export async function POST(req: NextRequest) {const { userId } = await req.json();const today = new Date().toDateString();const record = await db.signInRecord.findFirst({where: { userId, date: today },});if (record) return NextResponse.json({ message: "Already signed in" });await db.signInRecord.create({data: { userId, date: today, points: 10 },});return NextResponse.json({ success: true, points: 10 });
}
Web3 Wallet Integration
Supports MetaMask and WalletConnect on BSC chain.
Code Example: Connect Wallet
"use client";
import { useEffect, useState } from "react";
import { ethers } from "ethers";export default function WalletConnectBtn() {const [address, setAddress] = useState<string>("");async function connect() {if (!window.ethereum) return alert("Please install MetaMask first");const provider = new ethers.BrowserProvider(window.ethereum);const accounts = await provider.send("eth_requestAccounts", []);setAddress(accounts[0]);}return (<buttononClick={connect}className="px-4 py-2 bg-blue-500 text-white rounded-lg shadow">{address ? `Connected: ${address.slice(0, 6)}...` : "Connect Wallet"}</button>);
}
Platform Highlights
- Responsive H5 design: mobile & desktop
- Multi-language support: i18next / next-intl
- Performance optimization: lazy loading, code splitting
- Real-time data: WebSocket live updates
Conclusion
TxT leverages a modern Next.js front-end architecture combined with Web3 contract interactions to provide an ecosystem that merges:
- Blockchain analytics
- Community networking
- DeFi wealth management
- Gamified user engagement
TxT is not just an investment tool — it’s a social-powered crypto investment hub.