A GPS-based local community clipboard that enables anonymous text sharing between users in close physical proximity (~200 meters).
- π GPS-Only Location - No manual room codes, purely location-based
- π Privacy First - Never stores exact GPS coordinates, only privacy-safe geo-cells
- β‘ Real-Time - Instant updates using Firebase Firestore
- π Anonymous - Auto-generated friendly aliases
- β° Auto-Expiring - Messages disappear after 1 hour
- π± Mobile-First - Responsive design, PWA-ready
- π‘οΈ Secure - XSS protection, content sanitization, rate limiting
- π Community Supported - Zero ads, powered by optional direct Razorpay donations
- Request GPS - App requests location permission on load
- Geo-Cell Grouping - GPS coordinates converted to ~200m grid cells
- Share Text - Post messages visible to anyone in the same geo-cell
- Real-Time Feed - See nearby messages instantly
- Auto-Expire - Messages disappear after 1 hour
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Backend: Firebase Firestore, Firebase Security Rules
- Monetization: Razorpay Payment Button Integration
- Hosting: Firebase Hosting (HTTPS)
- Real-Time: Firestore onSnapshot listeners
- Node.js 18+ installed
- Firebase account
- Firebase CLI installed:
npm install -g firebase-tools
git clone https://github.com/hemanthreddykoduru/Local-Share.git
cd Local-Share
npm install- Go to Firebase Console
- Create a new project
- Enable Firestore Database (Start in production mode)
- Enable Firebase Hosting
- In Firebase Console, go to Project Settings > General
- Scroll to Your apps section
- Click Web app (</>) icon
- Copy the config values
Edit .env.local and add your Firebase credentials:
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-idfirebase login
firebase init
# Select Firestore and Hosting
# Use existing project
# Accept defaults
firebase deploy --only firestore:rules
firebase deploy --only firestore:indexesnpm run devNote: GPS requires HTTPS in production. Use ngrok or similar for local HTTPS testing.
npm run build# Export static site
npm run build
npx next export
# Deploy to Firebase
firebase deploy --only hostingYour app will be live at https://your-project.web.app
The app uses strict Firestore Security Rules:
- β Read: Anyone can read active, non-expired snippets
- β Create: Anyone can create snippets with validation
- β Update/Delete: Blocked from client (future: Cloud Functions)
Rules enforce:
- Text length (1-1000 characters)
- Valid geo-cell format
- Expiration within 2 hours max
- Required fields validation
function coordinatesToGeoCell(lat: number, lon: number): string {
const CELL_SIZE = 0.002; // ~200 meters
const latCell = Math.floor(lat / CELL_SIZE);
const lonCell = Math.floor(lon / CELL_SIZE);
return `${latCell}_${lonCell}`;
}Privacy guarantees:
- No raw GPS coordinates stored
- No exact distance calculation possible
- Users only know they're "nearby" (~200m)
- Reversing geo-cell gives ~40,000 mΒ² area minimum
βββ app/
β βββ layout.tsx # Root layout
β βββ page.tsx # Main page
β βββ globals.css # Global styles
βββ components/
β βββ LocationPermission.tsx
β βββ ClipboardInput.tsx
β βββ ClipboardFeed.tsx
β βββ SnippetCard.tsx
β βββ CopyButton.tsx
βββ hooks/
β βββ useLocation.ts # GPS state management
β βββ useClipboard.ts # Data fetching
β βββ useRealtime.ts # Firestore listeners
βββ lib/
β βββ firebase.ts # Firebase init
β βββ geocell.ts # Geo-cell algorithm
β βββ location.ts # GPS handling
β βββ sanitize.ts # XSS protection
β βββ profanity.ts # Content filtering
β βββ aliases.ts # Name generation
βββ firebase/
β βββ firestore.rules # Security rules
β βββ firestore.indexes.json
βββ public/
βββ manifest.json # PWA manifest
- XSS Protection - DOMPurify sanitization
- Input Validation - Client + server-side
- Rate Limiting - Firebase Security Rules
- Content Filtering - Basic profanity filter
- HTTPS Only - Enforced via Firebase Hosting
- No Auth Required - Anonymous by design
- Report/flag inappropriate content
- Cloud Functions for auto-moderation
- User karma/reputation system
- Emoji reactions
- Dark mode
- Push notifications for nearby activity
- Message categories/tags
- Time-based filtering
- Export/archive personal posts
- Multi-language support
- Ensure HTTPS (required for geolocation API)
- Check browser location permissions
- Try in incognito/private mode
- Check Firebase console for data
- Verify Firestore rules deployed
- Check browser console for errors
- Ensure geo-cell format is correct
- Run
npm installagain - Clear
.nextfolder:rm -rf .next - Check Node.js version (18+ required)
MIT License - Feel free to use for any purpose
If you find this project useful, consider supporting the development and server costs! Because GitHub Markdown does not allow Javascript payment scripts, you can support the project directly using the Razorpay button live on our website:
π Go to local-share.tech to Sponsor
For issues or questions:
- Check Firebase Console logs
- Inspect browser console
- Verify environment variables
- Review Firestore Security Rules
Built with β€οΈ using Firebase, Next.js, and GPS technology