Skip to content
Syed Yead Zaman edited this page Sep 14, 2025 · 7 revisions

Rover UI Wiki

This is the wiki page for the Rover UI.

Introduction

The Rover UI uses sveltekit to create a frontend and a backend for the Rover application.

Technologies Used

  • SvelteKit
  • Tailwind CSS
  • Drizzle ORM
  • ros2
  • PostgreSQL
  • Docker
  • GitHub Actions

Installation and Setup

Need to have node and npm installed.

  1. Clone the repository
  2. Run npm install to install dependencies
  3. Run npm run dev to start the development server
  4. Open http://localhost:5173 in your browser to view the application

You will also need to have the database running. You can use the docker-compose.yml file in the root of the repository to start the database, however be sure to comment out the rover-ui service in the docker-compose.yml if you are running the project locally.

  1. Run docker-compose up -d to start the database
  2. The database will be running on localhost:5432

You can change the database connection settings in the .env file. Also, you can stop and delete the database by running docker-compose down and then you can restart it again with docker-compose up -d. It should load the schema and sample data from drizzle/schema.sql.

GitHub Actions

docker-build-push

This action creates a Docker image and pushes it to Docker Hub. It is triggered by a release being published.

Routes

Routes require authentication. Non-authenticated users will be redirected to the login page.

Page Routes

Page Reference

  • / - Home page
  • /login - Login page
  • /account - Account settings page
  • /rover/[id] - Rover details page
  • /launch-rover/[id] - Launch rover page
  • /manual-control - Manual control page
  • /map/[id] - Map page

API Routes

API Reference

  • POST /api/images - Upload an image.
  • GET /api/images - Get a list of all uploaded images.
  • GET /api/images/:id - Get a specific image by ID.
  • DELETE /api/images/:id - Delete a specific image by ID.
  • GET /api/detections - Get a list of all detections.
  • POST /api/detections - Upload a detection.
  • GET /api/detections/:id - Get a specific detection by ID.
  • PATCH /api/detections/:id - Update a detection.
  • DELETE /api/detections/:id - Delete a specific detection by ID.

Database

Database Reference

Database is handled using Drizzle ORM. You can see details under drizzle/ and src/lib/server/db/. There is an issue with Drizzle ORM where it does not support Linestring type in PostgreSQL, as a workaround we are using raw SQL queries for now and manually updating the schema in migrations.

You will need to have the database running. You can use the docker-compose.yml file in the root of the repository to start the database. Then you need to run the migrations to create the tables if they do not exist.

  1. Run npm run db:start or docker-compose up -d to start the database
  2. Run npm run db:migrate or npx drizzle-kit migrate to run the migrations
  3. The database will be running on localhost:5432

There's also a test database, see next section.

Testing

Testing Reference

Testing is done using Vitest and Supertest. You can run the tests by running npm run test, but be sure to run npm run build beforehand. Make sure to have the database running before running the tests. You can use the docker-compose.test.yml file to start a test database. The database will be automatically created and dropped after the tests are done.

  1. Run docker-compose -f docker-compose.test.yml up -d to start the test database.
  2. Run npm run build to build the project.
  3. Run npm run test to run the tests.
  4. Run docker-compose -f docker-compose.test.yml down to stop and remove the test database.

Known Issues, Limitations, and Workarounds

  • Drizzle ORM does not support the Linestring type in PostgreSQL, so we are using raw SQL queries for now and manually updating the schema in migrations.

Clone this wiki locally