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.
General setup
Section titled “General setup”-
All our Ground Station code is hosted in the
ground-stationrepository 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 SSHgit clone git@github.com:UWOrbital/ground-station.git -
Setup the pre-commit by running the following command in the repository’s root directory:
Terminal window pre-commit install -
Now you can follow either the Backend section for Backend setup or the Frontend for Frontend setup.
Backend setup
Section titled “Backend setup”-
Be sure to have python version 3.12 installed on your system.
-
Install a python build tool called
uv. Instructions can be found here. -
From the repository’s root run the following command to add all the necessary packages you need.
Terminal window uv sync --extra dev -
(Highly Recommended) If you are working with the database, you should set it up as well. The guide can be found below in the Database Setup section.
-
To run the backend, run the following from the repository root:
Terminal window # Make sure the db container is running if it isn't alreadydocker compose up -d postgres# Run the backend serveruv run fastapi dev backend/main.py# Or if virtual environment is activatedfastapi dev backend/main.py -
To run tests, use the following command:
Terminal window uv run pytest# Or if virtual environment is activatedpytest
Database setup
Section titled “Database setup”-
Install Docker and Docker Compose with the official installation guide
-
Verify the installation by running the following commands in your terminal.
Terminal window docker --versiondocker-compose --version -
Make sure you are added to the docker group:
Terminal window sudo usermod -aG docker $USER -
Log out and log back in to apply the docker group changes.
-
From the root directory, run the following commands to create a new
.envfile:Terminal window cp ./template.env .env -
Start the database by running the following command:
Terminal window docker compose up postgres -d # Start the container in detached mode -
Check that the database is running properly:
Terminal window docker ps # List all running containers and get the container ID (first column)docker logs <container_id> # View the logs of the database container: make sure there are no errorsReplace
<container_id>with the actual container ID from the output ofdocker ps, or use the container name in the NAME column. -
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 directorysource .venv/bin/activatecd backendalembic upgrade head# Go back to the rootcd ..Your database should now be setup! Now you can revisit the Backend Setup section and do the remaining steps (Step 5 and 6)
If you ever want to stop the database, run the following:
Terminal window # Stops all running containers related to this projectdocker compose down# Alternatively, if you need to keep other containers running, use:docker stop <container_id># The container_id can be found using `docker ps`
Frontend setup
Section titled “Frontend setup”-
Install Nodejs on your systems using the instructions found here. It is recommended you choose the instructions for
LinuxormacOSusingnvm. -
Go to the website of your choice in the
frontend/directory: eitheraroormcc. Run the following command to install dependencies:Terminal window npm install -
To see a preview of the site you can run the following command to see a dev preview:
Terminal window npm run dev -
Alternatively, if you have docker, run the docker scripts!
Terminal window docker-compose up --build
Contributing
Section titled “Contributing”Before you get coding and build some amazing skills make sure you understand the task workflow which you can find below!