A Next.js-based frontend application for the Ant Party blockchain project, featuring Web3 integration, multi-language support, and a comprehensive user interface for managing ant colonies, staking, NFTs, and more.
- Web3 Integration: Built with Wagmi and RainbowKit for seamless blockchain wallet connections
- Multi-language Support: Internationalization (i18n) with support for:
- English
- Russian (Русский)
- Vietnamese (Tiếng Việt)
- Traditional Chinese (繁體中文)
- Simplified Chinese (简体中文)
- Core Functionality:
- Ant War gameplay
- Personal Center with colony management
- Staking system
- NFT management and minting
- Power Foundry
- Revenue and grant records
- Upgrade system
- Wallet integration and management
- Next.js 15.1.2 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Wagmi 2.14.6 - React Hooks for Ethereum
- RainbowKit 2.2.1 - Wallet connection UI
- Viem 2.22.2 - TypeScript Ethereum library
- Web3 4.16.0 - Ethereum JavaScript API
- Tailwind CSS 3.4.1 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Icon library
- React Hot Toast - Toast notifications
- TanStack React Query 5.62.15 - Data fetching and caching
- React Context API - Global state management
- next-intl 3.26.3 - Internationalization
- BigNumber.js - Arbitrary precision arithmetic
- Moment.js - Date manipulation
- React Number Format - Number formatting
-
Clone the repository
git clone <repository-url> cd ant_party_frontend
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables Create a
.env.localfile in the root directory with the following variables:# Add your environment variables here # Example: # NEXT_PUBLIC_CHAIN_ID=56 # NEXT_PUBLIC_RPC_URL=your_rpc_url
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
npm run dev- Start the development servernpm run build- Build the application for productionnpm run start- Start the production servernpm run lint- Run ESLint to check for code issues
ant_party_frontend/
├── app/ # Next.js App Router pages
│ └── [locale]/ # Internationalized routes
│ ├── ant-war/ # Ant War game page
│ ├── grant-record/ # Grant record page
│ ├── personal-center/ # User dashboard
│ ├── power-foundry/ # Power foundry page
│ ├── revenue-record/ # Revenue tracking
│ ├── staking/ # Staking interface
│ └── upgrade/ # Upgrade system
├── components/ # React components
│ ├── common/ # Shared components (Header, Footer, Buttons)
│ ├── ui/ # UI component library
│ └── [Dialogs] # Various dialog components
├── context/ # React Context providers
├── hooks/ # Custom React hooks
│ ├── useContracts.ts # Smart contract interactions
│ ├── useHooks.ts # Custom business logic hooks
│ └── useWeb3.ts # Web3 wallet hooks
├── i18n/ # Internationalization configuration
├── lib/ # Utility libraries
│ ├── abis/ # Smart contract ABIs
│ ├── config.ts # Application configuration
│ └── utils.ts # Helper functions
├── messages/ # Translation files
│ ├── en.json
│ ├── ru.json
│ ├── vi.json
│ ├── zh-CN.json
│ └── zh-TW.json
└── public/ # Static assets
└── images/ # Image resources
The application supports multiple blockchain networks:
- BSC Mainnet (Chain ID: 56) - Production network
- BSC Testnet (Chain ID: 97) - Testing network
- Ethereum Mainnet (Chain ID: 1) - Alternative network
Contract addresses and configurations are managed in lib/config.ts. The application integrates with:
- AntParty Contract - Main protocol contract
- NFT Factory - NFT minting and management
- Vesting Contract - Token vesting functionality
- Distributor Contract - Reward distribution
- Meme Token - Native token contract
- USDT Token - Stablecoin integration
The application uses next-intl for internationalization. Supported languages are configured in the routing middleware. To add a new language:
- Add translation file in
messages/[locale].json - Update the language dropdown in the main page
- Configure routing in
i18n/routing.ts
The project uses Tailwind CSS for styling. Configuration is in tailwind.config.ts. Custom styles and global CSS are in app/[locale]/globals.css.
- Follow TypeScript best practices
- Use functional components with hooks
- Maintain component modularity
- Follow the existing file structure
- Keep components focused and reusable
- Use TypeScript interfaces for props
- Implement proper error handling
- Add loading states for async operations
- Always handle wallet connection states
- Implement proper error handling for transactions
- Use React Query for data fetching and caching
- Follow Wagmi best practices for contract interactions
This project is private and proprietary.
This is a private project. For contributions, please contact the project maintainers.
For issues or questions, please contact the development team.
Note: This is a frontend prototype for the Ant Party project. Ensure all environment variables and contract addresses are properly configured before deployment.