Skip to content

rohitg00/time-traveller

Repository files navigation

๐ŸŒ€ Time Traveller - Visit Any Place, Any Era with AI

Time Traveller Gemini Motia Vercel

Travel anywhere in the world, across any time period. See yourself in history!

๐Ÿš€ Live Demo โ€ข โญ GitHub โ€ข ๐Ÿ“– Docs

Time Traveller


๐Ÿ–ผ๏ธ Screenshots


Complete UI

Authentication

AI Generation

Location Intelligence

Nearby Places

Terminal Mode

Motia Workbench

Motia Cloud

Request Tracing

โœจ Key Features

Feature Description
๐Ÿค– AI Image Generation 2K photorealistic images via Gemini 3 Pro (Nano Banana)
๐Ÿ—บ๏ธ Street View Integration Real Google Maps imagery as AI context
๐ŸŒฆ๏ธ Location Intelligence Weather, air quality, nearby places
๐Ÿ” Secure Auth Google/GitHub OAuth via Supabase
๐Ÿ”’ Private History Your travel history is only visible to you
๐Ÿ‘ค Traveler Insertion Insert yourself into any scene
๐ŸŽจ 5 Art Styles Photorealistic, Cyberpunk, Renaissance, Impressionist, Baroque
๐Ÿ•ฐ๏ธ Any Era Ancient Rome to 2150+
โšก Real-time Streaming Live progress via Motia Streams
๐ŸŽ™๏ธ Audio Narration AI-generated voice descriptions

๐Ÿš€ Quick Start

Prerequisites

Installation

git clone https://github.com/rohitg00/time-traveller.git
cd time-traveller
npm install

Configuration

Create .env in project root:

# AI & Maps
GEMINI_API_KEY=your_gemini_key
GOOGLE_API_KEY=your_google_maps_key
VITE_GOOGLE_API_KEY=your_google_maps_key

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key

# JWT
JWT_SECRET=your_secret
JWT_EXPIRATION=24h

Launch

# Terminal 1: Backend
npm run backend

# Terminal 2: Frontend
npm run dev
Service URL
App http://localhost:5173
API + Workbench http://localhost:3000

๐ŸŽฎ How to Use

Three Input Modes

Mode How It Works
๐Ÿ“‹ Manual Enter destination, era, style, upload photo
๐Ÿ’ป Terminal Natural language: "Take me to Paris in 1889"
๐ŸŒ Orbital Click map, search address/pincode, see weather & places

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              React Frontend (Vite)                   โ”‚
โ”‚                localhost:5173                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚               โ”‚
           REST API        WebSocket Streams
                  โ”‚               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Motia Backend Framework                 โ”‚
โ”‚                localhost:3000                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  API Steps          โ”‚  Event Steps                  โ”‚
โ”‚  โ€ข /teleport        โ”‚  โ€ข GenerateImage              โ”‚
โ”‚  โ€ข /auth            โ”‚  โ€ข GenerateLocationDetails    โ”‚
โ”‚  โ€ข /history         โ”‚  โ€ข SynthesizeSpeech           โ”‚
โ”‚  โ€ข /location/info   โ”‚  โ€ข CompleteTeleport           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚               โ”‚
          Gemini AI        Google Maps API

๐Ÿ“ก API Reference

Endpoint Method Description
/teleport POST Start time travel
/teleport/:id GET Get progress/results
/teleport/:id/audio GET Get narration
/history GET User's travel history
/auth POST Exchange Supabase token
/user GET Get authenticated user
/location/info GET Weather, AQI, places
/parse-command POST Parse natural language

๐Ÿงฐ Tech Stack

Backend Frontend
Motia Framework React 19 + Vite
TypeScript + Zod Tailwind CSS
Redis Google Maps API
Gemini 3 Pro Supabase Auth
Supabase Storage WebSocket Streams

๐Ÿš€ Deployment

Motia Cloud (Backend)

Option 1: GitHub Actions (Recommended)

Automatic deployment on every push to main:

  1. Add GitHub Secrets (Settings โ†’ Secrets โ†’ Actions):

    Secret Description Where to Get
    MOTIA_API_KEY Motia Cloud API key Motia Cloud โ†’ Settings โ†’ API Keys
    MOTIA_ENV_ID Environment ID Motia Cloud โ†’ Your Project โ†’ Settings
    GEMINI_API_KEY Google Gemini API key aistudio.google.com
    GOOGLE_API_KEY Google Maps API key Google Cloud Console
    SUPABASE_URL Supabase project URL supabase.com โ†’ Project Settings
    SUPABASE_KEY Supabase anon key Supabase โ†’ Project Settings โ†’ API
    SUPABASE_SERVICE_ROLE_KEY Supabase service role key Supabase โ†’ Project Settings โ†’ API
    JWT_SECRET Secret for signing JWTs Generate: openssl rand -base64 32
    GOOGLE_MAPS_MAP_ID Map ID for Advanced Markers Google Cloud Console
  2. Push to main - Deployment triggers automatically!

  3. Manual Deploy - Go to Actions โ†’ "Deploy to Motia Cloud" โ†’ "Run workflow"

