Get Rock Spotter up and running in 5 minutes!
cd backend
npm install
cp .env.example .env
Edit .env if needed (defaults work for local development):
PORT=3000
MONGODB_URI=mongodb://localhost:27017/rock-spotter
JWT_SECRET=rock-spotter-secret-key-change-this-in-production
npm start
You should see:
MongoDB connected successfully
Rock Spotter API server running on port 3000
curl http://localhost:3000/api/health
curl -X POST http://localhost:3000/api/users/register \
-H "Content-Type: application/json" \
-d '{
"username": "rockfan",
"email": "fan@rocks.com",
"password": "rocks123"
}'
Save the token from the response!
curl -X POST http://localhost:3000/api/rocks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"title": "My First Rock",
"description": "A beautiful granite specimen",
"location": {
"type": "Point",
"coordinates": [-122.4194, 37.7749],
"address": "San Francisco, CA"
},
"rockType": "igneous",
"tags": ["granite", "first"],
"isPublic": true
}'
curl http://localhost:3000/api/rocks
Create a Hunt:
curl -X POST http://localhost:3000/api/hunts \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"title": "First Hunt",
"description": "Find 3 rocks!",
"rocks": [],
"difficulty": "easy",
"startDate": "2025-10-17T00:00:00Z",
"endDate": "2025-10-24T23:59:59Z"
}'
View Achievements:
curl http://localhost:3000/api/achievements
MongoDB not running?
# Start MongoDB (macOS)
brew services start mongodb-community
# Start MongoDB (Linux)
sudo systemctl start mongod
Port 3000 already in use?
Change the PORT in .env file to 3001 or another available port.
Need help?
Check the full documentation:
Want to deploy quickly? Use Docker!
# Clone and start everything
git clone https://github.com/jmenichole/Rock-Spotter.git
cd Rock-Spotter
docker-compose up -d
# Check if it's running
curl http://localhost:3000/api/health
This starts both the API and MongoDB automatically!
Render (Free tier available):
Railway ($5 free credit):
npm install -g railway
railway login
railway init
railway add # Add MongoDB
railway up # Deploy!
See DEPLOYMENT.md for detailed cloud deployment guides.
You’re all set! Start sharing rocks! 🪨✨