Project Structure
Understanding the inkathon approach
Monorepo Architecture
Projects set up with inkathon use a monorepo structure splitting your frontend and smart contracts into separate workspaces.
This provides clear separation between different parts of the application while maintaining easy cross-package imports, shared configurations, and a single source of truth for contract metadata.
package.json
package.json
package.json
Never used a monorepo before?
Don't be afraid, it's really just a fancy term for having nested folders with multiple
package.json
files. The package manager (Bun) takes care of installing the correct dependencies
for each workspace and executing scripts where you need them.
Why Monorepo?
Workspaces
/
– Root Directory
- Configuration Files: Configs for VSCode, TypeScript, Biome, Prettier
- Scripts: Global commands that orchestrate across workspaces
- Hosting: Deployment configs for self-hosting and Vercel
- AI Rules: Tailored development rules for Cursor and Claude
/contracts
– ink! Smart Contracts
- Source Code: Rust contract implementations
- Build Artifacts: Compiled contracts and metadata
- Deployments: Multichain deployment addresses
- Tooling: Advanced build & deployment scripts using Pop CLI,
cargo contract
, andink-node
- Type Generation: Generated Papi type descriptors for contracts & chains
/frontend
– Next.js Frontend
- Styling: Tailwind CSS v4 & shadcn/ui components
- React Components: Reusable Web3 components for wallet connection, chain selection, and contract interaction, and more
- Web3 Integration: Type-safe multichain wallet connection and contract interaction with Papi and ReactiveDOT
Available Commands
Execute from the root directory only:
# Development
bun run dev # Start frontend development server
bun run node # Start local ink-node
bun run dev-and-node # Run both frontend and node concurrently
bun run codegen # Generate TypeScript types from contracts
bun run build # Build frontend (includes codegen)
bun run start # Start production frontend server
# Code Quality
bun run lint # Run linting checks across all workspaces
bun run lint:fix # Auto-fix linting issues
bun run typecheck # TypeScript checking across all workspaces
# Maintenance
bun run clean # Remove build artifacts from all workspaces
bun run clean-install # Remove node_modules and reinstall dependencies
bun run update # Update dependencies interactively
Find all available commands in the command cheat sheet.