(on mac, it sqlite3 should already come installed)
sudo apt update
sudo apt install nodejs
Check node install (Must be at least node v10):
node -v
sudo apt install sqlite3
Check sqlite3 install:
sqlite3 --version
Npm installs
sudo apt install npm
npm install
On server startup, run the command coorespoinding to your operating system
npm run linuxstart
npm run macstart
npm run windowsstart
If the command fails, go to the built in terminal in vscode, hit the down arrow next to the plus sign, and press bash or Ubuntu (WSL). Run the linux command
If both steps above fail, please let Barry know both your operating system and which command you ran. Then follow the steps below
Follow instructions on https://ngrok.com/download, adding an authToken is optional
Run in terminal:
ngrok http 4000
Copy the text after the word "forwarding" and before the "->" to get the link to the server (it will work when the server is on and port 4000 opens)
SQLite by alexcvzz
SQLite Viewer by FLorian Klampfer
:taskName | requirements | description |
---|---|---|
AverageForMetric | teamKey, metric | Will get average of any metric for a team |
BestAverageForMetric | tournamentKey, metric | Will get the team with the best average for a metric in a tournament as well as their average |
TeamsInTournament | tournamentKey | Returns a list of all teams in the tournament |
|
Returns completed analyses as a list
Can send multiple analysis to be run in the body
{
"tasks": [
{
"name": "AverageForMetric",
"teamKey": "frc254",
"metric": "teleopHighSuccess"
},
{
"name": "AverageForMetric",
"teamKey": "frc8033",
"metric": "teleopHighSuccess"
},
{
"name": "TeamsInTournament",
"tournamentKey": "2022cc"
}
]
}
Returns completed analyses as a list
Will accept if a teamKey, tournamentKey, and data
{
"uuid": "71a8e343-39bf-495a-8bba-2da8b7375326",
"tournamentKey": "2022cc",
"matchKey": "qm1",
"scouterName": "Jacob Trentini",
"teamNumber": 254,
"startTime": 1673570312,
"autoChallengeResult": 2,
"events": [
[
2,
7,
3
],
[
5,
10,
9
],
[
8,
0,
1
],
[
11,
0,
8
]
],
"challengeResult": 4,
"robotRole": 0,
"notes": "Robot did not climb but stayed in community."
}
Data successfully entered
[
{
"key": "frc1",
"teamNumber": 1,
"teamName": "The Juggernauts"
},
{
"key": "frc4",
"teamNumber": 4,
"teamName": "Team 4 ELEMENT"
},
{
"key": "frc5",
"teamNumber": 5,
"teamName": "Robocards"
}
]
[
{
"key": "frc114",
"teamNumber": 114,
"teamName": "Eaglestrike"
},
{
"key": "frc254",
"teamNumber": 254,
"teamName": "The Cheesy Poofs"
},
{
"key": "frc359",
"teamNumber": 359,
"teamName": "Hawaiian Kids"
},
{
"key": "frc498",
"teamNumber": 498,
"teamName": "The Cobra Commanders"
}
]
Don't use this one anyway and also it takes a couple minutes for the database to fully reset then populate
Needs a tournamentKey
Success
Can also omit matchKey to get scouting status/name from all matches in the tournament.
If the name is null then it means there's a scoutreport missing for that matchKey
[
{
"key": "2022cc_qm1_4",
"name": "Nate Hart"
},
{
"key": "2022cc_qm1_3",
"name": null
},
{
"key": "2022cc_qm1_0",
"name": "William Tenney"
},
{
"key": "2022cc_qm1_5",
"name": "Nathaniel Welch"
},
{
"key": "2022cc_qm1_1",
"name": "Keshav Rangan"
},
{
"key": "2022cc_qm1_2",
"name": "Helena Young"
}
]
[
"Abagail Cothran",
"Alex Ware",
"Alexander Aires",
"Alexis Montero Castro",
"Asha Byers",
"Athena Li",
"audrey Dickinson",
"Ava Grochowski",
"Ayaan Jajodia",
"Barry Balasingham",
]
{
"version": 1,
"shifts": [
{
"start": 1,
"end": 5,
"startKey": "2022cc_qm1",
"endKey": "2022cc_qm5",
"scouts": [
"Evrim Duransoy",
"Nate Hart",
"Asha Byers",
"Lewy Seiden",
"Beck Peterson",
"Barry Balasingham"
]
},
{
"start": 6,
"end": 10,
"startKey": "2022cc_qm6",
"endKey": "2022cc_qm10",
"scouts": [
"Jessica Liu",
"Torsten Olsen",
"Nathaniel Scher",
"Jacob Trentini",
"Nathaniel Welch",
"Cassandra Colby"
]
},
{
"start": 11,
"end": 15,
"startKey": "2022cc_qm11",
"endKey": "2022cc_qm15",
"scouts": [
"Mckeane Mcbrearty",
"Asha Byers",
"Nate Hart",
"Barry Balasingham",
"Evrim Duransoy",
"Valentina Prieto Black"
]
},
{
"start": 16,
"end": 20,
"startKey": "2022cc_qm16",
"endKey": "2022cc_qm20",
"scouts": [
"Nathaniel Welch",
"Collin Cameron",
"Jacob Trentini",
"Beck Peterson",
"Jessica Liu",
"Lewy Seiden"
]
}
]
}
{
"version": 2,
"shifts": [
{
"start": 1,
"end": 5,
"startKey": "2022cc_qm1",
"endKey": "2022cc_qm5",
"scouts": [
"Evrim Duransoy",
"Nate Hart",
"Asha Byers",
"Lewy Seiden",
"Beck Peterson",
"Barry Balasingham"
]
},
{
"start": 6,
"end": 10,
"startKey": "2022cc_qm6",
"endKey": "2022cc_qm10",
"scouts": [
"Jessica Liu",
"Torsten Olsen",
"Nathaniel Scher",
"Jacob Trentini",
"Nathaniel Welch",
"Cassandra Colby"
]
},
{
"start": 11,
"end": 15,
"startKey": "2022cc_qm11",
"endKey": "2022cc_qm15",
"scouts": [
"Mckeane Mcbrearty",
"Asha Byers",
"Nate Hart",
"Barry Balasingham",
"Evrim Duransoy",
"Valentina Prieto Black"
]
},
{
"start": 16,
"end": 20,
"startKey": "2022cc_qm16",
"endKey": "2022cc_qm20",
"scouts": [
"Nathaniel Welch",
"Collin Cameron",
"Jacob Trentini",
"Beck Peterson",
"Jessica Liu",
"Lewy Seiden"
]
}
]
}
[
{
"key": "2022cc_qm65_3",
"tournamentKey": "2022cc",
"matchNumber": 65,
"teamKey": "frc7157",
"matchType": "qm"
},
{
"key": "2022cc_qm65_1",
"tournamentKey": "2022cc",
"matchNumber": 65,
"teamKey": "frc972",
"matchType": "qm"
},
{
"key": "2022cc_ef1_1",
"tournamentKey": "2022cc",
"matchNumber": 70,
"teamKey": "frc1678",
"matchType": "ef"
},
{
"key": "2022cc_qf1_1",
"tournamentKey": "2022cc",
"matchNumber": 66,
"teamKey": "frc1678",
"matchType": "qf"
},
{
"key": "2022cc_f1_1",
"tournamentKey": "2022cc",
"matchNumber": 78,
"teamKey": "frc1690",
"matchType": "f"
}
]
GET /API/manager/isMatchesScouted?tournamentKey=2022cc&scouterName=Jacob Trentini&matchKeys=["2022cc_qm1", "2022cc_qm2", "2022cc_qm3"]
[
{
"matchKey": "2022cc_qm1",
"key": "2022cc_qm1_1",
"status": true
},
{
"matchKey": "2022cc_1qm2",
"status": false
},
{
"matchKey": "2022cc_qm3",
"status": false
}
]
sinceTime is optional but will use epoch in milis
[
"Very Purple",
"Got bodied by defense",
"Bad climb"
]
Can omit tournamentKey if you want to search the entire database and can also use teamNumber if you want. Currently sends the stored matchKey but I can cut off the "_0" if need be.
[
"2022cc_qm1_0"
]
GET /API/manager/newScouter?scouterName=test&scouterNumber=4154154155&scouterEmail=asdf@gmail.com
Due to this command editing the scouters.json file, it will forcibly restart the server. Unless we have paid ngrok the link will change
Query The blue alliance
Build get all teamsGet and insert matches for round-robin
- Make analysis engine
Get Team's points averageBuild rest of analysis for analysis engine
Add actual data to the Database
Get data from the appAdd post request for inputing dataAdd any data required to properly insert into the header in gamedata (on the app)Its on the test-rest-api branch
- REST API
Add get request for recieving analysisCreate token systemAdd post request for inputing dataAdd get request for recieving analysisAdd post request for adding stuff via api (such as tournament matches)
Abstraction
Break functions and utilities into seperate files for modularity reasons
- Testing
Learn jest framework- Finish writing test cases
Fix package.json- Make a message queue
- Learn BullMQ and Redis
- Make message queue
- Fix endpoints to Collin's suggestions
- More params and stop using body
- Incorporate ORM
- Make setup simpler
- Convert to typescript
- Multithreading if possible
Commands: Run server:
nodemon collectionServer.js
Run individual js files:
node {filename}
Send packets through Postman if you want