Skip to content

Rami-Sabbagh/satellite-simulator

Repository files navigation

Satellite Simulator VI - Deluxe Edition

Satellite Simulator's Logo

CodeFactor

A university physics project for simulating satellites in orbit.

Installation instructions

  1. Clone the git repository locally or download the source-code and extract it.
  2. Install Node.js 16.x on your system.
  3. Enable Yarn through corepack, which ships with Node 16.x.
# Use an elevated shell (Administrator shell on Windows, sudo on Unix).
corepack enable
  1. Open a terminal in the root of the repository and install the project's dependencies.
yarn
  1. Start the development server.
yarn start
  1. A browser page should automatically open with the project running in it.

Tech stack

  • Three.js
  • TypeScript
  • Husky and ESLint
  • Webpack

Development Server

It's a webserver provided by webpack that serves the project while being built in realtime and stored in memory.

You can read more about it here, here and here.

Runs by default on port 9000 and so can be accessed at http://localhost:9000/ (should automatically open when starting the dev server).

Live Reload

When using the development server you'll have the benefit of automatic live reload whenever changes are made.

Hot Module Reload

The HMR support is enabled in the project, but the code has to support it.

Which means writing code that accepts the module replacements and does any adjustments needed.

That is implemented for src/app.ts in src/index.ts.

So when app.ts is modified it's hot reloaded without reloading the whole page, by replacing the old scene instance by a new one.

But when files such as src/physics/kepler-math.ts are modified with no HMR support, a whole page reload is automatically performed.

During the project development you might wish to implement HMR support for other sub-modules, for example to avoid losing the state of created scene objects.

You can read more at webpack's documentation page.

Build Instructions

After following the installation instructions run:

yarn build

The build can be then accessed at /dist and could be served as static page content.

Credits

Icons are from: https://www.svgrepo.com/

Satellite 3D model, under Creative Commons Attribution, was modified by RedDeadAlice.

Developed by