Skip to content

etaque/rewind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rewind

Multiplayer sailing game: offshore races against real historical wind conditions, accelerated in time. Ride weather systems around the world in minutes.

Features

  • Real wind data - Historical GRIB wind forecasts from Vendée Globe 2020
  • Multiplayer - WebRTC peer-to-peer racing with lobby system
  • Realistic physics - IMOCA 60 polar diagrams for boat speed
  • 3D globe - Interactive Earth with wind visualization (particles + heatmap)
  • Boat controls - Arrow keys to steer, space to tack, up arrow to lock TWA

Development

Create a .env at root from sample.env.

Prerequisites

Install cargo-watch for auto-reload:

cargo install cargo-watch

Start Services

Start Minio:

./server/bin/container up

Start the server:

cd server
./bin/dev-server

Start the client:

cd client
npm install
npm run dev

Ports:

Container Commands

./server/bin/container up       # Start minio
./server/bin/container down     # Stop containers
./server/bin/container logs     # Follow logs
./server/bin/container migrate  # Run migrations
./server/bin/container destroy  # Remove containers and volumes

Tech Stack

Client:

  • React 18 + TypeScript
  • Vite
  • D3.js for globe projection and zoom/pan
  • WebGL for wind texture rendering
  • WebRTC for peer-to-peer multiplayer
  • Tailwind CSS

Server:

  • Rust with Tokio async runtime
  • Warp web framework (HTTP + WebSocket)
  • S3 for wind raster storage

Infrastructure

Requirements

  • AWS account with credentials configured
  • Terraform
  • Fly.io CLI (fly) authenticated

Provisioning

AWS (S3 + CloudFront):

cd infra
terraform init
terraform apply

This creates:

  • ACM certificate for rewind.taque.fr
  • S3 buckets for GRIB files and wind rasters
  • CloudFront distribution for the client

After terraform apply, add DNS records in your DNS provider:

  • rewind CNAME → CloudFront domain (from terraform output cloudfront_domain)
  • ACM validation CNAMEs (from terraform output acm_validation_records)

Fly.io (Server):

cd server
fly launch --no-deploy

# Set secrets
fly secrets set \
  RUST_LOG=info \
  REWIND_S3_GRIB_BUCKET=rewind-gribs \
  REWIND_S3_RASTER_BUCKET=rewind-wind-rasters \
  REWIND_S3_ENDPOINT=https://s3.eu-west-3.amazonaws.com \
  REWIND_S3_REGION=eu-west-3 \
  REWIND_S3_ACCESS_KEY=<from terraform> \
  REWIND_S3_SECRET_KEY=<from terraform>

Deployment

Client

Requires AWS CLI with profile rewind-frontend-uploader configured:

aws configure --profile rewind-frontend-uploader
# Use access key from: terraform state show aws_iam_access_key.frontend_uploader
# Use secret from: terraform output frontend_uploader_secret

Deploy:

./client/bin/deploy

Server

./server/bin/deploy

Scripts

Import Vendée Globe 2020 GRIB files:

fly ssh console
rewind import-grib-range --from 2020-11-01 --to 2021-01-27

About

Sailing game idea playground

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •