Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CampusChain Marketplace

A decentralized marketplace built on Algorand blockchain for campus communities to buy, sell, and trade items securely.

🚀 Features

  • Blockchain-Powered: All transactions recorded on Algorand blockchain
  • Secure Wallet Integration: Uses Pera Wallet for secure authentication
  • Mint & List Items: Create NFT-like marketplace items with custom pricing
  • Purchase Items: Buy items with automatic ownership transfer
  • Delete Items: Remove your own listings from the marketplace
  • Persistent Storage: Items persist across page reloads via blockchain state

📋 Prerequisites

1. Install an Algorand Wallet

Choose one of these Algorand-compatible wallets:

Option A: Pera Wallet (Recommended)

Option B: Defly Wallet

Option C: MyAlgo Wallet (Web-based)

Note: All these wallets work with the CampusChain marketplace. Choose whichever you prefer!

2. Create an Algorand TestNet Account

  1. Open Pera Wallet
  2. Create a new account or import existing
  3. Switch to TestNet:
    • Open Settings → Developer Settings
    • Enable "TestNet Mode"
    • Switch network to "TestNet"

3. Fund Your TestNet Account

Get free TestNet Algos from the dispenser:

  1. Copy your wallet address from Pera Wallet
  2. Visit: https://bank.testnet.algorand.network/
  3. Paste your address and request funds
  4. Wait ~5 seconds for confirmation

4. Run Local Algorand Node (For Development)

# Install AlgoKit (if not already installed)
pip install algokit

# Start local development network
algokit localnet start

# Check status
algokit localnet status

🔧 Alternative: Developer Mode (No Wallet Required)

Can't install Pera Wallet? Use Developer Mode for testing:

  1. Run your deploy.py script - it generates a test account with mnemonic
  2. Copy the 25-word mnemonic from the output
  3. Open http://localhost:8000
  4. Click "🔧 Developer Mode (Testing Only)" to expand
  5. Paste your mnemonic
  6. Test all marketplace functions!

⚠️ Warning: Developer Mode is for testing ONLY. Never use real accounts or MainNet with this method!

🎯 Getting Started

1. Start the Frontend Server

cd frontend
python -m http.server 8000

2. Open in Browser

Navigate to: http://localhost:8000

3. Connect Your Wallet

  1. Click "🔗 Connect Wallet" button in the header
  2. Approve the connection in Pera Wallet popup
  3. Your wallet address will appear in the header

4. Use the Marketplace

List an Item:

  1. Enter item name/details (e.g., "Calculus Textbook")
  2. Enter price in microAlgos (e.g., 1000000 = 1 Algo)
  3. Click "Mint & List Block"
  4. Approve transaction in Pera Wallet

Buy an Item:

  1. Copy the Application ID from a listed block
  2. Paste it in the "Buy Item" section
  3. Click "Purchase Item"
  4. Approve the grouped transaction in Pera Wallet

Delete an Item (Owner Only):

  1. Enter the Application ID of your item
  2. Click "Delete Block"
  3. Approve transaction in Pera Wallet

🔧 Project Structure

CampusChain/
├── frontend/
│   ├── index.html          # Main marketplace UI
│   ├── style.css           # Styling
│   └── algosdk.min.js      # Algorand SDK
├── contracts/
│   ├── marketplace_approval.teal   # Smart contract logic
│   ├── marketplace_clear.teal      # Clear state program
│   └── deploy.py                   # Deployment script
└── README.md

🛡️ Security Notes

  • Never share your mnemonic/seed phrase with anyone
  • Use TestNet for development - Never use MainNet for testing
  • Pera Wallet keeps your keys secure - Private keys never leave your wallet
  • Always verify transactions before approving in Pera Wallet

🐛 Troubleshooting

"Please connect your Pera Wallet first!"

  • Click the "Connect Wallet" button in the header
  • Make sure Pera Wallet extension is installed and unlocked

"Connection Failed"

  • Refresh the page and try connecting again
  • Check that Pera Wallet is on the correct network (TestNet/LocalNet)

"Transaction Failed"

  • Ensure you have enough Algos in your account
  • Check that you're connected to the correct network
  • Verify the Application ID is correct

Blocks don't appear after refresh

  • Blocks are loaded from localStorage and blockchain
  • Clear browser cache if experiencing issues
  • Click the "🔄 Refresh" button to reload from blockchain

📚 Learn More

📄 License

MIT License - Feel free to use for educational purposes

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages