The next-gen platform for decentralized NFT trading.
Built with Next.js, Solidity, Foundry, and rindexer.
Neon Marketplace is a full-stack decentralized application (DApp) that allows users to mint, list, and buy NFTs with a seamless user experience. Unlike traditional marketplaces, this project integrates a custom indexer for real-time data retrieval and utilizes a modern Web3 stack for high performance.
The platform features specific collections like Ninja NFT, demonstrating support for various ERC-721 token standards.
- π NFT Trading: Buy and sell NFTs securely using smart contracts.
- β‘ Real-time Indexing: Powered by
rindexerto fetch off-chain events instantly. - π€ AI Chatbot: Interactive assistant for market queries, NFT listing, and security checks (supports Chinese/English).
- π AI Market Analyst: Real-time AI-powered market analysis with price trends and insights.
- π¨ Custom Collections: Support for specific collections like Ninja NFT.
- π Wallet Integration: Seamless connection via RainbowKit & Wagmi.
- π± Responsive Design: Modern UI built with Tailwind CSS.
- π‘οΈ Compliance Ready: Integrated compliance checks for safer transactions.
The platform bridges on-chain integrity with off-chain performance using a custom indexing layer and secure API routes.
graph TD
subgraph Client Side ["π₯οΈ Client Side (Next.js 15)"]
UI[User Interface]
Hooks[Wagmi / Viem Hooks]
Query[GraphQL / API Query]
end
subgraph Server Side ["βοΈ Server Side / Backend"]
NextAPI[Next.js API Routes]
Circle[Circle Compliance API]
end
subgraph Data Layer ["πΎ Data Indexing Layer"]
Indexer[rindexer]
DB[(PostgreSQL)]
end
subgraph Blockchain ["βοΈ Blockchain (Sepolia)"]
Marketplace[Marketplace Contract]
NFT[NFT Collection Contract]
end
%% User Interaction
User((User)) -->|Interacts| UI
%% Frontend Logic
UI -->|1. Connect Wallet| Hooks
UI -->|2. Compliance Check| NextAPI
UI -->|4. Read Data| Query
%% Backend Logic
NextAPI -->|3. Verify Address| Circle
Circle -- Responds --> NextAPI
%% Blockchain Interaction
Hooks -->|5. List / Buy / Cancel| Marketplace
Marketplace -->|Internal Call| NFT
%% Indexing Flow
Marketplace -.->|Emits Events| Indexer
NFT -.->|Emits Events| Indexer
Indexer -->|Updates| DB
%% Data Retrieval
Query -->|GraphQL Fetch| Indexer
Indexer -.->|Reads| DB
classDef client fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
classDef server fill:#fff3e0,stroke:#e65100,stroke-width:2px;
classDef blockchain fill:#f3e5f5,stroke:#4a148c,stroke-width:2px;
classDef data fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;
class UI,Hooks,Query client;
class NextAPI,Circle server;
class Marketplace,NFT blockchain;
class Indexer,DB data;
This flow demonstrates the integration of Compliance Checks before interacting with the blockchain, followed by Asynchronous Indexing for UI updates.
sequenceDiagram
actor User
participant FE as Frontend (Next.js)
participant API as API Route
participant Circle as Circle Compliance API
participant Chain as Blockchain
participant Indexer as rindexer
participant DB as PostgreSQL
User->>FE: Click "List NFT"
%% Compliance Check
rect rgb(255, 240, 240)
Note over FE, Circle: π‘οΈ Security Check
FE->>API: POST /api/compliance (address)
API->>Circle: Check Address (Screening)
Circle-->>API: Result: Approved/Blocked
API-->>FE: { isApproved: true }
end
alt If Approved
FE->>Chain: Send Transaction (List Item)
Chain-->>FE: Transaction Hash
par Async Indexing
Chain->>Chain: Emit "ItemListed" Event
Indexer->>Chain: Listen for Events
Indexer->>DB: Insert/Update Listing Data
and UI Feedback
FE-->>User: Show "Transaction Submitted"
end
Note over FE, DB: β‘ Real-time Update
FE->>Indexer: GraphQL Query (Latest Listings)
Indexer-->>FE: Return Updated Data
FE-->>User: Update UI List
else If Blocked
FE-->>User: Show "Compliance Error"
end
An interactive assistant accessible via the floating action button (FAB) in the bottom-right corner.
Capabilities:
- π¬ Natural Language Interaction: Ask about market trends, list NFTs, or check wallet security
- π Bilingual Support: Automatically detects and responds in Chinese or English
- π Language Toggle: Manual switch between languages in the header
- πΎ Chat History: Persisted locally for seamless experience
- π Wallet Validation: Requires wallet connection for listing actions
- π‘οΈ Real Compliance Check: Security checks call the real Circle API (even in mock mode)
Quick Actions:
| Action | Chinese | English |
|---|---|---|
| Market Query | ζ₯θ©’εΉζ Ό | Check Prices |
| List NFT | εΉ«ζδΈζΆ | List NFT |
| Security Check | ζͺ’ζ₯ 0x... | Check 0x... |
Real-time market analysis powered by Gemini AI, displaying insights on recent trades and price trends.
For development and demos, set MOCK_AI=true to use predefined responses without consuming Gemini API quota.
Note: Even in mock mode, the compliance check still calls the real Circle API to provide accurate security results.
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Web3 Libraries: Wagmi, Viem, RainbowKit
- AI Model: Google Gemini (
gemini-2.5-flash-lite) - API Routes: Next.js API Routes
- Compliance: Circle API (Address Screening)
- Framework: Foundry
- Language: Solidity
- Testing: Forge (Unit & Fuzz testing)
- Indexer: rindexer (Rust-based EVM indexer)
- Container: Docker
Follow these steps to set up the project locally.
git clone [https://github.com/LazyBoneJC/Neon-Marketplace.git](https://github.com/LazyBoneJC/Neon-Marketplace.git)
cd Neon-MarketplaceNavigate to the foundry directory, install dependencies, and start the local blockchain.
cd foundry
forge install
forge build
# Start local blockchain (Anvil)
anvilIn a new terminal window, deploy the contracts:
# Deploy to local Anvil chain
forge script script/DeployMarketplace.s.sol --rpc-url [http://127.0.0.1:8545](http://127.0.0.1:8545) --broadcast --private-key <YOUR_ANVIL_PRIVATE_KEY>This project uses rindexer to index blockchain events. Ensure Docker is running.
cd marketplaceIndexer
docker-compose up -dReturn to the root directory and install dependencies.
# Install dependencies
pnpm install
# Start the development server
pnpm devOpen http://localhost:3000 with your browser to see the result.
βββ foundry/ # Smart contracts (Solidity)
β βββ src/ # Contract source code (NftMarketplace, NinjaNft, CakeNft)
β βββ script/ # Deployment scripts
β βββ test/ # Foundry tests
βββ marketplaceIndexer/ # Indexer configuration and Docker setup
βββ src/ # Frontend source code (Next.js)
β βββ app/ # App Router pages
β β βββ api/ # API Routes (chat, ai-analyst, compliance)
β βββ components/ # React components
β β βββ AI/ # AI components (AIChatbot, TransactionPreview)
β βββ hooks/ # Custom hooks (useChatbot, useTransactionPrecheck)
β βββ utils/ # Utilities (rindexer-client, ai-service)
β βββ ...
βββ public/ # Static assetsCreate a .env.local file in the root directory:
# AI Configuration
GEMINI_API_KEY=your_gemini_api_key # Required for real AI responses
MOCK_AI=true # Set to 'true' for mock mode (no Gemini API costs)
# Rindexer (Indexer)
RINDEXER_URL=https://your-indexer-url/graphql
NEXT_PUBLIC_RINDEXER_URL=https://your-indexer-url/graphql
# Circle Compliance API
CIRCLE_API_KEY=your_circle_api_key
ENABLE_COMPLIANCE_CHECK=true # Set to 'true' to enable address screening
# WalletConnect
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_idTo run the smart contract tests:
cd foundry
forge testThis project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by LazyBoneJC