Skip to content

Team865/scouting-backend-865

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adding new games

note: Name means the name of the game in Pascal case, YYYY means the year of the game (i.e. Name = Reefscape, YYYY = 2025)

  1. add a file to src/data named game_YYYY.rs
  2. add structs that match your data (see src/data/game_2025.rs for an example), and can be (de)serialized with serde. also make sure the main one is called GameDataYYYY and implements Into<Vec<String>>.
  3. add NameYYYY(GameDataYYYY) into GameSpecificData in src/data.rs (this must match the Game value in the frontend)
  4. add GameSpecificData::NameYYYY(data) => fields.append(&mut data.into()) to GameData's Into<Vec<String>>::into in src/data.rs

Setting up your own version

  1. set up the frontend
  2. set up a Google Cloud Console project, and make a service account that can access your spreadsheet
  3. make a file called settings.json:
{
  "root": "/warp7api/scouting",
  "address": "127.0.0.1",
  "port": 42069,
  "frontend": "*",
  "credentials_path": "service_account.json",
  "spreadsheet_id": "<your spreadsheet ID>",
  "main_worksheet": "Raw Data",
  "test_worksheet": "Test Data"
}
  1. run the backend and send a report to it from your frontend to make sure it works
  2. set up nginx or something to proxy the frontend and backend onto the same domain, and secure everything. (this step is, although just generally good advice, mainly to prevent friction from CORS)

sample nginx config:

events {

}

http {
    server {
        listen 443 ssl;

        server_name <domain>;
        ssl_certificate C:/Certbot/live/<domain>/fullchain.pem;
        ssl_certificate_key C:/Certbot/live/<domain>/privkey.pem;

        location / {
            proxy_pass http://localhost:3000;
        }

        location /warp7api/scouting {
            proxy_pass http://localhost:42069;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
}

About

Backend for the scouting app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages