Skip to content

Repository files navigation

Floating Observatory logo

Floating Observatory

Focus sessions that grow a living 3D island

Pomodoro · Island builder · Streaks · Crew · Sealed saves · PWA · Docker

A deep-work game for desktop and phone: complete timed focus quests, earn crystals & energy, place and upgrade structures on a floating island, and come back tomorrow for streak bonuses.

Next.js React Three.js Docker TypeScript License: MIT GitHub Wiki

No backend · No account · Progress lives in your browser

Author: ArdaDDemir · Repo: floating-observatory · Wiki


Why this exists

Most Pomodoro timers are a countdown and a beep.
Floating Observatory turns focus into a place you maintain:

Loop What happens
Focus Start 5–60m quests (or custom). Ambient events drip small rewards mid-session.
Build Spend crystals & energy on towers, labs, shields, signal dishes.
Return Daily goals grow streaks. Miss a day → soft comeback gift. Fail → penalty, not a wipe.

Built as a portfolio-ready web game: polished UI, mobile shell, offline PWA, and clean code you can fork.


Features

Focus engine

  • Custom durations + presets
  • Pause / resume / abandon with fair penalties
  • Tags (coding, study, deep work…)
  • Ambient focus events + minute ticks
  • Break mode + zen HUD
  • Full procedural SFX (start, pause, complete, fail…)

Island & meta

  • 5 building types · CoC-style visual tiers
  • Tap a building → upgrade / relocate / destroy
  • Tap a crew NPC → assign a work post
  • 7 crew roles · roster grows 2→12 with level
  • Research, cosmetics, achievements, journal

Technical craft

  • React Three Fiber island + post FX
  • Zustand + sealed localStorage (integrity hash)
  • Anti-tamper meteor “justice”
  • Graphics Auto / Low / High
  • Royalty-free Web Audio (no sample packs)

Ship-ready UX

  • Desktop + phone + landscape
  • PWA + offline shell (production)
  • Wake lock + haptics
  • Sealed export / import

Sound (royalty-free)

All audio is generated at runtime with the Web Audio API — no MP3/WAV assets, no third-party packs.

Area Examples
Session Start, pause, resume, complete, daily goal, fail, lockout
Focus Event loot / flavor, minute tick, halfway, final stretch
Island Place, upgrade, destroy, relocate, build mode on/off
Crew Select NPC, assign post, new recruit join
UI / meta Research, achievement, toggles, export/import, meteor

Toggle in Settings → Sound cues (on by default).


Quick start

Requirements: Node.js 20+ recommended, npm 10+

git clone https://github.com/ArdaDDemir/floating-observatory.git
cd floating-observatory

# install
npm install

# develop
npm run dev

Open http://localhost:3000

# production (enables service worker / offline shell)
npm run build
npm start

Docker (one command)

# build + run on http://localhost:3000
docker compose up --build

Or without Compose:

docker build -t floating-observatory .
docker run --rm -p 3000:3000 floating-observatory

Production image uses Next.js output: "standalone" when DOCKER_BUILD=1 (see Dockerfile).

One-click deploy

Forks the repo into your account and deploys. No env vars required (client-only game).

Platform Button
Vercel Deploy with Vercel
Netlify Deploy to Netlify
Railway Deploy on Railway
Render Deploy to Render

Direct links (if a badge fails to load):

Self-host with Docker above, or any host that runs npm run build && npm start (Node 20+).


Controls

Input Action
Space Pause / resume focus
B Toggle build mode (place tray)
M Open Lab (meta)
Z Zen mode
Esc Close panels / clear selection
Click building Open upgrade / manage card
Click NPC Assign crew to a building post
Touch 1 finger orbit · 2 finger zoom · tap to place / select

Project structure

src/
├── app/                 # Next.js App Router (layout, PWA icons, manifest)
├── components/
│   ├── Scene.tsx        # R3F canvas, island, lights, orbit
│   ├── GameHUD.tsx      # Main UI: timer, build, resources
│   ├── buildings/       # Per-type 3D models
│   └── …panels          # Settings, Lab, Guide, Stats
├── store/useGameStore.ts# Game state, economy actions, persist
├── lib/
│   ├── gameConfig.ts    # Costs, rewards, fail math  ← tweak economy
│   ├── meta.ts          # Streaks, research, achievements
│   ├── events.ts        # Ambient focus events
│   ├── crew.ts          # Crew roles & buffs
│   ├── save.ts          # Sealed save v3 + hash
│   └── perf.ts          # Graphics profile / mobile scale
├── hooks/               # Mobile, wake lock, graphics, hotkeys
public/
├── sw.js                # Offline shell service worker
└── offline.html

Docs & Wiki

Doc What’s inside
GitHub Wiki Play guide, buildings, crew, sound, Docker, FAQ
docs/GUIDE.md Player-facing systems overview
docs/CUSTOMIZING.md Change economy, buildings, events, branding
docs/ARCHITECTURE.md Data flow, save seal, render pipeline
docs/DOCKER.md Docker / Compose
CONTRIBUTING.md Local workflow & PR notes

Wiki source lives in wiki/ — publish with pwsh scripts/push-wiki.ps1 after the first wiki page exists on GitHub.


Tech stack

Note: this repo’s Next version may differ from older tutorials. Prefer the docs under node_modules/next/dist/docs/ when extending framework APIs.


Customize in 60 seconds

// src/lib/gameConfig.ts
export const STARTING_CRYSTALS = 150;
export const STARTING_ENERGY = 150;

// Rewards ≈ minutes × 1.05 (see rewardsForDuration)
// Building costs live in BUILDINGS record
// src/lib/meta.ts — streak multipliers, research costs, daily goal default
export function streakRewardMultiplier(currentStreak: number) { … }

Full map of knobs: docs/CUSTOMIZING.md


Screenshots

Real captures from the running app (Playwright · regenerate with npm run screenshots).

Desktop

Desktop — idle island and New Focus Quest panel

Idle hub — resources, streak, tags, duration presets, full 3D island

Focus session Build mode
Focus Build
Building picker detail Field manual
Select Guide
Lab research Paused session
Lab Paused

Mobile

Island (compact chrome) Quest sheet
Mobile idle Mobile quest
Focus timer Settings (bottom sheet)
Mobile focus Settings

Tablet / landscape

Tablet landscape build mode

Buildings at a glance

Five placeable structures appear on the island and in the build tray:

Building Role
Energy Core +% energy from sessions
Data Tower +% crystals from sessions
Botany Lab Dual small bonus
Shield Gen Softens fail penalties
Signal Dish Stronger ambient event loot

See the build tray screenshot above for costs and icons.

Crew roles (grow with observatory level)

Role Buff when assigned
Worker Cheaper upgrades
Gardener Botany Lab bonus
Scout Better event loot
Engineer Energy Core / shield energy
Caretaker Extra fail mitigation
Archivist Data Tower crystals
Courier Small dual bonus on any post

Start with 2 crew · unlock up to 12 as the observatory levels.


Roadmap ideas (fork-friendly)

  • Cloud optional sync (still local-first)
  • Shared island cosmetics packs
  • Soundscape packs per tag
  • Steam / Capacitor shell (same web core)

PRs and stars appreciated ⭐


License

MIT — see LICENSE.
Built by ArdaDDemir as a focus toy and a code showcase. Go ship your own island.

About

Focus sessions that grow a living 3D island — Pomodoro + island builder (Next.js, R3F, PWA)

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages