Skip to content

Ramysandy/Pinpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📍 Pinpoint

Pin Point

Pin Point (1)

A location-based Q&A platform with AI-powered answer verification, blockchain rewards, and real-time ML processing.

🚀 Features

  • 📍 Location-Based Questions: Ask and answer questions tied to specific GPS coordinates
  • 🤖 AI Verification: Multi-stage ML pipeline for answer validation (NSFW detection, object detection, scene captioning, OCR)
  • ⛓️ Blockchain Rewards: Solana-based credit system for verified contributions
  • 🗺️ Interactive Map: Real-time visualization of questions in your area
  • 📊 Reputation System: Earn points for quality answers and community engagement
  • 🔒 Secure Authentication: JWT-based user authentication with Supabase backend

🛠️ Tech Stack

Backend

  • FastAPI - High-performance Python web framework
  • Supabase - PostgreSQL database with real-time capabilities
  • Solana - Blockchain integration for rewards
  • ML Pipeline:
    • NSFW Detection
    • YOLO Object Detection
    • Face Detection & Blurring
    • Scene Captioning
    • OCR Text Detection
    • Semantic Similarity (CLIP)

Frontend

  • React 18 - Modern UI library
  • Vite - Fast build tool
  • Framer Motion - Smooth animations
  • Leaflet - Interactive maps
  • React Router - Client-side routing

📦 Installation

Prerequisites

  • Python 3.13+
  • Node.js 22.11.0+
  • npm or yarn
  • Supabase account
  • Solana wallet (for blockchain features)

Backend Setup

  1. Clone the repository:
git clone https://github.com/Ramysandy/Pinpoint.git
cd Pinpoint
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Download ML models:
# YOLOv5 model (for object detection)
# Download from: https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt
# Place in project root as yolov5s.pt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your credentials

Required environment variables:

SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
JWT_SECRET=your_jwt_secret_key
SOLANA_PRIVATE_KEY=your_solana_wallet_private_key
SOLANA_NETWORK=devnet
  1. Set up database schema:
# Run the SQL schema in your Supabase SQL editor
# See: supabase_schema.sql
  1. Populate sample data (optional):
python populate_db.py

Frontend Setup

  1. Navigate to frontend directory:
cd "Frontend/Reveal copy"
  1. Install dependencies:
npm install
  1. Create frontend .env file:
# Create Frontend/Reveal copy/.env
VITE_API_BASE_URL=http://localhost:8000
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_anon_key
  1. Build frontend:
npm run build

🚀 Running the Application

Development Mode

  1. Start the backend server:
python main.py

Server will run on http://localhost:8000

  1. Frontend development server (optional):
cd "Frontend/Reveal copy"
npm run dev

Frontend will run on http://localhost:5173

Production Mode

The backend serves the built frontend automatically from the templates folder:

python main.py

Visit http://localhost:8000 to see the application.

📖 API Documentation

Once the server is running, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

See API_DOCUMENTATION.md for detailed endpoint documentation.

🎯 Usage

  1. Sign Up / Login: Create an account or log in
  2. Ask a Question: Click "Ask Question" and provide location, title, and details
  3. Answer Questions: View nearby questions and submit photo + text answers
  4. Earn Rewards: Get verified answers approved through ML pipeline and earn Solana credits
  5. Build Reputation: Accumulate upvotes and reputation points

🧪 Testing

Run the smoke test:

powershell -ExecutionPolicy Bypass -File smoke_test.ps1

📁 Project Structure

Pinpoint/
├── Frontend/Reveal copy/     # React frontend application
│   ├── src/
│   │   ├── components/       # Reusable UI components
│   │   ├── pages/           # Page components
│   │   ├── store/           # State management
│   │   └── api/             # API client functions
│   └── dist/                # Built frontend (gitignored)
├── routes/                   # FastAPI route handlers
│   ├── auth.py              # Authentication endpoints
│   ├── questions.py         # Question CRUD
│   └── answers.py           # Answer submission & voting
├── ml_pipeline/             # ML verification modules
├── templates/               # Served frontend (gitignored assets)
├── db.py                    # Supabase database client
├── main.py                  # FastAPI application entry point
├── schemas.py               # Pydantic data models
├── solana_verifier.py       # Blockchain integration
└── populate_db.py           # Sample data generator

🔐 Security Notes

  • Never commit .env files
  • Use service role keys only on backend
  • Implement Row Level Security (RLS) in Supabase
  • Validate all user inputs
  • ML models not included in repo (download separately)

📝 License

This project is licensed under the MIT License.

🤝 Contributing

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

📧 Contact

For questions or support, please open an issue on GitHub.


Built with ❤️ using React, FastAPI, and Solana

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors