Skip to main content

Running Aces-Scouter and the Aces-Scouting-Backend locally

Overview

This page describes how to run Aces-Scouter and Aces-Scouting-Backend "locally" so that you can test full-stack application changes.

In this setup, Aces-Scouter will run locally on your laptop, but run Aces-Scouting-Backend in the cloud using GitHub Codespaces. While it is possible to run everything locally, it would require installing Docker on your machine. If you're running Linux (such as Ubuntu), this is easy. On Windows/Mac, it is also easy, but requires you to run a Virtual Machine (VM) which will be used to actually run the containers, which is resource intensive.

Getting Started

Software

Here are the required pieces of software (most likely, you already have these installed):

  1. VSCode
  2. Node
  3. Yarn

Repositories

Aces-Scouter

  1. Clone Aces-Scouter to your laptop
  2. Run yarn install, then yarn localdev

At this point, you should see the scouting app running at http://localhost:3000/

Aces-Scouting-Backend

Start the Codespace

  1. Open up a Codespace on Aces-Scouting-Backend.

Create Codespace on Main

  1. Once that opens up, on the bottom left corner, click the "Codespaces: ..." tab,

Then click on "Open in VS Code Desktop"

Then follow the prompts to open up the Codespace in VS Code

Install Task in the Codespace, if necessary

Open up a terminal in VSCode. Try executing the task command. If it's not found, execute the following:

curl -fsSL https://raw.githubusercontent.com/eitsupi/devcontainer-features/refs/heads/main/src/go-task/install.sh | sudo bash

Start up development containers

Start up the development containers. There are two containers:

  1. A container that will connect to in order to run our python app, and
  2. adminer (the web interface to interact with PostgreSQL)
task compose-up

Open up the "Ports" view. On the bottom ribbon, to the left, it looks like a radio tower. This should show you two ports as shown below.

8088 is for adminer

5000 is for our python app

Start up Aces-Scouting-Backend

  1. Use task connect-to-devcontainer to open a shell in our python container.
  2. Execute python3 app.py in order to start up the backend.
tip

At this point, opening up http://localhost:5000/health in your browser should display the text "OK", and http://localhost:8088/ should display the adminer landing page.

Conclusion

At this point, you should be able to use the scouting app and all interactions should be using the backend you ran before with python3 app.py

Appendix

Connecting to the database using Adminer

To find the password, look at the POSTGRES_PASSWORD variable in .dev_backend_vars.env

NOTE: As of 2025 01 17, you need to populate one of the match schedules

You can do so by either:

  1. Going to this link http://localhost:5000/fetch_tba_schedule?event_key=2024ctwat
  2. Executing this SQL, since in order for the above URL to work, you need a valid BlueAlliance API key
