Skip to content

CalorieToken/CalorieAppTestnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

78 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CalorieApp ๐ŸŽ

CI CodeQL UX Tour Version Python License Website XRPL

A mobile-first cryptocurrency wallet and food tracking application for CalorieToken on the XRP Ledger, built with KivyMD.

Latest Update (2025-11-18 โ€“ v1.1.1): Repository hardening, public-safe documentation index, UX layout consistency, security enhancements. See CHANGELOG. Pending merge from branch chore/repo-hardening.

โš–๏ธ Legal & Beta Testnet Disclaimer

This software ("CalorieApp") is a preโ€‘release beta operating solely on the XRP Ledger Testnet. By accessing, cloning, building, or using any portion of this repository you acknowledge and agree to the following clauses:

  1. Experimental Status: All features (wallets, tokens, NFT, DEX, food tracking, UI components) are experimental and subject to modification, suspension, or removal without notice prior to any mainnet launch.
  2. No Real Value: Testnet XRP and any Testnet units or representations of CalorieToken ($CAL) have no monetary, redeemable, or transferable realโ€‘world value.
  3. No Advice: Nothing in the code, documentation, interfaces, commit history, issues, or generated outputs constitutes financial, investment, legal, medical, nutritional, or tax advice. Do your own due diligence.
  4. No Solicitation: This repository does not solicit investment, purchase of tokens, securities, or any regulated financial instruments.
  5. Risk Acceptance: You accept all risks associated with running beta code including potential data loss, malfunction, incorrect balances, performance issues, or security defects.
  6. No Warranty: Provided "AS IS" without warranties of any kind (express or implied), including but not limited to merchantability, fitness for a particular purpose, nonโ€‘infringement, accuracy, reliability, or availability.
  7. Limitation of Liability: CalorieToken, contributors, maintainers, and affiliates shall not be liable for any direct, indirect, incidental, consequential, special, exemplary, or punitive damages arising out of or in connection with use of or inability to use this beta software.
  8. Intellectual Property: CalorieTokenยฎ trademarks, logos, and brand assets are protected. See docs/TRADEMARK.md for permitted usage. No license to brand assets is granted beyond the repositoryโ€™s stated custom dual license.
  9. Data Handling: The current beta architecture stores sensitive wallet materials locally (encrypted). You are responsible for safeguarding keys, mnemonics, passwords, and exported data. No cloud custody is provided.
  10. Security Posture: While reasonable hardening steps are taken, the software has not undergone formal thirdโ€‘party security audits. Treat all cryptographic operations as provisional.
  11. Forwardโ€‘Looking Statements: Roadmap items, planned features, scaling targets, or performance goals are forwardโ€‘looking and inherently uncertain.
  12. Jurisdiction: Usage is subject to applicable laws in your jurisdiction. If local regulations restrict interaction with beta blockchain software, you must discontinue use.
  13. Contribution Disclosure: Pull requests, issues, or discussions may become publicly visible. Do not submit proprietary, confidential, or sensitive personal data.
  14. Licensing: Code usage is governed by the Custom Dual License (personal/educational permitted; commercial/public distribution requires written permission). See LICENSE.
  15. Monitoring: Public transparency of development is provided; you can review ongoing commits, branches, and releases at: https://github.com/CalorieToken/CalorieAppTestnet

If you disagree with any clause, do not use, clone, build, or distribute this software.

Contact (Licensing / Compliance / Security): info@calorietoken.net

๐Ÿช™ CalorieToken Integration

Official CalorieToken XRPL Token:

  • Currency: Calorie
  • Ticker: $CAL
  • Issuer: rNqGa93B8ewQP9mUwpwqA19SApbf62U7PY
  • Network: XRP Ledger Mainnet (Testnet for development)
  • Website: calorietoken.net
  • Whitepaper: Read here

"Aiming to be the world's food token"
CalorieToken targets the worldwide food & beverage industry with blockchain-based payment solutions.

Learn More:

๐ŸŒŸ High-Level Feature Matrix

