Interactive 3D solar system simulation with true-to-scale visualization, two simulation modes (speed/date), and scientific data fallback from local dataset + remote API proxy.
- True-to-scale solar system visualization in 3D
- Speed Mode and Date Mode (toggleable)
- Date transition animation with easing + cancel support
- Historical events panel with search/filter/date jump
- Orbit paths with orbital inclination support
- Asteroid belt regions (main + Kuiper) toggle
- Planet textures, atmospheric glow, rings
- API fallback model:
- First try internal API route (
/api/planets/[name]) - If API fails, use local static data
- First try internal API route (
- Caching:
- Client cache for merged API results (
localStorage) - Astronomy calculation cache (hour-bucketed) for Date Mode performance
- Client cache for merged API results (
- Web Worker for rotation calculations with main-thread fallback
- React 19
- TypeScript 5
- Vinext + Vite 8
@react-three/fiber+three+@react-three/drei- Tailwind CSS 4
astronomy-engine- Vitest + Testing Library
- Wrangler (Cloudflare deployment workflow)
src/app/App entry + API routesrc/components/shared UI and scene primitivessrc/features/feature-first modules:solar-systemapplication/orchestration + state compositionui/scene content + overlays
date-modeplanet-catalogsimulation-controlplanet-renderinghistorical-eventsplanet-modalrotation-workerbelt-regions
src/lib/library modules (planet texture config/loaders)src/shared/ui/shared UI helpers (for examplecn)src/utils/shared domain/math/formatting/validation helperssrc/data/remaining static data modules__tests__/unit and integration tests
- Node.js 18+
- pnpm 10+
pnpm installcp .env.local.example .env.localSet SOLAR_SYSTEM_API_KEY in .env.local if you want authenticated upstream requests.
Without it, the app still works via fallback local data.
pnpm devpnpm dev- run dev serverpnpm build- production buildpnpm start- start production serverpnpm deploy- deploy flow via Vinextpnpm lint- ESLintpnpm test- Vitest run oncepnpm test:watch- Vitest watchpnpm test:ui- Vitest UI
Internal route: GET /api/planets/[name]
- Runtime: Edge
- Upstream:
https://api.le-systeme-solaire.net/rest/bodies/{planet} - Timeout: 10 seconds
- Accepted planets:
mercury,venus,earth,mars,jupiter,saturn,uranus,neptune - Invalid planet names return HTTP
400
- Date input is parsed in local time to avoid UTC off-by-one day issues.
- Astronomy cache is bucketed by hour for better accuracy/performance balance in Date Mode.
- TypeScript build errors are not ignored during build, so type regressions fail fast in CI/deploy.
Run full checks:
pnpm lint && pnpm testSecurity audit:
pnpm audit --prodMIT. See LICENSE.