-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This is the wiki page for the Rover UI.
The Rover UI uses sveltekit to create a frontend and a backend for the Rover application.
- SvelteKit
- Tailwind CSS
- Drizzle ORM
- ros2
- PostgreSQL
- Docker
- GitHub Actions
Need to have node and npm installed.
- Clone the repository
- Run
npm installto install dependencies - Run
npm run devto start the development server - Open
http://localhost:5173in 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.
- Run
docker-compose up -dto start the database - 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.
This action creates a Docker image and pushes it to Docker Hub. It is triggered by a release being published.
Routes require authentication. Non-authenticated users will be redirected to the login page.
-
/- 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
-
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 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.
- Run
npm run db:startordocker-compose up -dto start the database - Run
npm run db:migrateornpx drizzle-kit migrateto run the migrations - The database will be running on
localhost:5432
There's also a test database, see next section.
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.
- Run
docker-compose -f docker-compose.test.yml up -dto start the test database. - Run
npm run buildto build the project. - Run
npm run testto run the tests. - Run
docker-compose -f docker-compose.test.yml downto stop and remove the test database.
- 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.