Skip to content

Adityaakr/lumio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lumio Social - Next gen SocialFi app on Vara

Next gen SocialFi app on Vara redefining how creators connect, engage, and monetize their content.

Lumio Social License

✨ Features

  • πŸ“ Create Posts: Share your thoughts with up to 500 characters
  • πŸ’¬ Comments & Replies: Engage in conversations with nested comment threads
  • πŸ‘ Upvote System: Show appreciation for posts and comments
  • πŸ’° $VIBES Rewards: Earn tokens for your activity:
    • 50 $VIBES for creating a post
    • 25 $VIBES for commenting
    • 10 $VIBES for upvoting posts/comments
  • πŸ‘€ User Profiles: Customize your profile with username, handle, avatar, and bio
  • πŸ–ΌοΈ Image Support: Upload images to posts and comments via IPFS
  • πŸ“Š Leaderboard: Track your $VIBES earnings and activity stats
  • πŸ” Wallet Integration: Connect with Polkadot.js extension

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Frontend (React)                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚   Posts UI   β”‚  β”‚  Comments UI β”‚  β”‚  Profile UI  β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚         @gear-js/api + Sails Client                 β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Vara Network (Blockchain)                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚      Lumio Social Smart Contract (Rust/Sails)        β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  β”‚ MiniReddit   β”‚  β”‚   Session    β”‚  β”‚  State   β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  Service     β”‚  β”‚   Service    β”‚  β”‚  Query   β”‚  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    IPFS (Pinata)                             β”‚
β”‚              Image Storage & Retrieval                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Smart Contract

  • Rust with Sails Framework (v0.8.0)
  • Gear Protocol for blockchain execution
  • Session Service for signless transactions (optional)

Frontend

  • React 19 with TypeScript
  • Vite for fast builds
  • SCSS for styling
  • @gear-js/api for blockchain interaction
  • Sails Client for type-safe contract calls
  • IPFS/Pinata for image storage

πŸ“¦ Project Structure

lumio-social/
β”œβ”€β”€ app/                    # Smart contract (Sails)
β”‚   β”œβ”€β”€ src/lib.rs         # Main contract logic
β”‚   └── Cargo.toml
β”œβ”€β”€ client/                 # Generated TypeScript client
β”œβ”€β”€ frontend/               # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   └── utils/         # Utilities (IPFS, etc.)
β”‚   └── package.json
β”œβ”€β”€ target
    β”œβ”€β”€ ...
    └── wasm32-gear
        └── release
            β”œβ”€β”€ lumio-social.wasm       <---- this is our built .wasm file
            β”œβ”€β”€ lumio-social.opt.wasm   <---- this is optimized .wasm file
            └── lumio-social.idl        <---- this is our application interface .idl file
└── Cargo.toml            # Workspace configuration

πŸš€ Quick Start

Prerequisites

  • Rust (1.91+)
  • Node.js (18+)
  • Polkadot.js Extension (for wallet)

1. Clone Repository

git clone https://github.com/yourusername/lumio-social.git
cd lumio-social

2. Build Smart Contract

# Build the contract
cargo build --release

# Output files:
#wasm32-gear
        └── release
            β”œβ”€β”€ lumio-social.wasm       <---- this is our built .wasm file
            β”œβ”€β”€ lumio-social.opt.wasm   <---- this is optimized .wasm file
            └── lumio-social.idl        <---- this is our application interface .idl file

3. Deploy Contract

  1. Go to Gear IDEA
  2. Connect your wallet
  3. Upload target/wasm32-gear/release/lumio-social.opt.wasm
  4. Copy the Program ID

4. Setup Frontend

cd frontend

# Install dependencies
npm install

# Create .env file
cat > .env << EOF
VITE_NODE_ADDRESS=wss://testnet.vara.network
VITE_PROGRAM_ID=0x...your_program_id_here
VITE_PINATA_API_KEY=your_pinata_api_key
VITE_PINATA_SECRET_KEY=your_pinata_secret_key
VITE_PINATA_JWT=your_pinata_jwt
VITE_PINATA_GATEWAY=https://gateway.pinata.cloud/ipfs/
EOF

# Start development server
npm run dev

🌐 Deployment

Vercel Deployment

  1. Import Project to Vercel
  2. Set Root Directory: frontend
  3. Add Environment Variables:
  • VITE_PROGRAM_ID=0x0617121506174a7eb159967337d86488e68fafa085d697c2577b98e3b5d93398
  • VITE_NODE_ADDRESS=wss://testnet.vara.network
    • VITE_NODE_ADDRESS
    • VITE_PROGRAM_ID
    • VITE_PINATA_API_KEY
    • VITE_PINATA_SECRET_KEY
    • VITE_PINATA_JWT
    • VITE_PINATA_GATEWAY
  1. Deploy

See VERCEL_DEPLOYMENT.md for detailed instructions.

πŸ’‘ How It Works

Post Creation Flow

  1. User writes post (max 500 chars) and optionally uploads image
  2. Image uploaded to IPFS via Pinata
  3. Transaction sent to Lumio Social contract
  4. Contract validates and stores post
  5. User earns 50 $VIBES (tracked locally)
  6. Post appears in feed

Comment System

  • Users can comment on posts
  • Nested replies supported (unlimited depth)
  • Each comment earns 25 $VIBES
  • Upvoting comments earns 10 $VIBES

Profile System

  • Customizable username, handle, avatar, and bio
  • Profiles stored on-chain
  • Avatar images stored on IPFS
  • Profile data displayed in posts and comments

$VIBES Rewards

  • Posts: 50 $VIBES per post
  • Comments: 25 $VIBES per comment
  • Upvotes: 10 $VIBES per upvote (posts or comments)
  • Rewards tracked locally per user per contract deployment

πŸ“Š Contract Services

MiniReddit Service

  • createPost(text, image_uri, session_for_account) - Create a new post
  • toggleUpvote(post_id, session_for_account) - Toggle upvote on post
  • createComment(post_id, parent_id, text, image_uri, session_for_account) - Add comment
  • toggleCommentUpvote(comment_id, session_for_account) - Toggle comment upvote
  • updateProfile(username, social_handle, description, avatar_uri, session_for_account) - Update profile
  • getAllPosts() - Query all posts
  • getCommentsForPost(post_id) - Query comments for a post
  • getProfile(wallet) - Query user profile
  • getVibesBalance(wallet) - Query user's vibes balance

Session Service

  • createSession(signature_data, signature) - Create signless session
  • deleteSessionFromAccount() - Delete user's session
  • sessionForTheAccount(account) - Query session data

πŸ”’ Security

  • βœ… Input validation (text length limits)
  • βœ… Overflow protection
  • βœ… One vote per user enforcement
  • βœ… Immutable post/comment content
  • βœ… Session-based authorization (optional)
  • βœ… IPFS content addressing

πŸ“ License

MIT

🀝 Contributing

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

πŸ”— Resources

πŸ“§ Contact

Built with ❀️ on Vara Network


Note: This project uses the Sails framework for automatic IDL generation and optimized WASM builds.

About

Next gen SocialFi app on Vara redefining how creators connect, engage, and monetize their content.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published