Rock-Spotter

Rock Spotter πŸͺ¨

Deploy to Render Railway Docker CI

A production-ready platform where rock enthusiasts can share photos of rocks with one another, participate in iSpy-style rock hunts, earn achievements, and connect with the geology community!

🌟 Features

οΏ½ Social Feed & Community

οΏ½πŸ“Έ Rock Photo Sharing

πŸ—ΊοΈ Location-Based Discovery

πŸƒ iSpy Rock Hunts

πŸ† Achievements & Gamification

πŸ‘₯ Social Features

🎨 Design System

Rock Spotter features a professionally designed visual system with:

πŸ“š Full Documentation:

πŸ—οΈ Project Structure

Rock-Spotter/
β”œβ”€β”€ backend/           # Node.js/Express API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ models/        # MongoDB models (User, Rock, Hunt, Achievement)
β”‚   β”‚   β”œβ”€β”€ routes/        # API routes
β”‚   β”‚   β”œβ”€β”€ controllers/   # Business logic
β”‚   β”‚   β”œβ”€β”€ middleware/    # Auth and validation
β”‚   β”‚   └── server.js      # Express app setup
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”œβ”€β”€ mobile-app/        # React Native mobile app (planned)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ theme/         # Complete design system & styling
β”‚   β”‚   └── assets/        # Icons, images, fonts
β”‚   └── README.md
β”œβ”€β”€ docs/             # Additional documentation
β”‚   β”œβ”€β”€ API.md             # API reference
β”‚   β”œβ”€β”€ DESIGN_SYSTEM.md   # Design system guide
β”‚   β”œβ”€β”€ STYLE_GUIDE.md     # Visual style guide
β”‚   β”œβ”€β”€ SETUP.md           # Setup instructions
β”‚   β”œβ”€β”€ HUNTS.md           # Hunt system details
β”‚   └── SAMPLE_DATA.md     # Testing data
└── README.md         # This file

πŸš€ Getting Started

Quick Deploy Options

🌐 Live Demo

☁️ Deploy Your Own

Option 1: One-Click Deploy Deploy with Vercel

Option 2: Manual Setup

# 1. Clone and setup
git clone https://github.com/jmenichole/Rock-Spotter.git
cd Rock-Spotter
./deploy-setup.sh

# 2. Follow DEPLOYMENT.md for Vercel + MongoDB Atlas setup

πŸ“– Complete deployment guide: DEPLOYMENT.md

πŸ› οΈ Local Development

Prerequisites

Backend Setup

  1. Navigate to the backend directory:
    cd backend
    
  2. Install dependencies:
    npm install
    
  3. Create a .env file (copy from .env.example):
    cp .env.example .env
    
  4. Update the .env file with your configuration:
    PORT=3000
    MONGODB_URI=mongodb://localhost:27017/rock-spotter
    JWT_SECRET=your-secret-key-here
    
  5. Start the server: ```bash

    Development mode with auto-reload

    npm run dev

Production mode

npm start


The API will be available at `http://localhost:3000`

### Mobile App Setup

The mobile app is currently in the planning phase. See `mobile-app/README.md` for more information.

## πŸ“š API Documentation

The backend provides a RESTful API with the following endpoints:

### Authentication
- `POST /api/users/register` - Register new user
- `POST /api/users/login` - Login user
- `GET /api/users/profile/me` - Get current user profile
- `PUT /api/users/profile/me` - Update profile

### Rocks
- `GET /api/rocks` - Get all rocks (with filters)
- `GET /api/rocks/nearby` - Get rocks near location
- `GET /api/rocks/:id` - Get specific rock
- `POST /api/rocks` - Create rock post
- `PUT /api/rocks/:id` - Update rock post
- `DELETE /api/rocks/:id` - Delete rock post
- `POST /api/rocks/:id/like` - Like/unlike rock
- `POST /api/rocks/:id/comment` - Add comment

### Hunts
- `GET /api/hunts` - Get all hunts
- `GET /api/hunts/:id` - Get specific hunt
- `POST /api/hunts` - Create new hunt
- `PUT /api/hunts/:id` - Update hunt
- `DELETE /api/hunts/:id` - Delete hunt
- `POST /api/hunts/:id/join` - Join a hunt
- `POST /api/hunts/:huntId/rocks/:rockId/found` - Mark rock as found
- `GET /api/hunts/my/progress` - Get user's hunt progress

### Achievements
- `GET /api/achievements` - Get all achievements
- `GET /api/achievements/:id` - Get specific achievement
- `POST /api/achievements` - Create achievement
- `POST /api/achievements/award` - Award achievement to user
- `GET /api/achievements/user/:userId` - Get user's achievements

For detailed API documentation, see `backend/README.md`

## πŸ—„οΈ Database Models

### User
- Username, email, password
- Profile picture and bio
- Rock count and hunt count
- Achievements earned

### Rock
- Title, description, photo URL
- Location (GeoJSON with coordinates)
- Rock type classification
- Tags and visibility settings
- Likes and comments

### Hunt
- Title, description, difficulty
- Creator and participants
- Rock list with hints and order
- Start/end dates and active status
- Progress tracking for participants

### Achievement
- Name, description, icon
- Type and rarity
- Criteria for earning
- Awarded to users

## 🎯 Use Cases

### For Rock Enthusiasts
- Document and share your rock collection
- Connect with other collectors
- Learn about different rock types
- Discover new locations for rock hunting

### For Educators
- Create educational rock hunts for students
- Share geology knowledge through photos
- Organize field trip challenges
- Track student participation

### For Communities
- Organize local rock hunting events
- Create city-wide scavenger hunts
- Promote outdoor activities
- Build community engagement

## πŸš€ Deployment

The Rock Spotter backend is **production-ready** and can be deployed in minutes to various cloud platforms!

### 🎯 One-Click Deploy

Choose your preferred platform and deploy instantly:

| Platform | Time | Free Tier | MongoDB | Best For |
|----------|------|-----------|---------|----------|
| [**Docker**](/Rock-Spotter/docker-compose.yml) | 1 min | βœ… | Included | Local/VPS |
| [**Railway**](https://railway.app) | 2 min | $5 credit | Included | Easiest |
| [**Render**](https://render.com) | 5 min | 750 hrs/mo | External | Beginners |
| [**Heroku**](https://heroku.com) | 5 min | 1000 hrs/mo | Add-on | Classic |

### ⚑ Quick Deploy Commands

**Docker (Fastest)**:
```bash
git clone https://github.com/jmenichole/Rock-Spotter.git
cd Rock-Spotter
docker-compose up -d

Railway (Easiest):

npm i -g railway
railway login && railway up

See QUICK-DEPLOY.md for one-line commands for all platforms!

πŸ“¦ Deployment Files Included

πŸ“– Complete Documentation

πŸ” Verify Your Deployment

./verify-deployment.sh https://your-api-url.com

Automatically tests all endpoints and confirms your API is working!

πŸ”’ Security

πŸ›£οΈ Roadmap

Phase 1 (Current)

Phase 2 (Upcoming)

Phase 3 (Future)

🀝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

πŸ“„ License

MIT License - see LICENSE file for details

πŸ™ Acknowledgments

Built for rock enthusiasts, geologists, educators, and anyone who loves exploring the natural world!


Happy Rock Hunting! πŸͺ¨πŸ”