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