Technical overview of SonicClout's frontend architecture with Sonic integration
SonicClout's frontend is built with modern web technologies, focusing on performance, user experience, and seamless integration with the Sonic blockchain. This documentation outlines the technical architecture, key components, and design patterns used in the application.
Technology Stack
The SonicClout frontend uses:
Next.js 14 - React framework with app router for routing and server components
TypeScript - For type safety and better developer experience
TailwindCSS - For styling and responsive design
React Context API - For state management
Sonic SDK - For Sonic blockchain interaction
Solana Web3.js - For base Solana compatibility
Wallet Adapter - Modified for Sonic wallet connections
// lib/sonic.ts
import { SonicConnection } from '@sonic-game/web3.js';
import { createSonicTransaction } from '@sonic-game/transactions';
export function initializeSonicConnection(endpoint: string): SonicConnection {
return new SonicConnection(endpoint, {
commitment: 'confirmed',
confirmTransactionInitialTimeout: 60000,
});
}
export async function executeSonicTransaction(
connection: SonicConnection,
transaction: Transaction,
signers: Keypair[]
): Promise<string> {
const sonicTx = await createSonicTransaction(transaction);
// Process on Sonic chain...
}
// lib/metaplex.ts
import { Metaplex } from '@metaplex-foundation/js';
import { sonicCluster } from '@sonic-game/web3.js';
export function createMetaplex(connection: Connection, wallet: Wallet): Metaplex {
return Metaplex.make(connection)
.use(walletAdapterIdentity(wallet))
.use(sonicCluster());
}
# Clone the repository
git clone https://github.com/sonicclout/frontend.git
cd frontend
# Install dependencies
yarn install
# Start development server
yarn dev