# .github/workflows/deploy.yml - Already configured!
# Auto-generates version: v1.0.X based on commit count

Option 2: Manual via Workbench

  1. Start local backend: npm run backend
  2. Go to cloud.motia.dev
  3. Import from Workbench โ†’ Add env vars โ†’ Deploy

Option 3: CLI

npx motia cloud deploy \
  --api-key <MOTIA_API_KEY> \
  --project-name time-traveller \
  --environment-id <MOTIA_ENV_ID> \
  --version-name v1.0.0 \
  --env-file .env

Vercel (Frontend)

  1. Fork repo on GitHub
  2. Import to vercel.com/new
  3. Add environment variables:
    • VITE_API_URL = your Motia Cloud URL
    • VITE_WS_URL = your Motia Cloud WebSocket URL
    • VITE_GOOGLE_API_KEY
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY

๐Ÿ› Troubleshooting

Issue Solution
API key errors Check .env exists, restart backend
Street View unavailable Normal! AI generates without it
WebSocket failed Falls back to polling automatically
Frontend not loading Ensure both servers running
"Failed to authorize stream" errors Expected - Motia Workbench trying to connect before auth. Harmless, can be ignored. Only affects dev Workbench at :3000, not the app at :5173

๐Ÿ“ Project Structure

time-traveller/
โ”œโ”€โ”€ frontend/           # React app
โ”‚   โ”œโ”€โ”€ components/     # UI components
โ”‚   โ”œโ”€โ”€ contexts/       # Auth context
โ”‚   โ””โ”€โ”€ assets/         # Static files
โ”œโ”€โ”€ steps/              # Motia backend
โ”‚   โ”œโ”€โ”€ api/            # REST endpoints
โ”‚   โ”œโ”€โ”€ events/         # Background handlers
โ”‚   โ”œโ”€โ”€ middlewares/    # Auth middleware
โ”‚   โ””โ”€โ”€ streams/        # Real-time updates
โ”œโ”€โ”€ services/           # Business logic
โ”‚   โ”œโ”€โ”€ gemini/         # AI services
โ”‚   โ”œโ”€โ”€ google/         # Maps APIs
โ”‚   โ””โ”€โ”€ supabase/       # Auth & storage
โ””โ”€โ”€ docs/img/           # Screenshots

๐Ÿ”’ Privacy & Data Storage

Your data is private and secure. Here's how we handle it:

Data Type Storage Access
Travel History Supabase Database Only you (authenticated)
Generated Images Supabase Storage Only you (via your history)
Audio Narrations Supabase Storage Only you (via your history)
Reference Photos Supabase Storage Only you (linked to your teleport)

How It Works

  • User Isolation: Each user's history is stored with their unique userId
  • Authenticated Access: History API requires valid JWT token
  • No Cross-User Access: You cannot see other users' travels, and they cannot see yours
  • Secure Storage: All images and audio are stored in private Supabase buckets
  • No Data Sharing: Your uploaded photos and generated content are never shared

๐Ÿ’ก Note: When not logged in, history is stored locally in your browser's localStorage and is completely private to your device.


โœจ What's New

  • ๐Ÿ” Supabase Auth - Google/GitHub OAuth with user isolation
  • ๐Ÿ”’ Private History - Each user only sees their own travels
  • ๐ŸŒฆ๏ธ Location Intelligence - Weather, AQI, nearby places
  • ๐Ÿ” Address Search - Search by pincode/address
  • ๐Ÿ‘ค Traveler Insertion - Insert yourself into scenes
  • โ˜๏ธ Cloud Storage - Images stored securely in Supabase
  • ๐ŸŒˆ Weather Animations - Dynamic background effects
  • ๐ŸŽ™๏ธ Audio Playback - Play/abort audio narration controls

๐Ÿค Contributing

Fork, experiment, and share your coolest time travels!

โญ Star on GitHub


Built with Motia ๐Ÿ’™ | Powered by Gemini ๐ŸŒ

Made by Rohit Ghumare

GitHub stars

About

Experience any location across time with AI-powered visualization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors