Skip to content

@lakea/core

@lakea/core contains framework-agnostic code that can be used anywhere:

  • Types — TypeScript interfaces for all astronomical objects
  • App registry — Configuration for all Lakea apps
  • Routing — Cross-app link utilities (getAppLink)
  • Data fetchers — API clients (currently NASA, more planned)
import { Star, Galaxy, Exoplanet } from '@lakea/core';
packages/core/src/
├── types/ # All TypeScript interfaces
├── apps/ # App registry and configuration
├── routing/ # Cross-app link utilities
├── data-fetchers/ # API clients
│ └── nasa/ # NASA Exoplanet Archive (implemented)
│ # Planned:
│ # ├── static/ # JSON imports
│ # ├── tap/ # TAP protocol (Gaia, VizieR)
│ # └── sdss/ # SDSS SkyServer
# Planned directories:
# ├── transforms/ # Coordinate math
# ├── streaming/ # Web Worker utils
# └── utils/ # Math, stats helpers
interface Coordinates {
ra: number; // Right Ascension (degrees)
dec: number; // Declination (degrees)
distance?: number; // Parsecs
parallax?: number; // Milliarcseconds
}
// All objects extend CelestialObject
interface Star extends CelestialObject { type: 'star'; /* ... */ }
interface Galaxy extends CelestialObject { type: 'galaxy'; /* ... */ }
interface Exoplanet extends CelestialObject { type: 'exoplanet'; /* ... */ }
// Union type for any object
type AstronomicalObject = Star | Galaxy | Exoplanet;
interface QueryResult<T> {
data: T[];
totalCount: number;
source: DataSource;
pagination?: { offset: number; limit: number; hasMore: boolean };
}
  1. No framework dependencies — Works in Node, browsers, workers
  2. Strict types — No any, complete interfaces
  3. Pure functions — No side effects in transforms
  4. Async-first — All data fetching is async