Frontend layer
Farmer portal
| Route | Function |
|---|---|
/ | Landing page |
/register-farm | Multi-step farmer registration |
/admin | Invoice management |
Investor app
| Route | Function |
|---|---|
/ | Homepage with active crops |
/shop | Seed marketplace |
/farm | Personal garden view |
/leaderboard | Investor rankings |
/profile | User stats |
Backend layer
Responsibilities
| Area | Function |
|---|---|
| User management | Profiles, authentication, KYC |
| Game state | XP, levels, water points |
| Document storage | Farmer documents to R2 |
| Event indexing | Sync blockchain events |
Data stores
| Store | Purpose |
|---|---|
| PostgreSQL | Primary database |
| Valkey | Caching and sessions |
| Cloudflare R2 | Document storage |
Blockchain layer
Smart contracts
| Contract | Standard | Purpose |
|---|---|---|
| GoldToken | ERC-20 | Platform currency |
| GoldFaucet | — | Testnet distribution |
| OwnaFarmNFT | ERC-1155 | Invoice tokens |
| OwnaFarmVault | — | Yield reserve |
Why Mantle
| Feature | Benefit |
|---|---|
| Layer 2 | Low gas fees |
| EVM compatible | Standard tooling |
| Fast finality | Quick confirmations |
Data distribution
| Data type | Location | Reason |
|---|---|---|
| Financial state | Blockchain | Immutable, trustless |
| User identity | Database | Privacy, compliance |
| Game mechanics | Database | Flexibility |
| Documents | Cloud storage | Size, access |