Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database + Crud Backend #24

Merged
merged 64 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d9e5554
feat: created DB file
Brandon-Harad Oct 10, 2024
8616432
feat: type model for scouting system
azaleacolburn Oct 23, 2024
3a9c864
chore: update svelte
azaleacolburn Oct 24, 2024
0b283c8
feat: tried
Brandon-Harad Oct 24, 2024
4cbe864
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Oct 25, 2024
16ae2d3
feat: nothing
Brandon-Harad Oct 25, 2024
fc86844
feat: add none
azaleacolburn Oct 25, 2024
5bdf57d
feat: added DB.sql and migrations
Brandon-Harad Oct 25, 2024
63ad46c
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Oct 25, 2024
a7fe051
refactor: type state model
azaleacolburn Oct 26, 2024
a0c787e
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Oct 28, 2024
0b18cca
feat: state transforms
azaleacolburn Oct 30, 2024
0d37bc8
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Oct 30, 2024
e294d06
add successfail screen
awwpotato Nov 5, 2024
f515290
theme fixes
awwpotato Nov 6, 2024
6ff4f16
Merge branch 'main' into azalea/input-grid
awwpotato Nov 9, 2024
4105ff5
fix: package.json
awwpotato Nov 9, 2024
a9571e0
fix: formating
awwpotato Nov 9, 2024
d80ad01
fix: dependencies
awwpotato Nov 9, 2024
040d95c
format thingy
awwpotato Nov 9, 2024
c9bc989
feat: implemented submit api
Brandon-Harad Nov 12, 2024
68dc558
fix: removed unnecessary line
Brandon-Harad Nov 12, 2024
c9dc82e
refactor: update types to match new schema
azaleacolburn Nov 12, 2024
9d24e18
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Nov 12, 2024
3457625
fix: id after clarifying with Brandon
azaleacolburn Nov 12, 2024
8601e25
update dep
awwpotato Nov 12, 2024
01b0333
style: format files
awwpotato Nov 12, 2024
aa2acfa
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Nov 13, 2024
d97b111
feat: pulled from main
Brandon-Harad Nov 13, 2024
abdf6d3
style: format files
Brandon-Harad Nov 13, 2024
bb94b2c
fix: dependencies
Brandon-Harad Nov 13, 2024
e8cf106
Merge branch 'Brandon/Database' of https://github.com/flamingchickens…
Brandon-Harad Nov 13, 2024
3263a75
style: format files
Brandon-Harad Nov 13, 2024
137b2fe
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
Brandon-Harad Nov 14, 2024
9a506d6
Merge branch 'Brandon/Database' of https://github.com/flamingchickens…
Brandon-Harad Nov 14, 2024
f8e0d06
fix: dependencies
Brandon-Harad Nov 14, 2024
b0e280b
fix: skill property name
azaleacolburn Nov 14, 2024
e232fab
fix: removed npm config
Brandon-Harad Nov 15, 2024
1cdc2aa
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Nov 15, 2024
71942fe
fix: bun dependencies
Brandon-Harad Nov 15, 2024
a76b60d
feat: finished submit function
Brandon-Harad Dec 1, 2024
b5d1325
feat: read route
Brandon-Harad Dec 1, 2024
2852564
feat: superscouting and pit scouting in db
Brandon-Harad Dec 3, 2024
9a4e757
fix: DB code
Brandon-Harad Dec 3, 2024
8e0a494
fix: updated queries to allow ids
Brandon-Harad Dec 3, 2024
25152cf
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
azaleacolburn Dec 3, 2024
c92db21
fix: tailwind to CommonJS module
azaleacolburn Dec 4, 2024
073c4e0
style: format files
azaleacolburn Dec 4, 2024
ce913f9
fix: queries
Brandon-Harad Dec 4, 2024
1d02a3c
Merge branch 'Brandon/Database' of https://github.com/flamingchickens…
Brandon-Harad Dec 4, 2024
74c4124
style: format files
Brandon-Harad Dec 4, 2024
8349ae7
Merge branch 'Brandon/Database' of https://github.com/flamingchickens…
Brandon-Harad Dec 5, 2024
68a204d
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Dec 5, 2024
61ccb4c
fix: types
Brandon-Harad Dec 5, 2024
1a7cb06
style: format files
Brandon-Harad Dec 5, 2024
7460c08
feat: hooked up frontend to backend
Brandon-Harad Dec 5, 2024
9f75689
Merge branch 'Brandon/Database' of https://github.com/flamingchickens…
Brandon-Harad Dec 5, 2024
5e9cead
fix: queries
Brandon-Harad Dec 5, 2024
c72336b
feat: functional queries
Brandon-Harad Dec 10, 2024
e638740
style: format files
Brandon-Harad Dec 10, 2024
83976a7
fix: queries returning too much
Brandon-Harad Dec 10, 2024
e710b78
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
Brandon-Harad Dec 10, 2024
f292c6d
more merge
Brandon-Harad Dec 10, 2024
d83d13e
Merge branch 'main' of https://github.com/flamingchickens1540/inflate…
azaleacolburn Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DB_HOST = "0"
DB_USER = "0"
DB_PASSWORD = "0"
POSTGRES_DATABASE = "0"
USE_DB = "false"
DB_PORT = "0"
Binary file modified bun.lockb
Binary file not shown.
171 changes: 171 additions & 0 deletions migrations/DB.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
CREATE TYPE tele_action_type AS ENUM (
'IntakeTote',
'IntakeBalloon',
'TakeBalloonFromCoral',

'ScoreYourHeldTote',
'ScoreOtherHeldTote',
'ScoreExternalTote',
'ScoreLowBalloon'
);
CREATE TYPE auto_action_type as ENUM (
'IntakeTote',
'IntakeBalloon',
'TakeBalloonFromCoral',

'ScoreYourHeldTote',
'ScoreOtherHeldTote',
'ScoreExternalTote',
'ScoreLowBalloon',

'IntakeBunny',
'ScoreBunnyTote',
'ScoreBunnyLowZone'
);
CREATE TYPE tele_action_data AS (
act tele_action_type,
success BOOLEAN
);
CREATE TYPE auto_action_data AS (
act auto_action_type,
success BOOLEAN
);
CREATE TYPE drivetrain_enum as ENUM (
'Swerve',
'Tank',
'Other'
);