Area Implemented Notes
Multiโ€‘Wallet XRPL โœ… Create/import; encrypted storage
Mnemonic (BIP39) โœ… 12โ€‘word generation, verify, import
Token Support โœ… Generic framework + trustlines
Transactions โœ… XRP & tokens; visual history indicators
Offline Mode โœ… Deterministic tours/testing
Multiโ€‘Server Failover โœ… Rotating endpoints, graceful degradation
NFT Screens โณ Mint flow refinement pending
DEX Trading โณ Offer & market UI polishing
Food Tracking โœ… Nutrition logging baseline
Responsive System โœ… Size classes, lazy recompute, overlay (withheld)
Social Assets โœ… Dynamic image generator (edgeโ€‘toโ€‘edge typography)
Accessibility ๐Ÿšง Contrast audit scheduled
Performance Profiling ๐Ÿšง Planned instrumentation
CalorieDB Sync ๐Ÿ”œ Deferred (isolated)
WalletConnect ๐Ÿ”œ Phase 1 design queued
Web3 Browser ๐Ÿ”œ Deferred (flagged)

Legend: โœ… Complete ยท โณ Partial ยท ๐Ÿšง In Progress ยท ๐Ÿ”œ Planned

๐Ÿ› ๏ธ Technical Stack

  • Frontend: KivyMD 2.0.dev (master)
  • Backend: Python 3.12
  • Blockchain: XRPL (XRP Ledger) Testnet
  • Mnemonic: BIP39 for 12-word recovery phrases
  • Networking: httpx with async support
  • Encryption: cryptography library
  • Data Storage: shelve (encrypted)

๐Ÿ—๏ธ Project Structure

CalorieAppTestnet/
โ”œโ”€โ”€ README.md              # You are here
โ”œโ”€โ”€ LICENSE                # Custom dual license
โ”œโ”€โ”€ main.py                # Application entry point
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”œโ”€โ”€ setup.py              # Package configuration
โ”œโ”€โ”€ buildozer.spec        # Android build config
โ”œโ”€โ”€
โ”œโ”€โ”€ .github/              # CI/CD workflows
โ”œโ”€โ”€ assets/               # Images and resources
โ”œโ”€โ”€ docs/                 # ๐Ÿ“š All documentation
โ”‚   โ”œโ”€โ”€ QUICK_START.md
โ”‚   โ”œโ”€โ”€ CONTRIBUTING.md
โ”‚   โ”œโ”€โ”€ CHANGELOG.md
โ”‚   โ”œโ”€โ”€ TODO.md
โ”‚   โ””โ”€โ”€ ... (guides & references)
โ”œโ”€โ”€ scripts/              # ๐Ÿ”ง Build & utility scripts
โ”‚   โ”œโ”€โ”€ ux_tour.py
โ”‚   โ”œโ”€โ”€ build_apk.bat
โ”‚   โ””โ”€โ”€ run.py
โ”œโ”€โ”€ src/                  # ๐Ÿ’ป Source code
โ”‚   โ”œโ”€โ”€ VERSION.py
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ screens/
โ”‚   โ””โ”€โ”€ utils/
โ””โ”€โ”€ tests/               # ๐Ÿงช Unit tests

Note: We follow industry best practices with a clean root directory. Additional internal references are intentionally withheld until stable release.

Layout Organization (Modernized)

The UI is organized into maintainable, screen-focused KV files with a clear loading order. This approach improves iteration speed and keeps layouts consistent without exposing internal file structure. The modernized setup enables:

  • Cleaner diffs and easier collaboration
  • Reduced duplication and warnings
  • Faster targeted layout updates

Conditional Navigation System

The app features an intelligent navigation system that creates navigation drawers only for screens that need them:

Screens WITH Navigation Drawers:

  • Wallet Screen
  • Settings Screen
  • Food Tracking Screen
  • DEX Trading Screen
  • NFT Minting Screen

Screens WITHOUT Navigation Drawers:

  • Login Screen
  • Transaction Screens (Send XRP, Send Tokens)
  • Setup/Import Screens
  • Intro/First Use Screens
  • Mnemonic Display/Verify Screens

