An Open Source, Real World Scavenger Hunt type competition game for team play.
Find a file
2026-03-24 18:48:00 -05:00
backend Added settings for user data deletion 2026-03-21 12:23:20 -05:00
frontend Added settings for user data deletion 2026-03-21 12:23:20 -05:00
node_modules Added settings for user data deletion 2026-03-21 12:23:20 -05:00
application_requirements.md Initial commit 2026-03-18 09:02:21 -05:00
docker-compose.yml tiny update 2026-03-18 11:29:27 -05:00
package-lock.json Added settings for user data deletion 2026-03-21 12:23:20 -05:00
package.json Initial commit 2026-03-18 09:02:21 -05:00
README.md Lots of settings updates, and README updates. 2026-03-24 18:48:00 -05:00

Treasure Trails

An online scavenger hunt application where Game Masters create and manage hunts, Teams compete to complete clues, and Spectators can follow along in real-time.

Inspration

Scavenger Hunts, of course, but also a Movie from my childhood called "Midnight Madness". A game master creates teams from people he knows at his University. The Jocks, The Nerds, The awkward girls, and the average guy / girl mix. Yep, as cliche as you can get. BTW - Michael J Fox's first movie role as a young teen.

Game Play

Game Master

Users can create a game, making them the Game Master. Give your game a name, and if you'd like a prize for the winner(s). Set the radius of the map the game legs and objectives should remain within. Set game rules for all to read and abide by. Set default leg time-outs, and time based penalty periods for taking too long, or breaking rules. And get on with creating routes.

You can create 1 route for all teams to use, or you can create multiple routes, perhaps 1 per team. The system sows distance totlas for each route, so you can make sure they are approximately equal if needed.

You can invite players who will make teams, and keep the game private, or you can make a public game, which still allows invites, but you can also allow useers to simply join a game and make their team.

Game masters devise routes which can each have multiple legs and a clue for each leg. The game allows for taking a photo to prove the completion of the objective of a leg, or perhaps you want to encourage patronage at local businesses so you make it a purchase leg (where they still send a photo fo their purchase and receipt). It's all in good fun.

Teams and Team Members

Once the teams are formed, and the routes, legs, and clues set, the game master will start the game.

The temas will attempt to solve a clue (if needed), and get to their first objective in the allotted time for the leg. Provide the required proof, and the game master will approve or deny their ability to go to the next leg.

The game master will control the game from the game master dashboard, where the game master see's all temas' locations on the map, which leg they are on, and can chat with teams as needed.

The temas have the mobile version which runs right in your mobile device browser. Recommeneded to just have the team captain's device for the game. Don't leave the browser window during the game, or take a chance on a time based deduction, or removal from the game. Allow location tracking, and your team is set.

Use the map, built in photo taking options, and chat as needed to get clues, and complete objectives. And be the first team to the end.

Spectators

Part of "Midnight Madness" was how the Game Master's neighbors all got into the game and made it as exciting from the control room as it was on the streets.

With that in mind, public games will have a spectator mode, they'll be able to follow the team progression throughout the race.

Could there be something where a spectator could assist the Game Master in some way? I need to ponder this a bit.

Who would ever use this?

Well, me... I have an annual family reunion, and I think my family would have a blast with something like this.

Also, perhaps as a way to earn money for charity, or just a sa way to have local activities that people can join in on. It's a great way to get out of the house.

What about the Game Master? Don't forget, in the movie the game master moved to the final objective to meet the teams and be there to personally congratulate the winners. His neighbors all went with him as well. A laptop, and mobile hotspot, or tablet would likely be ideal for such mobility in this day and age!

In the end, this was a great way for me to work with an AI system that was doing the heavy lifting. It let me learn a lot about how AI operates when building applications, and how best to interact with the AI in the process.

Features

  • Game Master Dashboard:
    • Create scavenger hunts with routes which can each have mutliple legs and clues,
    • Manage live games,
    • View team progress
  • Team Interface:
    • Mobile-friendly gameplay with clues
    • Map navigation,
    • Photo submissions, and
    • Real-time chat
  • Spectator View:
    • Public dashboard showing team positions and leaderboard
  • Real-time Updates:
    • Live tracking via WebSockets (Socket.io)
  • OpenStreetMap Integration:
    • All maps use OpenStreetMap data

Tech Stack

Component Technology
Frontend Vue 3 + TypeScript + Vite
Backend Node.js + Express
Real-time Socket.io
Database PostgreSQL + Prisma
Maps Leaflet + OpenStreetMap

