A multi-category Progressive Web App (PWA) where friends can swipe on hikes, movies, TV shows, and restaurants to find mutual matches!
- Multi-Category Swiping: Discover and swipe on hikes, movies, TV shows, and restaurants
- Category Switching: Seamlessly switch between different content categories
- Swipe Interface: Swipe right to like, left to pass using Tinder-style cards
- Real-time Matching: Instant notifications when you and friends both like the same item
- Authentication: Simple email/password login
- Progressive Web App: Installable on mobile devices
- Curated Content: Pre-loaded trails, movies, TV shows, and restaurants
- Responsive Design: Beautiful UI that works perfectly on desktop and mobile
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS
- Swipe Cards: react-tinder-card
- Backend: Firebase (Firestore + Authentication)
- Hosting: Vercel-ready
- PWA: vite-plugin-pwa
Before you begin, ensure you have:
- Node.js (v18 or higher) and npm installed
- A Firebase project (Create one here)
- Git (optional)
cd hikeappnpm install- Go to Firebase Console
- Click "Add Project" and follow the setup wizard
- Once created, click on the Web icon (</>) to add a web app
- Register your app and copy the configuration
- In Firebase Console, go to Firestore Database
- Click "Create Database"
- Start in Test Mode (you can secure it later)
- Choose a location and click "Enable"
- In Firebase Console, go to Authentication
- Click "Get Started"
- Enable Email/Password sign-in method
-
Copy
.env.exampleto.env:cp .env.example .env
-
Open
.envand replace with your Firebase config values:VITE_FIREBASE_API_KEY=your_actual_api_key VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com VITE_FIREBASE_PROJECT_ID=your-project-id VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com VITE_FIREBASE_MESSAGING_SENDER_ID=123456789 VITE_FIREBASE_APP_ID=1:123456789:web:abcdef
-
Update
src/lib/firebase.tsto use environment variables:const firebaseConfig = { apiKey: import.meta.env.VITE_FIREBASE_API_KEY, authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN, projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID, storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET, messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID, appId: import.meta.env.VITE_FIREBASE_APP_ID };
npm run devOpen http://localhost:5173 in your browser.
On first run, the app will automatically:
- Initialize 20 hiking trails in Firestore
- Show you the login screen
Quick Demo: Click "Quick Demo Login" to bypass creating an account.
- Sign Up/Login: Create an account or use demo login
- Swipe on Trails:
- Swipe right (or click π) to like a trail
- Swipe left (or click β) to pass
- Check Matches: Click "Matches" to see trails you and friends both liked
- Invite Friends: Share the app URL with friends and start matching!
hikeapp/
βββ src/
β βββ components/
β β βββ AuthForm.tsx # Login/Signup component
β β βββ Navbar.tsx # Navigation bar
β β βββ TrailCard.tsx # Swipeable trail card
β βββ pages/
β β βββ Home.tsx # Main swipe interface
β β βββ Matches.tsx # Matched trails display
β βββ lib/
β β βββ firebase.ts # Firebase config
β β βββ firestoreHelpers.ts # Database functions
β βββ App.tsx # Main app component
β βββ main.tsx # App entry point
β βββ index.css # Global styles
βββ public/ # PWA assets
βββ package.json
βββ vite.config.ts
βββ tailwind.config.js
βββ README.md
Edit src/lib/firestoreHelpers.ts and add trails to the initializeTrails() function:
{
name: "Your Trail Name",
image: "https://images.unsplash.com/...",
description: "Trail description",
lengthKm: 10,
durationHours: 4,
scenery: "Mountains, lakes",
pathType: "mountain"
}Edit tailwind.config.js:
theme: {
extend: {
colors: {
primary: '#10b981', // Change to your color
secondary: '#3b82f6',
},
},
}-
Install Vercel CLI (optional):
npm i -g vercel
-
Build your app:
npm run build
-
Deploy:
Option A - Using Vercel CLI:
vercel
Option B - Using Vercel Dashboard:
- Push your code to GitHub
- Go to Vercel
- Click "Import Project"
- Select your repository
- Add environment variables from
.env - Deploy!
-
Add Environment Variables in Vercel:
- Go to Project Settings β Environment Variables
- Add all
VITE_FIREBASE_*variables from your.envfile
Before going to production, update your Firestore security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users collection
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId;
}
// Trails collection
match /trails/{trailId} {
allow read: if request.auth != null;
allow write: if false; // Only admins can modify
}
// User swipes
match /userSwipes/{userId}/swipes/{swipeId} {
allow read, write: if request.auth.uid == userId;
}
// Matches
match /matches/{matchId} {
allow read: if request.auth != null &&
request.auth.uid in resource.data.userIds;
allow write: if request.auth != null;
}
}
}The app is configured as a PWA and can be installed:
- Mobile: Tap the browser menu β "Add to Home Screen"
- Desktop: Look for the install icon in the address bar
- Check Firebase Console β Firestore Database
- Ensure trails collection exists
- Check browser console for errors
- Verify Firebase Auth is enabled
- Check your Firebase config in
.env - Ensure Email/Password provider is enabled
- Both users must swipe right on the same trail
- Check Firestore for matches collection
- Ensure real-time listeners are connected
This is a template project. Feel free to:
- Fork and modify
- Add new features
- Improve the UI
- Add more trail data sources
MIT License - feel free to use this project however you'd like!
- Filter trails by difficulty, length, or location
- Upload custom trail images
- Group matching for friend groups
- Trail reviews and ratings
- Map integration
- Weather integration
- Share matches on social media
- AI-powered trail recommendations
For issues or questions:
- Check this README thoroughly
- Review Firebase Console for configuration
- Check browser console for errors
- Verify all dependencies are installed
Built with β€οΈ for outdoor enthusiasts
Happy hiking! π₯Ύβ°οΈ