A minimal reading tracker dApp built on Stellar Soroban blockchain.
- ✅ Freighter Wallet Integration: Connect/disconnect wallet functionality
- ✅ Simple Reading Tracker: Record completed books on blockchain
- ✅ Reading Statistics: View total books read and last completed book
- ✅ Global Counter: See total books read by all users
- ✅ Modern UI: Clean, responsive interface with Tailwind CSS
- Frontend: Next.js 14, TypeScript, Tailwind CSS
- Blockchain: Stellar Soroban (Rust smart contracts)
- Wallet: Freighter Wallet API
- Network: Stellar Testnet
-
Install Soroban CLI:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env cargo install --locked soroban-cli
-
Install Freighter Wallet: Download from freighter.app
-
Create Testnet Account: Get testnet XLM from Stellar Laboratory
# Clone and install dependencies
git clone <your-repo>
cd readstellar
npm install-
Set your secret key:
export SECRET_KEY="your_secret_key_here"
-
Deploy the contract:
./scripts/deploy.sh
-
Start the development server:
npm run dev
-
Open the app: http://localhost:3000
- Connect Wallet: Click "Connect Freighter Wallet" on the landing page
- Enter Book Title: Type the name of a book you've completed
- Complete Book: Click "Complete Book" to record it on the blockchain
- View Stats: See your reading progress and global statistics
readstellar/
├── app/
│ ├── page.tsx # Landing page (wallet connect)
│ └── main/
│ └── page.tsx # Reading dashboard
├── src/
│ └── lib/
│ ├── wallet.ts # Freighter wallet integration
│ ├── soroban.ts # Contract interaction functions
│ └── contract-config.ts # Contract configuration
├── contracts/
│ └── reading_tracker/
│ ├── src/lib.rs # Soroban smart contract
│ └── Cargo.toml # Rust dependencies
└── scripts/
└── deploy.sh # Contract deployment script
The contract includes 4 simple functions:
complete_book(reader, book_title): Records a completed bookget_total_books(reader): Returns reader's total book countget_last_book(reader): Returns reader's last completed bookget_global_count(): Returns total books read by all users
- Wallet connects successfully
- Can enter book title
- "Complete Book" button works
- Transaction signs in Freighter
- Counter updates after completion
- Last book title displays correctly
- Global counter increments
- Disconnect wallet works
- Redirects work properly
# Test complete_book
soroban contract invoke \
--id YOUR_CONTRACT_ID \
--source-key $SECRET_KEY \
--rpc-url https://soroban-testnet.stellar.org \
--network-passphrase "Test SDF Network ; September 2015" \
-- complete_book \
--reader YOUR_ADDRESS \
--book_title "1984"
# Test get_total_books
soroban contract invoke \
--id YOUR_CONTRACT_ID \
--source-key $SECRET_KEY \
--rpc-url https://soroban-testnet.stellar.org \
--network-passphrase "Test SDF Network ; September 2015" \
-- get_total_books \
--reader YOUR_ADDRESS- "Contract ID not set": Update
src/lib/contract-config.tswith your deployed contract ID - Wallet connection fails: Ensure Freighter is installed and unlocked
- Transaction fails: Check you have enough XLM for fees
- Build errors: Verify Rust and Soroban CLI are installed correctly
Phase I is complete when:
- Contract deploys successfully to testnet
- Wallet connects/disconnects properly
- Can complete a book (call contract function)
- Counter increments correctly
- Last book title displays
- All operations work end-to-end
- No critical bugs in testing
- Running on testnet for 24+ hours without issues
After Phase I completion:
- Book library with 10-20 free books
- Quiz system for reading verification
- Badge system (NFTs) for achievements
- READ token economy
- Database integration
- Enhanced UI/UX
GNU License - see LICENSE file for details.
Phase I Status: ✅ Complete
Ready for: Contract deployment and testing
Next Phase: Phase II - Core Reading Features
