Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

345 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ Mark Vinicius Cherry Tycoon

A decentralized farming simulation game built on the Internet Computer Protocol (ICP). Manage your cherry orchards, expand your farm, and become a cherry tycoon!

Status Platform Frontend Backend

๐ŸŽฎ Features

Core Gameplay

  • ๐Ÿšœ Farm Management - Manage multiple parcels across 16 Polish provinces
  • ๐ŸŒณ Tree Lifecycle - Realistic 0-40 year tree progression system
  • ๐Ÿ’ Harvest System - Dynamic yield calculation based on soil, water, and tree age
  • โ™ป๏ธ Organic Farming - 2-season organic conversion with 40% price premium
  • ๐Ÿ’ฐ Market Trading - Sell cherries via retail or wholesale channels
  • ๐Ÿ“ˆ Progression System - Level up through experience points

Advanced Features

  • Tree Age Modifier - Trees produce different yields at different ages
  • Soil Chemistry - pH levels, fertility, and soil types affect yields
  • Water Management - Irrigation system with depletion over seasons
  • Infrastructure - Upgradeable facilities (warehouses, cold storage, tractors)
  • Seasonal Costs - Realistic operating expenses each season
  • Tree Density Limits - Maximum 400 trees per hectare

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  React Frontend โ”‚ (Vite + TypeScript + Tailwind)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ ICP SDK  โ”‚ (@dfinity/agent)
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Motoko Backend  โ”‚ (Internet Computer Canister)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Stable  โ”‚
    โ”‚ Storage  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • DFX (Internet Computer SDK)
  • Git

See Environment Setup Guide for detailed installation instructions.

Installation

  1. Clone the repository

    git clone https://github.com/YOUR_USERNAME/mark-vinicius-cherry-tycoon.git
    cd mark-vinicius-cherry-tycoon
  2. Install frontend dependencies

    cd frontend
    npm install
  3. Start local ICP replica (in WSL/Linux)

    dfx start --background --clean
  4. Deploy backend canister

    dfx deploy backend
  5. Start frontend dev server

    cd frontend
    npm run dev
  6. Open browser

    http://localhost:5173
    

๐Ÿ“ Project Structure

mark-vinicius-cherry-tycoon/
โ”œโ”€โ”€ backend/                 # Motoko backend
โ”‚   โ”œโ”€โ”€ main.mo             # Playground entrypoint (classic actor, dfx 0.24.3)
โ”‚   โ”œโ”€โ”€ main_mainnet.mo     # Mainnet entrypoint (EOP persistent actor, dfx 0.30+)
โ”‚   โ”œโ”€โ”€ types.mo            # Type definitions
โ”‚   โ”œโ”€โ”€ game_logic.mo       # Game formulas
โ”œโ”€โ”€ frontend/               # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/         # UI pages
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/         # Custom hooks
โ”‚   โ”‚   โ”œโ”€โ”€ lib/           # Utilities
โ”‚   โ”‚   โ”œโ”€โ”€ types/         # TypeScript types
โ”‚   โ”‚   โ””โ”€โ”€ providers/     # Context providers
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ docs/                   # Documentation
โ”œโ”€โ”€ dfx.json               # ICP configuration
โ”œโ”€โ”€ test-backend.ps1       # Test script (20 tests)
โ””โ”€โ”€ README.md

๐ŸŽฏ Game Mechanics

Starting Conditions

  • Cash: 50,000 PLN
  • Parcel: 0.5 hectares in Opole Province
  • Trees: 50 cherry trees (5 years old)
  • Soil: Sandy-clay (optimal)

Pricing

  • Tree Planting: 50 PLN per tree
  • Watering: 200 PLN per action
  • New Parcel: 60,000 PLN per hectare
  • Cherry Prices: 10-25 PLN/kg (varies by type/channel)
  • Organic Premium: +40% price

Tree Lifecycle

  • Year 0: Newly planted (no harvest)
  • Year 1-2: Reduced yield (33%, 66%)
  • Year 3-40: Peak production (100%)
  • Year 40+: Trees die (must replant)

๐Ÿš€ Deployment

This project uses a dual-entrypoint architecture to support both the IC Playground (limited cycles) and mainnet (full EOP).

Target Entry File DFX Version Actor Type Command
Playground main.mo 0.24.3 Classic actor + stable var dfx deploy backend --playground
Mainnet main_mainnet.mo 0.30+ persistent actor (EOP) dfx deploy backend_mainnet --network ic

Local Development with dfxvm

# Install multiple dfx versions
dfxvm install 0.24.3
dfxvm install latest

# For playground testing
dfxvm use 0.24.3
dfx deploy backend --playground

# For mainnet/modern local dev
dfxvm use latest
dfx deploy backend_mainnet

CI/CD Workflows

  • Playground: Auto-deploys on push to master via deploy-playground.yml (dfx 0.24.3)
  • Mainnet: Manual trigger via deploy-mainnet.yml (dfx 0.30.2, requires confirmation)

๐Ÿงช Testing

Run comprehensive backend tests:

.\test-backend.ps1

This runs 20 tests covering:

  • Player initialization
  • Parcel operations (harvest, water, fertilize, plant)
  • Market transactions
  • Organic conversion
  • Tree density validation
  • Season progression

๐Ÿ“š Documentation

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 18 - UI framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • React Query - State management
  • React Router - Navigation
  • Lucide React - Icons

Backend

  • Motoko - Smart contract language
  • Internet Computer - Blockchain platform
  • Stable Storage - Data persistence

Integration

  • @dfinity/agent - ICP SDK
  • @dfinity/auth-client - Internet Identity (ready)

๐ŸŽจ UI Features

  • โœ… Mobile-first responsive design
  • โœ… Vibrant gradients and animations
  • โœ… Loading states with spinners
  • โœ… Error handling with retry
  • โœ… Real-time data updates
  • โœ… Color-coded status indicators
  • โœ… Progress bars (water, fertility)
  • โœ… Interactive sliders

๐Ÿ“Š Stats

  • 2,537 lines of code
  • 25 files created
  • 18+ backend functions
  • 3 UI pages
  • 20 comprehensive tests

๐Ÿ—บ๏ธ Roadmap

โœ… Phase 1: Core Engine (Complete)

  • Backend with all game mechanics
  • Enhanced game systems
  • Frontend UI
  • Backend integration

๐Ÿ”„ Phase 2: Polish (In Progress)

  • Toast notifications
  • Modals and dialogs
  • Animations
  • Internet Identity auth

๐Ÿ“‹ Phase 3: Advanced Features

  • Weather system
  • Market dynamics
  • AI competitors
  • Sports management
  • Achievements

๐Ÿš€ Phase 4: Deployment

  • IC mainnet deployment
  • Custom domain
  • Analytics
  • Performance optimization

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with โค๏ธ for the Internet Computer ecosystem
  • Inspired by classic farming simulation games
  • Produced by JaPiTo Group

๐Ÿ“ž Contact


Ready to play! ๐Ÿ’๐Ÿšœ

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages