How navigraph/navigraph-js-sdk works
And define the main components
• Monorepo structure: Represent the overall project as a monorepo that encapsulates various interrelated packages.
• Navigraph App (packages/app)
• Navigraph Auth (packages/auth)
• Navigraph Charts (packages/charts)
• Other related packages such as amdb, leaflet, weather, and packages (which itself aggregates package-related functionality)
• The “navigraph” package that further organizes or aggregates these
• Examples/Demos: Include the “examples” folder with separate demos (e.g., “getting-started” and “playground”) that show how end-users integrate the SDK into full-stack applications.
Component relationships and interactions
• Examples as consuming the public API exposed by these packages and demonstrating the internal interactions.
Architectural patterns
• Separation of concerns: Note that each package handles a distinct domain (e.g., authentication, chart retrieval, weather data), following modular design principles.
• API Layer Abstraction: Illustrate that packages abstract over underlying Navigraph API endpoints and external services used by Microsoft Flight Simulator and similar environments.
Technologies and tools
• TypeScript/JavaScript is the primary language.
• Vite is used in example projects (as seen from vite.config.ts).
• Testing is integrated via Jest (jest.config.js files are present in several packages).
• Code quality and formatting tools such as ESLint and Prettier are configured.
• Build tools like tsup and Turbo are used for bundling and managing tasks.
• At the highest level, display the Monorepo container that holds subcomponents.
– An “Initialization & Core” section (navigraph/app, including the initializeApp function).
– “Authentication” (navigraph/auth) showing API calls (sign in, token management).
– “Data Services” such as charts, weather, and amdb, each with their APIs.
– “Presentation/Examples” (the examples directory), which consume and showcase how these packages work together.
• With the relevant details (e.g., “calls getAuth()”, “retrieves charts index”) tied to the example code in the README.