Monorepo Structure

Aqua Stark follows a monorepo architecture, streamlining development across multiple components.

πŸ“Œ Structure

  • Frontend – Next.js-based interface for the game and marketplace.

  • Backend – Node.js server handling API calls and Starknet interactions.

  • Smart Contracts – Cairo-based contracts deployed on Starknet.

  • Shared Utilities – Reusable libraries for blockchain integration and game mechanics.

/aquarium-game
│── /backend # Backend with Node.js + Express
β”‚ β”œβ”€β”€ /src
β”‚ β”‚ β”œβ”€β”€ /controllers # Business logic (management of users, aquariums, marketplace)
β”‚ β”‚ β”œβ”€β”€ /models # Database models (Fish, Users, Transactions)
β”‚ β”‚ β”œβ”€β”€ /routes # API routes (REST Endpoints)
β”‚ β”‚ β”œβ”€β”€ /services # Connection to blockchain and contract logic
β”‚ β”‚ β”œβ”€β”€ /utils # Helpers and auxiliary functions
β”‚ β”‚ β”œβ”€β”€ app.ts # Server configuration Express
β”‚ β”œβ”€β”€ package.json # Backend dependencies
β”‚ β”œβ”€β”€ tsconfig.json # TypeScript configuration
β”‚
│── /frontend # Frontend with React + Next.js
β”‚ β”œβ”€β”€ /public # Images, fonts, icons
β”‚ β”œβ”€β”€ /src
β”‚ β”‚ β”œβ”€β”€ /app # Next.js main pages
β”‚ β”‚ β”œβ”€β”€ /components # Reusable components (Aquarium, PezCard, Marketplace, etc.)
β”‚ β”‚ β”œβ”€β”€ /context # Global state with React Context
β”‚ β”‚ β”œβ”€β”€ /hooks # Custom hooks for logic specific
β”‚ β”‚ β”œβ”€β”€ /services # Connection to backend and blockchain
β”‚ β”‚ β”œβ”€β”€ /styles # Style files (TailwindCSS)
β”‚ β”‚ β”œβ”€β”€ /utils # Helper functions
β”‚ β”‚ β”œβ”€β”€ /assets # Sprites, images, decorations
β”‚ β”œβ”€β”€ next.config.js # Next.js configuration
β”‚ β”œβ”€β”€ package.json # Frontend dependencies
β”‚ β”œβ”€β”€ tsconfig.json # TypeScript configuration
β”‚
│── /smart-contracts # Smart contracts in Cairo
β”‚ β”œβ”€β”€ /contracts # Contracts code (Fish, Marketplace, Evolution)
β”‚ β”œβ”€β”€ /tests # Testing contracts in Cairo
β”‚ β”œβ”€β”€ compile.sh # Script to compile the contracts
β”‚ β”œβ”€β”€ deploy.sh # Script to deploy to StarkNet
β”‚ β”œβ”€β”€ README.md # Documentation about smart contracts
β”‚
│── .github # CI/CD configuration (optional)
│── .env # Environment variables
│── README.md # General project documentation

πŸ”₯ Why Use a Monorepo?

  • Unified Codebase – Easier management of interdependent components.

  • Improved Collaboration – Developers work within a centralized structure.

  • Consistent Dependencies – Reduces version conflicts across services.

  • Faster Deployment – Automated CI/CD pipelines improve efficiency.

πŸ˜‚ Fish Joke: Why don’t fish like basketball?

  • Because they’re afraid of the net!

Last updated