XRPL Multi-Server Failover

Robust connectivity with automatic failover:

  1. Primary: https://testnet.xrpl-labs.com
  2. Backup: https://s.altnet.rippletest.net:51234
  3. Backup: https://testnet.xrplapi.com
  4. Backup: https://xrplcluster.com

XRPL Response Caching

Lightweight in-memory caching for select XRPL requests (e.g. ServerInfo) reduces redundant network calls and stabilizes performance under intermittent connectivity. Cache entries automatically expire after a short TTL.

๐Ÿš€ Getting Started (Pre-Release Notice)

โณ Deferred Components (Isolated)

The following planned features are isolated under feature flags and excluded from the active beta build:

  • Web3 Browser Screen (ENABLE_WEB3_BROWSER=False): Future in-app browsing / WalletConnect surface.
  • CalorieDB Sync Layer (ENABLE_CALORIE_DB=False): Planned decentralized product scan indexing (IPFS + BigchainDB).
  • XRPL โ†” CalorieDB Sync Service (ENABLE_CALORIE_DB=False): Real-time bidirectional sync deferred; heavy integration code isolated.

They reside in src/_deferred/ and can be re-enabled via flags once scoped for a release milestone.

Runtime/build commands have been deliberately removed (v1.1.2) to prevent distribution of unfinished work. Request internal access: info@calorietoken.net.

๐Ÿ“ฑ Usage

First Time Setup

  1. Launch the app
  2. Choose to create a new wallet or import existing keys
  3. Set up your secure password
  4. Your wallet is ready to use!

Sending Transactions

  1. Navigate to the Wallet screen
  2. Click "Send XRP" or token buttons
  3. Enter recipient address and amount
  4. Confirm transaction

Food Tracking

  1. Access the Food Tracker from the navigation menu
  2. Log your meals and track calories
  3. Monitor your daily nutrition goals

๐Ÿ”ง Development

Project Structure

CalorieAppTestnet/
โ”œโ”€โ”€ main.py                 # Application entry point
โ”œโ”€โ”€ run.py                  # Alternative run script
โ”œโ”€โ”€ buildozer.spec          # Android build configuration
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ app.py          # Main application class
โ”‚   โ”‚   โ””โ”€โ”€ kv/                  # Modular KV layout files (replaces monolithic .kv)
โ”‚   โ”œโ”€โ”€ screens/            # All screen implementations
โ”‚   โ”‚   โ”œโ”€โ”€ WalletScreen.py
โ”‚   โ”‚   โ”œโ”€โ”€ SendXRPScreen.py
โ”‚   โ”‚   โ”œโ”€โ”€ SendTestTokenScreen.py
โ”‚   โ”‚   โ”œโ”€โ”€ MnemonicDisplayScreen.py
โ”‚   โ”‚   โ””โ”€โ”€ ... (25+ screens)
โ”‚   โ””โ”€โ”€ utils/              # Utility modules
โ”‚       โ”œโ”€โ”€ xrpl_client_manager.py    # XRPL connectivity
โ”‚       โ”œโ”€โ”€ conditional_navigation.py # Navigation system
โ”‚       โ”œโ”€โ”€ mnemonic_manager.py       # BIP39 mnemonic handling
โ”‚       โ”œโ”€โ”€ password_field_utils.py   # UI utilities
โ”‚       โ”œโ”€โ”€ robust_transaction.py     # Transaction handling
โ”‚       โ””โ”€โ”€ token_config.py           # Token configuration
โ”œโ”€โ”€ assets/                 # App assets and images
โ”‚   โ””โ”€โ”€ images/            # Logo and UI images
โ”œโ”€โ”€ config/                 # Configuration files
โ”œโ”€โ”€ scripts/               # Utility scripts
โ””โ”€โ”€ docs/                  # Documentation

