Skip to content

Ground Station Setup

The following assumes that you have already read Initial Setup guide. You should be able to develop from any of the platforms mentioned: Linux, WSL or Mac.

  1. All our Ground Station code is hosted in the ground-station repository on our Github. So let’s clone that first. Run the following command in a directory of your choice to clone the repository:

    Terminal window
    # if you use https (common way of doing git)
    git clone https://github.com/UWOrbital/ground-station.git
    # or if you use SSH
    git clone git@github.com:UWOrbital/ground-station.git
  2. Setup the pre-commit by running the following command in the repository’s root directory:

    Terminal window
    pre-commit install
  3. Now you can follow either the Backend section for Backend setup or the Frontend for Frontend setup.

  1. Be sure to have python version 3.12 installed on your system.

  2. Install a python build tool called uv. Instructions can be found here.

  3. From the repository’s root run the following command to add all the necessary packages you need.

    Terminal window
    uv sync
  4. (Highly Recommended) If you are working with the database, you should set up Postgres as well. The guide can be found in the section below this one called Database Setup.

  5. Hopefully your database is now setup! To do a sanity check try running our test suite for the backend and see if some tests pass (some of them will fail, to get them working refer to Working with commands). Use the following commands from the root of the respository:

    Terminal window
    # Activate venv (choose the proper way to activate based on dev environment)
    source .venv/bin/activate
    # Run Pytest
    uv run pytest
  6. To run the backend from the root repository, and initialize the database (make sure the venv is activated):

    Terminal window
    fastapi dev backend/main.py
  7. Alternatively, if you have docker, run the docker scripts!

    Terminal window
    docker-compose -f scripts/dev/docker-compose.yml up --build
  1. Open a terminal and run the following commands to install PostgreSQL (make sure you are in the root of the ground-station repository):

    Terminal window
    sudo apt update
    sudo apt install postgresql-16
  2. Run sudo -u postgres psql --version to ensure PostgreSQL was installed properly. It should print that the major version is 16.

  3. Run the following commands to setup PostgreSQL for the ground station.

    Terminal window
    # Connect to PostgreSQL CLI as the postgres superuser
    sudo -u postgres psql
    # Replace your_username and your_password with your desired values
    CREATE USER your_username WITH PASSWORD 'your_password' SUPERUSER;
    CREATE DATABASE gs;
  4. Log out, then verify that you can log in to your newly created user and database:

    Terminal window
    \q # Log out
    # Replace your_username with your actual username
    psql -U your_username -d gs
    # You should be logged into the database
    \q # Log out again
  5. From the root directory, run the following commands to create a new .env file:

    Terminal window
    cp ./template.env ./.env
  6. Edit the .env file to add your login details for the database user you created in Step 3 in the quotes. In Linux/WSL, you can use vim or nano as the editor.

  7. From the root directory, run the following command to initialize your database with the correct schema:

    Terminal window
    sudo apt install alembic
    # Make sure you are running the venv located in .venv in the root directory
    source ./.venv/bin/activate
    cd backend
    alembic upgrade head
    # Go back to the root
    cd ..

    Your database should now be setup! Now you can revisit the Backend Setup section and do the remaining steps (Step 5 and 6)

  1. Install Nodejs on your systems using the instructions found here. It is recommended you choose the instructions for Linux or macOS using nvm.

  2. Go to the website of your choice in the frontend/ directory: either aro or mcc. Run the following command to install dependencies:

    Terminal window
    npm install
  3. To see a preview of the site you can run the following command to see a dev preview:

    Terminal window
    npm run dev
  4. Alternatively, if you have docker, run the docker scripts!

    Terminal window
    docker-compose -f scripts/dev/docker-compose.yml up --build

Before you get coding and build some amazing skills make sure you understand the task workflow which you can find below!