This is a full-stack Aptos dApp template featuring a message board application with custom indexers. It serves as an alternative to the official CAD (create-aptos-dapp) template with opinionated architecture choices.
- Location:
move/contracts/message-board/ - Main contract:
sources/message_board.move - Test command:
cd move/contracts/message-board && npm test - Deploy command:
cd move/contracts/message-board && ./sh_scripts/deploy.sh - Format command:
cd move/contracts/message-board && ./sh_scripts/fmt.sh - Package name:
message-board - Contract address: Stored in
contract_address.txt
- Framework: Next.js 14.2.3 with TypeScript
- UI Library: Radix UI components with Tailwind CSS
- Key dependencies: @aptos-labs/ts-sdk, @aptos-labs/wallet-adapter-react
- Database: Neon PostgreSQL
- Commands:
- Dev:
npm run dev - Build:
npm run build - Lint:
npm run lint
- Dev:
- Key components: Message board, wallet connection, analytics dashboard
- Purpose: Quick scripts to interact with the contract
- Commands:
npm run <script-name> - Available scripts: create_message, get_message, update_message, yolo
- Framework: Uses aptos-indexer-processor-sdk
- Database: PostgreSQL with Diesel ORM
- Migrations: Located in
src/db_migrations/migrations/ - Build command:
cargo build - Run command:
cargo run - Config files:
config.yaml,local.config.yaml,cloud.config.yaml
- Purpose: Simpler alternative to Rust indexer for prototyping
- Database: SQLite (
indexer.db) - Commands:
npm start
- Navigate to
move/contracts/message-board/ - Edit contract in
sources/ - Test with
./sh_scripts/test.sh - Format with
./sh_scripts/fmt.sh - Deploy with
./sh_scripts/deploy.sh
- Navigate to
next-app/ - Start dev server:
npm run dev - Build for production:
npm run build - Lint code:
npm run lint
- Rust: Use
rust-indexer/for production - TypeScript: Use
ts-indexer/for rapid prototyping
- Contract ABI: Generated in
next-app/src/lib/abi/message_board_abi.ts - Database models:
- Frontend:
next-app/src/lib/type/ - Rust indexer:
rust-indexer/src/db_models/
- Frontend:
- Utils:
next-app/src/lib/utils.ts
Key tables:
messages: Stores message board messagesuser_stats: User analytics and statisticsprocessor_status: Indexer processing statusledger_infos: Blockchain ledger information
- Move contracts:
cd move/contracts/message-board && npm test - Frontend: Uses Next.js built-in testing with
npm run lint - Integration tests: Available in
move/tests/
- Move.toml: Contract configuration and dependencies
- next.config.mjs: Next.js configuration
- Cargo.toml: Rust indexer dependencies
- Config files: Various YAML configs for different environments
Pre-configured for GitHub Codespaces with all dependencies (Rust, Docker, Google Cloud CLI) ready. Install Aptos CLI with:
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3- Contract and frontend: English and Chinese versions available
- Custom indexer: English and Chinese versions available
- GitHub Codespace development: English and Chinese versions available
- Start with contract development in
move/ - Generate ABIs and update frontend
- Develop frontend features in
next-app/ - Set up indexer (TypeScript for prototyping, Rust for production)
- Test end-to-end functionality
- Aptos SDK: @aptos-labs/ts-sdk
- Wallet Adapter: @aptos-labs/wallet-adapter-react
- UI Framework: Radix UI + Tailwind CSS
- State Management: @tanstack/react-query
- Database: Neon PostgreSQL (frontend), PostgreSQL/SQLite (indexers)