CREATE TABLE "Users"(
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255) NOT NULL,
"is_admin" BOOLEAN NOT NULL
);
CREATE TABLE "Teams"(
"team_key" VARCHAR(255) NOT NULL,
"nickname" VARCHAR(255) NOT NULL
);
ALTER TABLE
"Teams" ADD PRIMARY KEY("team_key");
CREATE TABLE "Matches"(
"match_key" VARCHAR(255) NOT NULL,
"event_key" VARCHAR(255) NOT NULL
);
ALTER TABLE
"Matches" ADD PRIMARY KEY("match_key");
CREATE TABLE "TeamMatches"(
"id" SERIAL PRIMARY KEY,
"scout_id" VARCHAR(255) NOT NULL,
"match_key" VARCHAR(255) NOT NULL,
"team_key" VARCHAR(255) NOT NULL,
"skill_field_awareness" SMALLINT NOT NULL,
"skill_quickness" SMALLINT NOT NULL,
"notes" VARCHAR(255) NOT NULL,
"broke" BOOLEAN NOT NULL,
"died" BOOLEAN NOT NULL,
"tele_action_id" SMALLINT NOT NULL,
"auto_action_id" SMALLINT NOT NULL
);
CREATE TABLE "TeleActions"(
"id" SERIAL PRIMARY KEY,
"tote_intake_success" SMALLINT NOT NULL,
"tote_intake_failure" SMALLINT NOT NULL,
"tote_eject_success" SMALLINT NOT NULL,
"tote_eject_failure" SMALLINT NOT NULL,
"balloon_intake_success" SMALLINT NOT NULL,
"balloon_intake_failure" SMALLINT NOT NULL,
"balloon_eject_success" SMALLINT NOT NULL,
"balloon_eject_failure" SMALLINT NOT NULL,
"score_low_success" SMALLINT NOT NULL,
"score_low_failure" SMALLINT NOT NULL,
"score_internal_success" SMALLINT NOT NULL,
"score_internal_failure" SMALLINT NOT NULL,
"score_external_success" SMALLINT NOT NULL,
"score_external_failure" SMALLINT NOT NULL,
"score_uncontrolled_success" SMALLINT NOT NULL,
"score_uncontrolled_failure" SMALLINT NOT NULL,
"bunny_eject_success" SMALLINT NOT NULL,
"bunny_eject_failure" SMALLINT NOT NULL,
"actions" tele_action_data[]
);
CREATE TABLE "AutoActions"(
"id" SERIAL PRIMARY KEY,
"tote_intake_success" SMALLINT NOT NULL,
"tote_intake_failure" SMALLINT NOT NULL,
"tote_eject_success" SMALLINT NOT NULL,
"tote_eject_failure" SMALLINT NOT NULL,
"balloon_intake_success" SMALLINT NOT NULL,
"balloon_intake_failure" SMALLINT NOT NULL,
"balloon_eject_success" SMALLINT NOT NULL,
"balloon_eject_failure" SMALLINT NOT NULL,
"score_low_success" SMALLINT NOT NULL,
"score_low_failure" SMALLINT NOT NULL,
"score_internal_sucess" SMALLINT NOT NULL,
"score_internal_failure" SMALLINT NOT NULL,
"score_external_success" SMALLINT NOT NULL,
"score_external_failure" SMALLINT NOT NULL,
"score_uncontrolled_success" SMALLINT NOT NULL,
"score_uncontrolled_failure" SMALLINT NOT NULL,
"bunny_intake_success" SMALLINT NOT NULL,
"bunny_intake_failure" SMALLINT NOT NULL,
"bunny_eject_success" SMALLINT NOT NULL,
"bunny_eject_failure" SMALLINT NOT NULL,
"bunny_internal_success" SMALLINT NOT NULL,
"bunny_internal_failure" SMALLINT NOT NULL,
"bunny_external_success" SMALLINT NOT NULL,
"bunny_external_failure" SMALLINT NOT NULL,
"bunny_uncontrolled_success" SMALLINT NOT NULL,
"bunny_uncontrolled_failure" SMALLINT NOT NULL,
"bunny_low_success" SMALLINT NOT NULL,
"bunny_low_failure" SMALLINT NOT NULL,
"actions" auto_action_data[]
);
CREATE TABLE "AllianceMatches"(
"id" SERIAL PRIMARY KEY,
"scout_id" VARCHAR(255) NOT NULL,
"match_key" VARCHAR(255) NOT NULL,
"alliance_key" VARCHAR(255) NOT NULL,
"one_strengths" VARCHAR(255) NOT NULL,
"two_strengths" VARCHAR(255) NOT NULL,
"three_strengths" VARCHAR(255) NOT NULL,
"one_weaknesses" VARCHAR(255) NOT NULL,
"two_weaknesses" VARCHAR(255) NOT NULL,
"three_weaknesses" VARCHAR(255) NOT NULL,
"notes" VARCHAR(255) NOT NULL,
"match_notes" VARCHAR(255) NOT NULL
);
CREATE TABLE "TeamEvents"(
"id" SERIAL PRIMARY KEY,
"scout_id" VARCHAR(255) NOT NULL,
"team_key" VARCHAR(255) NOT NULL,
"width" SMALLINT NOT NULL,
"length" SMALLINT NOT NULL,
"height" SMALLINT NOT NULL,
"is_camera" BOOLEAN NOT NULL,
"drivetrain_enum" drivetrain_enum NOT NULL,
"is_slippery" BOOLEAN NOT NULL,
"is_tote_intake" BOOLEAN NOT NULL,
"is_balloon_intake" BOOLEAN NOT NULL,
"number_bunny_autos" SMALLINT NOT NULL,
"polish" SMALLINT NOT NULL,
"robot_notes" VARCHAR(255) NOT NULL,
"minibot_notes" VARCHAR(255) NOT NULL
);
-- ALTER TABLE
-- "TeamEvents" ADD CONSTRAINT "teamevents_scout_id_foreign" FOREIGN KEY("scout_id") REFERENCES "Users"("id");
-- ALTER TABLE
-- "AllianceMatches" ADD CONSTRAINT "alliancematches_match_key_foreign" FOREIGN KEY("match_key") REFERENCES "Matches"("match_key");
-- ALTER TABLE
-- "TeamMatches" ADD CONSTRAINT "teammatches_team_key_foreign" FOREIGN KEY("team_key") REFERENCES "Teams"("team_key");
-- ALTER TABLE
-- "TeamMatches" ADD CONSTRAINT "teammatches_match_key_foreign" FOREIGN KEY("match_key") REFERENCES "Matches"("match_key");
-- ALTER TABLE
-- "TeamMatches" ADD CONSTRAINT "teammatches_scout_id_foreign" FOREIGN KEY("scout_id") REFERENCES "Users"("id");
-- ALTER TABLE
-- "TeamMatches" ADD CONSTRAINT "teammatches_auto_id_foreign" FOREIGN KEY("auto_action_id") REFERENCES "AutoActions"("id");
-- ALTER TABLE
-- "TeamEvents" ADD CONSTRAINT "teamevents_team_key_foreign" FOREIGN KEY("team_key") REFERENCES "Teams"("team_key");
-- ALTER TABLE
-- "TeamMatches" ADD CONSTRAINT "teammatches_tele_id_foreign" FOREIGN KEY("tele_action_id") REFERENCES "TeleActions"("id");
-- ALTER TABLE
-- "AllianceMatches" ADD CONSTRAINT "alliancematches_scout_id_foreign" FOREIGN KEY("scout_id") REFERENCES "Users"("id");
39 changes: 24 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,34 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "^4.0.2",
"@sveltejs/kit": "^2.8.1",
"@types/node": "^22.9.0",
"@types/pg": "^8.11.10",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/eslint": "^9.6.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.16.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.13.0",
"prettier": "^3.4.1",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"svelte": "^5.5.2",
"svelte-check": "^4.1.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",
"vite": "^5.4.11"
"eslint-plugin-svelte": "^2.46.0",
"postcss": "^8.4.49",
"globals": "^15.12.0",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.8",
"svelte": "^5.1.16",
"svelte-check": "^4.0.7",
"tslib": "^2.8.1",
"prettier-plugin-tailwindcss": "^0.6.8",
"typescript": "^5.6.3"
},
"dependencies": {
"autoprefixer": "^10.4.20",
"mysql2": "^3.11.4",
"pg": "^8.13.1",
"postgresql": "^0.0.1",
"tailwindcss": "^3.4.14",
"typescript-eslint": "^8.14.0",
"vite": "^5.4.11",
"lucide-svelte": "^0.460.1",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1"
Expand Down
Loading
Loading