Key Components

  • XRPLClientManager: Handles XRPL connectivity with automatic failover
  • ConditionalNavigationDrawer: Intelligent navigation system
  • PasswordFieldWithToggle: Enhanced password input with visibility toggle
  • robust_submit_and_wait: Transaction submission with retry logic

Development Viewport & Responsive Overrides

During active development and automated UX tours we often want a consistent, phone-sized viewport while still preserving full adaptive behavior for tablets and desktops in production.

Environment overrides (all optional):

Variable Example Purpose
DEV_PHONE_VIEWPORT 390x844 Forces window size (if APP_FORCE_WIDTH/HEIGHT not set) to a modern phone logical resolution (portrait enforced).
FORCE_SIZE_CLASS sm / phone Pins responsive size class regardless of window width (use phone as alias for sm).
TOUR_FORCE_PHONE 1 In UX tour runs auto-sets DEV_PHONE_VIEWPORT=390x844 and FORCE_SIZE_CLASS=sm if unset.
TOUR_PHONE_WIDTH / TOUR_PHONE_HEIGHT 414 / 896 Fine-grained control for UX tour window size when TOUR_FORCE_PHONE is enabled.

Example (PowerShell):

$env:DEV_PHONE_VIEWPORT="390x844"; $env:FORCE_SIZE_CLASS="sm"; python -B scripts/complete_ux_tour.py

Production builds simply omit these variables and the app reverts to automatic breakpoint detection (xs, sm, md, lg, xl). The responsive system caches scaling factors to minimize recomputation while keeping layout adjustments correct on window resize.

Breakpoints remain unchanged ensuring cross-platform compatibility; overrides are strictly opt-in for development convenience.

Debug Overlay (Development Only)

Activation mechanics exist but invocation commands are withheld pre-release. Overlay shows breakpoint class, scaling factors, and dimensions when enabled internally.

This displays a small badge in the top-right corner showing:

  • Current size class (xs/sm/md/lg/xl)
  • Lock icon (๐Ÿ”’) when FORCE_SIZE_CLASS is active
  • DP and font scale factors
  • Current window dimensions

The overlay updates in real-time during window resizes and is automatically removed in production (when DEBUG_RESPONSIVE is unset).

CI Testing Strategy

Automated UX validation runs are supported to help catch regressions across device sizes. Details of internal test tooling are intentionally minimized here for security and competitive reasons. See docs/UX_TOUR_GUIDE.md for a public overview of the process.

๐Ÿงช Testing

Automated UX Tour

We use an automated UX tour to validate major screens and flows and to generate visual reports for review. High-level, public-safe documentation is available here:

Implementation details and internal scripts are withheld to protect the projectโ€™s integrity until formal release.

See also:

UI/UX References (Public)

Manual Testing

Internal test cycles include navigation, XRPL connectivity/failover simulation, wallet creation/import flows, transaction lifecycle validation, performance sampling, and offline mode handling. Detailed invocation steps are withheld until stable release.

๐Ÿค Contributing

We welcome contributions! Please read our Contributing Guide for:

  • Code style guidelines
  • Development setup
  • Testing requirements
  • Pull request process

๐Ÿ“„ License

This project is licensed under a Custom Dual License - see the LICENSE file for details.

Summary:

  • Personal Use: Permitted for educational, research, and non-commercial purposes
  • Commercial/Public Use: Requires explicit written permission from CalorieToken

Contact for commercial licensing: info@calorietoken.net

Trademark Notice: CalorieTokenยฎ and related branding are registered trademarks. See TRADEMARK.md.

๐ŸŒ XRPL Testnet

This application uses the XRPL Testnet for development and testing. Testnet XRP has no real-world value and is used solely for testing purposes.

๐Ÿ”— Links

Official CalorieToken Resources

Technical Documentation

Trading & Token Info

๐Ÿ†˜ Support

For App/Development Issues:

For CalorieToken Project:


Built with โค๏ธ for CalorieToken and the XRPL community


CalorieTokenยฎ | Chamber of Commerce KVK: 84216352
Trademark registered with EUIPO | See TRADEMARK.md for usage guidelines

Sponsor this project

Packages

No packages published