INSERT INTO "bluealliance_match_schedule" ("id", "match_number", "event_key", "comp_level", "red1", "red2", "red3", "blue1", "blue2", "blue3") VALUES
(81, 1, '2024ctwat', 'f', 558, 6346, 5142, 176, 839, 230),
(82, 2, '2024ctwat', 'f', 558, 6346, 5142, 176, 839, 230),
(83, 3, '2024ctwat', 'f', 558, 6346, 5142, 176, 839, 230),
(84, 1, '2024ctwat', 'qm', 7869, 4572, 3461, 999, 5746, 195),
(85, 10, '2024ctwat', 'qm', 2067, 195, 5142, 6723, 4572, 9193),
(86, 11, '2024ctwat', 'qm', 839, 8709, 3654, 999, 2168, 7869),
(87, 12, '2024ctwat', 'qm', 716, 3461, 7694, 9710, 3719, 178),
(88, 13, '2024ctwat', 'qm', 230, 558, 155, 3146, 1991, 4572),
(89, 14, '2024ctwat', 'qm', 195, 2064, 237, 3634, 6723, 839),
(90, 15, '2024ctwat', 'qm', 8889, 999, 1099, 228, 9193, 2067),
(91, 16, '2024ctwat', 'qm', 5746, 6346, 176, 2168, 5142, 8709),
(92, 17, '2024ctwat', 'qm', 195, 716, 1991, 9710, 237, 3634),
(93, 18, '2024ctwat', 'qm', 3461, 2067, 6723, 228, 155, 7694),
(94, 19, '2024ctwat', 'qm', 3654, 230, 4572, 176, 9193, 839),
(95, 2, '2024ctwat', 'qm', 230, 3146, 9710, 3654, 7694, 6723),
(96, 20, '2024ctwat', 'qm', 3146, 5142, 3719, 5746, 8889, 8709),
(97, 21, '2024ctwat', 'qm', 6346, 178, 7869, 2064, 999, 558),
(98, 22, '2024ctwat', 'qm', 2168, 4572, 237, 1099, 6723, 716),
(99, 23, '2024ctwat', 'qm', 7694, 839, 5746, 228, 195, 8889),
(100, 24, '2024ctwat', 'qm', 2064, 2067, 6346, 155, 3654, 176),
(101, 25, '2024ctwat', 'qm', 9710, 558, 1991, 5142, 230, 999),
(102, 26, '2024ctwat', 'qm', 3634, 3719, 2168, 9193, 3461, 3146),
(103, 27, '2024ctwat', 'qm', 8709, 7869, 155, 178, 1099, 2064),
(104, 28, '2024ctwat', 'qm', 1991, 6346, 228, 5142, 4572, 839),
(105, 29, '2024ctwat', 'qm', 6723, 3146, 176, 999, 716, 3719),
(106, 3, '2024ctwat', 'qm', 558, 8889, 3634, 228, 237, 8709),
(107, 30, '2024ctwat', 'qm', 7869, 3654, 558, 8889, 7694, 9193),
(108, 31, '2024ctwat', 'qm', 2067, 5746, 2168, 237, 178, 230),
(109, 32, '2024ctwat', 'qm', 1099, 9710, 8709, 3461, 195, 3634),
(110, 33, '2024ctwat', 'qm', 6723, 1991, 3719, 716, 2064, 3654),
(111, 34, '2024ctwat', 'qm', 3146, 8889, 7869, 6346, 558, 4572),
(112, 35, '2024ctwat', 'qm', 3634, 7694, 5142, 176, 2067, 999),
(113, 36, '2024ctwat', 'qm', 839, 230, 228, 9710, 2168, 155),
(114, 37, '2024ctwat', 'qm', 195, 1099, 9193, 237, 5746, 3461),
(115, 38, '2024ctwat', 'qm', 178, 999, 6723, 8709, 1991, 7694),
(116, 39, '2024ctwat', 'qm', 176, 228, 9710, 558, 3146, 2067),
(117, 4, '2024ctwat', 'qm', 1991, 176, 178, 3719, 1099, 6346),
(118, 40, '2024ctwat', 'qm', 7869, 716, 5746, 3461, 3654, 5142),
(119, 41, '2024ctwat', 'qm', 9193, 6346, 237, 155, 3719, 195),
(120, 42, '2024ctwat', 'qm', 839, 178, 2168, 3634, 1099, 4572),
(121, 43, '2024ctwat', 'qm', 230, 8709, 3461, 2064, 8889, 9710),
(122, 44, '2024ctwat', 'qm', 155, 6723, 237, 5142, 7869, 228),
(123, 45, '2024ctwat', 'qm', 3654, 5746, 1099, 839, 6346, 999),
(124, 46, '2024ctwat', 'qm', 558, 8709, 716, 1991, 2067, 3719),
(125, 47, '2024ctwat', 'qm', 9193, 3634, 2064, 2168, 3146, 7694),
(126, 48, '2024ctwat', 'qm', 4572, 178, 8889, 176, 195, 230),
(127, 49, '2024ctwat', 'qm', 3719, 228, 558, 1099, 7869, 839),
(128, 5, '2024ctwat', 'qm', 2064, 5142, 155, 9193, 2168, 716),
(129, 50, '2024ctwat', 'qm', 5746, 9710, 9193, 155, 3634, 6346),
(130, 51, '2024ctwat', 'qm', 5142, 6723, 8889, 178, 3654, 3146),
(131, 52, '2024ctwat', 'qm', 7694, 237, 2067, 4572, 8709, 176),
(132, 53, '2024ctwat', 'qm', 999, 3461, 1991, 2168, 2064, 230),
(133, 54, '2024ctwat', 'qm', 195, 839, 3146, 716, 5142, 6346),
(134, 55, '2024ctwat', 'qm', 1099, 155, 2067, 6723, 558, 5746),
(135, 56, '2024ctwat', 'qm', 3719, 9193, 3654, 3461, 228, 178),
(136, 57, '2024ctwat', 'qm', 716, 230, 3634, 237, 176, 7869),
(137, 58, '2024ctwat', 'qm', 7694, 9710, 195, 8889, 1991, 2168),
(138, 59, '2024ctwat', 'qm', 4572, 999, 228, 8709, 2064, 3146),
(139, 6, '2024ctwat', 'qm', 237, 839, 558, 2067, 9710, 3654),
(140, 60, '2024ctwat', 'qm', 3654, 237, 5142, 558, 3461, 1099),
(141, 61, '2024ctwat', 'qm', 2067, 3634, 178, 1991, 155, 5746),
(142, 62, '2024ctwat', 'qm', 8709, 9193, 999, 4572, 716, 9710),
(143, 63, '2024ctwat', 'qm', 6346, 2168, 195, 230, 7869, 6723),
(144, 64, '2024ctwat', 'qm', 7694, 176, 2064, 3719, 839, 8889),
(145, 7, '2024ctwat', 'qm', 8889, 176, 3461, 7869, 3634, 1991),
(146, 8, '2024ctwat', 'qm', 3146, 228, 1099, 178, 155, 716),
(147, 9, '2024ctwat', 'qm', 5746, 3719, 2064, 6346, 7694, 230),
(148, 1, '2024ctwat', 'sf', 3146, 195, 1099, 8889, 8709, 716),
(149, 1, '2024ctwat', 'sf', 558, 6346, 5142, 999, 2067, 2064),
(150, 1, '2024ctwat', 'sf', 716, 8709, 8889, 176, 839, 230),
(151, 1, '2024ctwat', 'sf', 2064, 2067, 999, 176, 839, 230),
(152, 1, '2024ctwat', 'sf', 230, 839, 176, 3461, 1991, 2168),
(153, 1, '2024ctwat', 'sf', 558, 6346, 5142, 8889, 8709, 716),
(154, 1, '2024ctwat', 'sf', 2064, 2067, 999, 9710, 7694, 155),
(155, 1, '2024ctwat', 'sf', 3146, 195, 1099, 4572, 5746, 228),
(156, 1, '2024ctwat', 'sf', 2168, 1991, 3461, 8889, 8709, 716),
(157, 1, '2024ctwat', 'sf', 155, 7694, 9710, 4572, 5746, 228),
(158, 1, '2024ctwat', 'sf', 230, 839, 176, 5142, 6346, 558),
(159, 1, '2024ctwat', 'sf', 2064, 2067, 999, 1099, 195, 3146),
(160, 1, '2024ctwat', 'sf', 230, 839, 176, 4572, 5746, 228);