Prerequisites

  • Node.js 20+ (for local development)
  • Docker & Docker Compose

Quick Start with Docker

Install Docker and Docker Compose

curl https://get.docker.com | sh

The easiest way to run the application:

# Start all services (PostgreSQL, Backend, Frontend)
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

The application will be available at:

Local Development

1. Clone and Install Dependencies

# Backend
cd backend
npm install

# Frontend
cd ../frontend
npm install

2. Set Up Database

Create a PostgreSQL database:

# Connect to PostgreSQL
psql -U postgres

# Create database
CREATE DATABASE treasure_trails;

Update the database connection in backend/.env:

DATABASE_URL="postgresql://postgres:your_password@localhost:5432/treasure_trails?schema=public"

3. Initialize Database Schema

cd backend
npx prisma generate
npx prisma db push

4. Run the Backend

cd backend
npm run dev

The backend API will run on http://localhost:3001

5. Run the Frontend

cd frontend
npm run dev

The frontend will run on http://localhost:5173

Usage

As a Game Master

  1. Register a new account
  2. Go to Dashboard and click "Create New Game"
  3. Fill in game details and click on the map to set the treasure location
  4. Click "Create Game" to save as draft
  5. Click "Edit Game" to add routes / legs / clues
  6. Once legs are added, click "Publish Game" to make it live
  7. Use the "Live Dashboard" to monitor teams

As a Team Member

  1. Register or login
  2. Browse public games or use an invite link
  3. Join a game by creating a team (3-5 members) or joining an existing team
  4. During the game, use the "Play" interface to:
    • View current clue
    • See your position on the map
    • Submit photo proof
    • Chat with other teams and the Game Master

As a Spectator

  1. Navigate to any public live game
  2. Click "Spectate" to view:
    • Live map with all team positions
    • Leaderboard showing progress

Project Structure

/home/brian/Development/scavenge
├── docker-compose.yml          # Docker Compose configuration
├── backend/
│   ├── Dockerfile              # Backend container
│   ├── prisma/
│   │   └── schema.prisma      # Database schema
│   ├── src/
│   │   ├── index.ts           # Server entry point
│   │   ├── middleware/
│   │   │   └── auth.ts        # JWT authentication
│   │   ├── routes/
│   │   │   ├── auth.ts        # Auth endpoints
│   │   │   ├── games.ts       # Game CRUD
│   │   │   ├── legs.ts        # Leg/clue management
│   │   │   ├── teams.ts       # Team management
│   │   │   └── upload.ts      # File uploads
│   │   └── socket/
│   │       └── index.ts       # Socket.io handlers
│   ├── .env                   # Environment variables
│   └── package.json
├── frontend/
│   ├── Dockerfile              # Frontend container
│   ├── nginx.conf             # Nginx configuration
│   ├── src/
│   │   ├── pages/             # Vue page components
│   │   ├── stores/            # Pinia state management
│   │   ├── services/          # API service
│   │   ├── types/             # TypeScript types
│   │   ├── router/            # Vue Router config
│   │   ├── App.vue
│   │   └── main.ts
│   └── package.json
├── application_requirements.md # Original requirements
└── README.md                  # This file

API Endpoints

Authentication

  • POST /api/auth/register - Create account
  • POST /api/auth/login - Login
  • GET /api/auth/me - Get current user

Games

  • GET /api/games - List public games
  • GET /api/games/my-games - List user's games
  • POST /api/games - Create game
  • GET /api/games/:id - Get game details
  • PUT /api/games/:id - Update game
  • POST /api/games/:id/publish - Publish game
  • GET /api/games/:id/invite - Get invite code

Legs

  • POST /api/legs/game/:gameId - Add leg
  • PUT /api/legs/:legId - Update leg
  • DELETE /api/legs/:legId - Delete leg
  • POST /api/legs/:legId/photo - Submit photo

Teams

  • GET /api/teams/game/:gameId - List teams
  • POST /api/teams/game/:gameId - Create team
  • POST /api/teams/:teamId/join - Join team
  • POST /api/teams/:teamId/advance - GM advances team
  • POST /api/teams/:teamId/deduct - GM applies time penalty
  • POST /api/teams/:teamId/disqualify - GM disqualifies team

Socket Events

  • join-game - Join a game's socket room
  • team-location - Broadcast team position
  • chat-message - Send/receive chat
  • team-advanced - Notify team advancement

Environment Variables

Backend (.env)

DATABASE_URL="postgresql://..."
JWT_SECRET="your-secret-key"
PORT=3001

License

MIT