- AI Chat Interface: A clean, ChatGPT-like interface for generating content (streaming simulated).
- Mint as NFT: Select specific message exchanges and mint them as verified assets on-chain.
- Wallet Integration: Seamless connection with MetaMask/RainbowKit (supports Sepolia/Ethereum).
- Asset Management: "My Assets" dashboard to view, price, and list/unlist minted conversations.
- Decentralized Marketplace: Buy and sell prompt chains using DataToken (DTK).
- Responsive Design: Fully optimized layouts for both Desktop and Mobile views.
- Framework: React 19 + TypeScript + Vite
- Styling: Tailwind CSS v4 + Framer Motion (Animations)
- State Management: Jotai
- Web3 Integration: Wagmi + Viem + RainbowKit
- Data Fetching: TanStack Query + Axios
- Routing: React Router DOM v7
- Node.js (v18 or higher recommended)
- npm or yarn
- A Web3 wallet (e.g., MetaMask) installed in your browser.
-
Clone the repository:
git clone https://github.com/psyq55262227/bc-final.git cd chainchat-frontend -
Install dependencies:
npm install # or yarn install -
Start the development server:
npm run dev # or yarn dev -
Open in Browser: Navigate to
http://localhost:5173to view the application.
To facilitate testing without requiring the full backend/blockchain infrastructure to be locally deployed, this frontend is currently configured with Mock Mode enabled for API calls, while still allowing real Wallet connectivity for UI states.
Recommended Testing Flow:
- Connect Wallet: Click the "Connect Wallet" button in the top right. You can use any test wallet.
- Chat:
- Navigate to "Chat".
- Type
RWAto trigger a specific demo response, or type anything else for a generic response.
- Mint:
- Click the checkbox circle next to a message to select it.
- Click "Mint Selected".
- Note: In Mock mode, this simulates the IPFS upload and returns a success toast.
- Manage Assets:
- Go to "Assets" (or "Rewards" on mobile).
- You will see your minted items. Click the Settings (Gear) icon to set a price.
- Click List to put the item on the market.
- Marketplace:
- Go to "Marketplace".
- You will see listed items.
- Note: Smart contract interactions (Buy/List) require a Web3 provider. If you are not on the correct testnet, the UI handles the error gracefully or logs to console.
src/
├── api/ # API integration (includes mock.ts for demo)
├── components/ # Reusable UI components
│ ├── chat/ # Chat interface specific components
│ ├── common/ # Buttons, Modals, Wallet connect
│ └── layout/ # Desktop vs Mobile layout wrappers
├── constants/ # Contract addresses and ABIs
├── hooks/ # Custom React hooks (useWallet, etc.)
├── pages/ # Main route pages (Chat, Marketplace, History)
├── state/ # Global state management (Jotai atoms)
└── types/ # TypeScript interfaces