Skip to content

anushka-codes1/CampusSwap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CampusSwap πŸŽ“

Team ErRor_404 - InnoVedam Hackathon Project

A revolutionary peer-to-peer item borrowing platform designed specifically for campus communities, solving trust, pricing, and delivery challenges with innovative features. Screenshot 2026-03-18 at 11 33 29β€―AM

🌟 Core Features

1. Trust Building System

  • βœ… Time-Bound Borrowing with Auto-Reminders

    • Smart scheduling with automated return reminders
    • Risk-based reminder frequency
  • βœ… QR-Based Hand-Off & Return Verification

    • Super easy demo feature
    • Scan to confirm item exchange
    • Timestamped verification
  • βœ… Collateral Mode for High-Value Items

    • Automatic collateral calculation (20-50% of item value)
    • Pre-authorized payments with Stripe
    • Instant collateral return on on-time return
  • βœ… Smart Return Risk Score ⭐ Unique Twist!

    • 0-100 risk assessment
    • Considers trust score, history, item value, duration
    • Personalized recommendations

2. Price Exploitation Prevention

  • βœ… Campus Fair Price Model

    • Minimum and maximum price bounds per category
    • Prevents overcharging
  • βœ… Auto-Suggest Price

    • Frictionless UX
    • Based on category, duration, condition, and demand
    • Transparent breakdown
  • βœ… Peer-Reported Price Abuse Flag

    • Community-driven fairness
    • Admin review system

3. Smart Delivery Options

  • ⭐ Self-Delivery with Meeting-Point Automation

    • Popular campus locations pre-configured
    • Distance and walk-time calculation
    • Smart suggestion based on both users' locations
  • ⭐ Campus Buddy Couriers Novel Feature!

    • Verified student couriers
    • Earn while delivering
    • Rating system
  • ⭐ Priority Delivery

    • Borrower picks up directly from lender
    • Extra β‚Ή15 fee
    • β‚Ή5 goes to lender for convenience

4. Revenue Model

Activity Users/Month Revenue
Normal transactions (β‚Ή3 fee) 5,000 β‚Ή15,000
Priority boosts (β‚Ή15) 600 β‚Ή9,000
Convenience pickup (β‚Ή20 share) 200 β‚Ή4,000
College store subscriptions - β‚Ή2,500
Total β‚Ή30,500/month

5. Security & Verification

  • College Email Verification

    • Primary authentication method
    • .edu or .ac.in domains required
    • OTP verification
  • Pre-Authorized Payments with Stripe

    • Funds held but not captured until return
    • Automatic collateral handling
    • Late penalty support

πŸ—οΈ Project Structure

/app                    # Application routes
  /(auth)              # Authentication pages
  /dashboard           # User dashboard
  /create-listing      # Create item listing
  /matches             # Browse items
/lib                   # Core libraries
  supabase.ts         # Supabase client & database functions
  stripe.ts           # Stripe payment integration
/utils                 # Utility functions
  qr.ts               # QR code generation & verification
  meetingPoint.ts     # Smart meeting point automation
  riskScore.ts        # Risk assessment algorithm
  pricing.ts          # Fair pricing system
  delivery.ts         # Delivery options logic
/server/routes         # API routes
  auth.ts             # Authentication endpoints
  items.ts            # Item CRUD operations
  transactions.ts     # Transaction management
/db
  seeds.sql           # Database schema

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (or npm/yarn)
  • Supabase account
  • Stripe account

Installation

  1. Clone the repository
git clone https://github.com/anushka-codes1/InnoVedam-Hackathon.git
cd InnoVedam-Hackathon
  1. Install dependencies
pnpm install
  1. Set up environment variables
cp .env.example .env
# Edit .env with your credentials
  1. Set up Supabase database
  • Create a new Supabase project
  • Run the SQL from db/seeds.sql in Supabase SQL editor
  • Copy your project URL and anon key to .env
  1. Configure Stripe
  • Create a Stripe account
  • Get your API keys from dashboard
  • Add keys to .env
  • Set up Stripe Connect for lender payouts (optional)
  1. Run the development server
pnpm dev

Visit http://localhost:3000 to see the app!

πŸ“Š Database Schema

Key Tables

  • users - User profiles with trust scores
  • items - Item listings with pricing bounds
  • transactions - Borrowing transactions with QR codes
  • buddy_couriers - Delivery courier profiles
  • meeting_points - Popular campus locations
  • reminders - Automated reminder system
  • price_reports - Price abuse reports
  • notifications - User notifications

See db/seeds.sql for complete schema.

πŸ’³ Payment Flow

  1. Borrower initiates transaction

    • Selects item and duration
    • System calculates total (rental + fees + collateral)
  2. Pre-authorization created

    • Stripe holds funds on borrower's card
    • Amount includes collateral for high-value items
  3. Item handed off

    • Both parties scan handoff QR code
    • Transaction becomes active
  4. Item returned

    • Both parties scan return QR code
    • If on-time: Charge rental only, return collateral
    • If late: Add penalty, charge total
  5. Payment captured

    • Lender receives rental amount
    • Platform receives fees
    • Courier receives delivery fee (if applicable)

🎯 Key Algorithms

Risk Score Calculation

score = 50 (baseline)
- Trust score impact (40% weight)
- Return history (30% weight)
- Item value consideration (15% weight)
- Duration impact (10% weight)
- Account age & other factors (5% weight)

Result: 0-25 = Low, 25-50 = Medium, 50-75 = High, 75-100 = Very High

Smart Meeting Point Selection

For each meeting point:
  totalDistance = distance(borrower, point) + distance(lender, point)
  score = totalDistance * (is_popular ? 0.8 : 1.0)
  
Return point with lowest score

Fair Price Calculation

price = baseCost + (durationCost * conditionMultiplier * demandMultiplier)
Bounded by: categoryMinPrice ≀ price ≀ categoryMaxPrice

πŸ”§ Tech Stack

  • Frontend: React, Next.js, Tailwind CSS
  • Backend: Next.js API Routes, Node.js
  • Database: PostgreSQL (Supabase)
  • Authentication: Supabase Auth
  • Payments: Stripe (with pre-authorization)
  • QR Codes: qrcode.react, react-qr-reader
  • Deployment: Vercel (recommended)

πŸ“± Features Roadmap

  • Mobile app (React Native)
  • Real-time chat between users
  • Photo verification of item condition
  • Integration with college student ID systems
  • Analytics dashboard for admins
  • Referral program
  • Insurance options for high-value items

🀝 Contributing

We welcome contributions! Please see our contributing guidelines.

πŸ“„ License

MIT License - feel free to use this project for your campus!

πŸ‘₯ Team ErRor_404

Built with ❀️ for Vedam School of Technology's InnoVedam Hackathon


Questions? Open an issue or contact the team!

πŸŽ“ For College Administrators

Interested in deploying this platform for your campus? Contact us for:

  • White-label solution
  • Custom branding
  • Integration with existing systems
  • Training and support
  • Store subscription packages (β‚Ή29/month)

About

Peer-to-peer campus marketplace with payments and QR-based item exchange

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors