Skip to content

EPSpaces/PlanetBeach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŠ PlanetBeach - Gamifying Ocean Cleanup

Transforming ocean conservation through AI-powered gamification and community engagement

Video Demo License Node.js Swift

๐ŸŽฏ Overview

PlanetBeach is an innovative mobile and web application that gamifies ocean cleanup efforts by combining AI-powered trash detection with social features. Users can photograph trash, earn rewards through AI analysis, compete on leaderboards, and join local cleanup chapters to make a real environmental impact.

โœจ Key Features

๐Ÿค– AI-Powered Trash Detection

  • Smart Camera System: Uses advanced AI (Claude 3.5 Sonnet) to analyze photos and identify trash
  • Intelligent Scoring: Automatically calculates rewards based on trash quantity, type, and environmental impact
  • Real-time Analysis: Instant feedback and reward calculation

๐ŸŽฎ Gamification Elements

  • Power & Tokens: Earn points for each piece of trash collected
  • Global Leaderboards: Compete with users worldwide
  • Chapter System: Join local communities like "Seattle Chapter"
  • Achievement System: Track your environmental impact

๐Ÿ‘ฅ Community Features

  • Local Chapters: Connect with nearby environmental enthusiasts
  • Real-time Statistics: See global trash collection progress
  • User Profiles: Track personal achievements and contributions
  • Social Leaderboards: Chapter-based competition

๐Ÿ“ฑ Cross-Platform Experience

  • Native iOS App: Built with SwiftUI for optimal mobile experience
  • RESTful API: Node.js/Express backend with MongoDB
  • Secure Authentication: JWT-based auth with Auth0 integration

๐Ÿ—๏ธ Architecture

Backend (Node.js/Express)

โ”œโ”€โ”€ index.js              # Main server entry point
โ”œโ”€โ”€ routes/
โ”‚   โ”œโ”€โ”€ authRoutes.js     # Authentication endpoints
โ”‚   โ”œโ”€โ”€ apiRoutes.js      # User data & leaderboards
โ”‚   โ””โ”€โ”€ aiRoutes.js       # AI trash detection
โ”œโ”€โ”€ schemas/
โ”‚   โ”œโ”€โ”€ User.model.js     # User database schema
โ”‚   โ””โ”€โ”€ Leadboard.model.js # Leaderboard schema
โ””โ”€โ”€ utils/
    โ””โ”€โ”€ authUtils.js      # JWT & security utilities

Frontend (Swift/SwiftUI)

โ”œโ”€โ”€ Planet_BeachApp.swift # App entry point
โ”œโ”€โ”€ MainView.swift        # Main app navigation
โ”œโ”€โ”€ ContentView.swift     # Dashboard & statistics
โ”œโ”€โ”€ CameraView.swift      # AI-powered camera
โ”œโ”€โ”€ AuthView.swift        # Login/signup
โ”œโ”€โ”€ ChapterView.swift     # Local community features
โ”œโ”€โ”€ AccountView.swift     # User profile
โ””โ”€โ”€ API.swift            # Backend communication

๐Ÿš€ Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB instance
  • Anthropic API key (for AI analysis)
  • Auth0 account (for authentication)
  • Xcode (for iOS development)

Backend Setup

  1. Clone the repository

    git clone https://github.com/EPSpaces/PlanetBeach.git
    cd PlanetBeach
  2. Install dependencies

    npm install
  3. Environment Configuration

    cp .example_env .env

    Fill in your environment variables:

    AUTH0_SECRET=your_auth0_secret
    AUTH0_CLIENTID=your_auth0_client_id
    MONGO_URI=your_mongodb_connection_string
    ANTHROPIC_API_KEY=your_anthropic_api_key
    PORT=3000
    TOKEN_SECRET=your_jwt_secret
  4. Start the server

    npm start
    # or for development
    npm run dev

iOS App Setup

  1. Open the project in Xcode

    open "Planet Beach/Planet Beach.xcodeproj"
  2. Update API endpoints

    • Modify the base URL in API.swift to point to your backend server
  3. Build and run

    • Select your target device/simulator
    • Press Cmd+R to build and run

๐Ÿ”ง API Endpoints

Authentication

  • POST /signin - User login
  • POST /signup - User registration
  • POST /validate - Token validation

User Data

  • GET /api/users - Get user profile
  • POST /api/tokens - Update user tokens
  • POST /api/power - Update user power
  • POST /api/trash - Update trash count

AI & Analytics

  • POST /ai/trash - AI-powered trash analysis
  • GET /api/trash - Global trash statistics
  • GET /api/world - Global leaderboard

๐Ÿค– AI Integration

The application uses Anthropic's Claude 3.5 Sonnet model for intelligent trash detection:

  • Image Analysis: Identifies trash types, quantities, and environmental impact
  • Smart Scoring: Awards points based on trash rarity and cleanup difficulty
  • False Positive Prevention: Distinguishes between actual trash and natural objects
  • Reward Calculation: Dynamic point system (0-300 tokens based on impact)

๐ŸŽฎ Gamification System

Scoring Mechanism

  • 1-3 tokens: Small common trash (bottles, wrappers)
  • 5-10 tokens: Moderate amount or uncommon items
  • 15-30 tokens: Large quantities or harmful materials
  • 50-100 tokens: Significant environmental impact
  • 150-300 tokens: Exceptional finds or large-scale cleanup

User Progression

  • Power: Overall environmental impact score
  • Tokens: Spendable currency for app features
  • Trash Count: Total pieces of trash collected
  • Leaderboard Ranking: Position in local/global rankings

๐ŸŒ Environmental Impact

PlanetBeach aims to:

  • Motivate Action: Make environmental cleanup engaging and rewarding
  • Build Communities: Connect like-minded individuals for collective action
  • Track Progress: Provide real-time feedback on environmental impact
  • Scale Solutions: Enable global participation in local cleanup efforts

๐Ÿ› ๏ธ Tech Stack

Backend

  • Node.js & Express.js
  • MongoDB with Mongoose
  • JWT Authentication
  • Anthropic AI API
  • Auth0 Integration
  • Multer (file uploads)

Frontend (iOS)

  • Swift & SwiftUI
  • UIKit (Camera integration)
  • URLSession (API communication)
  • UserDefaults (local storage)

AI & ML

  • Anthropic Claude 3.5 Sonnet
  • Image analysis and classification
  • Natural language processing

๐Ÿ”’ Security Features

  • JWT Authentication: Secure token-based authentication
  • Auth0 Integration: Enterprise-grade identity management
  • Password Hashing: Bcrypt encryption for user passwords
  • API Rate Limiting: Protection against abuse
  • Input Validation: Comprehensive data sanitization

๐Ÿ“Š Current Status

โœ… Completed Features

  • AI-powered trash detection system
  • User authentication and management
  • Leaderboard and scoring system
  • Native iOS application
  • RESTful API backend
  • Real-time statistics

๐Ÿšง Known Issues

  • Image submission from mobile to server (temporarily hardcoded)
  • Live image display API connection (hardcoded for demo)

๐Ÿ”ฎ Future Enhancements

  • Real-time image processing pipeline
  • Enhanced camera integration
  • Push notifications
  • Offline mode support
  • Expanded gamification features
  • Web dashboard
  • Additional AI models
  • Blockchain integration for rewards

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines for details on:

  • Code style and standards
  • Pull request process
  • Issue reporting
  • Feature requests

๐Ÿ“„ License

This project is licensed under the ISC License - see the LICENSE file for details.

๐Ÿ‘ฅ Team

EPSpaces Team

  • Environmental technology innovators
  • Passionate about combining AI with environmental action
  • Committed to scalable sustainability solutions

๐Ÿ“ž Contact & Support

  • Project Repository: GitHub
  • Demo Video: Watch Here
  • Issues: Please use GitHub Issues for bug reports and feature requests

Join the movement. Clean the oceans. Save the planet. ๐ŸŒŠ

Making environmental action accessible, engaging, and impactful through technology.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors