A Svelte-based frontend for the SpaceTraders API, connecting to the local SpaceTradersFrontAPI backend.
src/lib/api.ts)Centralized API client with functions for all backend endpoints:
fetchAgent() - Get agent informationfetchShips() - Get all shipsfetchShip(shipSymbol) - Get specific ship detailsshipAction(shipSymbol, action) - Execute ship actions (orbit, dock, extract, etc.)navigateShip(shipSymbol, waypointSymbol) - Navigate ship to waypointfetchSystem(systemSymbol) - Get system informationfetchWaypoint(systemSymbol, waypointSymbol) - Get waypoint detailsfetchMarket(systemSymbol, waypointSymbol) - Get market data/ - HomeLanding page with navigation links
/agent - Agent InfoDisplay agent information (name, ID, status)
/ships - Ships ListList all ships with basic info and links to details
/ships/[shipSymbol] - Ship Details/systems/[systemSymbol] - System ViewDisplay system information and list of waypoints
/systems/[systemSymbol]/waypoints/[waypointSymbol] - Waypoint DetailsView waypoint information including type, position, and orbitals
/systems/[systemSymbol]/waypoints/[waypointSymbol]/market - Market ViewDisplay market data with imports, exports, and trade goods in tables
src/lib/types.ts)TypeScript interfaces for:
The frontend connects to http://localhost:5000 with these endpoints:
GET /my/agent - Agent infoGET /ships - All shipsGET /ships/{shipSymbol} - Ship detailsGET /ships/{shipSymbol}/{action} - Ship actionsGET /ships/{shipSymbol}/navigate/{waypointSymbol} - NavigateGET /systems/{systemSymbol} - System infoGET /systems/{systemSymbol}/waypoints/{waypointSymbol} - Waypoint infoGET /systems/{systemSymbol}/waypoints/{waypointSymbol}/market - Market datanpm install
npm run dev
Ensure the SpaceTradersFrontAPI backend is running on port 5000.