Skip to content

Commit a07663c

Browse files
Merge pull request #141 from TigerAppsOrg/implementing-api
Implementing api
2 parents 8f95a66 + 8b427a6 commit a07663c

22 files changed

Lines changed: 2670 additions & 133 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ node_modules
88
vite.config.js.timestamp-*
99
vite.config.ts.timestamp-*
1010
.VSCODECounter
11+
Engine API
12+
.vscode/settings.json
13+
apps/engine/src/cache/rediscache.ts.timestamp-*
14+
apps/engine/.env

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"editor.defaultFormatter": "svelte.svelte-vscode"
44
},
55
"[typescript]": {
6-
"editor.defaultFormatter": "esbenp.prettier-vscode"
6+
"editor.defaultFormatter": "vscode.typescript-language-features"
77
},
88
"editor.formatOnSave": true,
99
"dbmlERDPreviewer.preferredTheme": "light",
1010
"cSpell.words": [
1111
"emplid"
1212
]
13-
}
13+
}

apps/database/bun.lockb

2.08 KB
Binary file not shown.

apps/engine/.gitignore

Whitespace-only changes.

apps/engine/bun.lockb

6.44 KB
Binary file not shown.

apps/engine/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ services:
3030
retries: 5
3131
volumes:
3232
postgres_data:
33-
redis_data:
33+
redis_data:

apps/engine/drizzle/meta/0000_snapshot.json

Lines changed: 38 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,8 @@
5353
"name": "analytics_user_id_users_id_fk",
5454
"tableFrom": "analytics",
5555
"tableTo": "users",
56-
"columnsFrom": [
57-
"user_id"
58-
],
59-
"columnsTo": [
60-
"id"
61-
],
56+
"columnsFrom": ["user_id"],
57+
"columnsTo": ["id"],
6258
"onDelete": "no action",
6359
"onUpdate": "no action"
6460
}
@@ -92,36 +88,25 @@
9288
"name": "course_department_map_course_id_courses_id_fk",
9389
"tableFrom": "course_department_map",
9490
"tableTo": "courses",
95-
"columnsFrom": [
96-
"course_id"
97-
],
98-
"columnsTo": [
99-
"id"
100-
],
91+
"columnsFrom": ["course_id"],
92+
"columnsTo": ["id"],
10193
"onDelete": "no action",
10294
"onUpdate": "no action"
10395
},
10496
"course_department_map_department_code_departments_code_fk": {
10597
"name": "course_department_map_department_code_departments_code_fk",
10698
"tableFrom": "course_department_map",
10799
"tableTo": "departments",
108-
"columnsFrom": [
109-
"department_code"
110-
],
111-
"columnsTo": [
112-
"code"
113-
],
100+
"columnsFrom": ["department_code"],
101+
"columnsTo": ["code"],
114102
"onDelete": "no action",
115103
"onUpdate": "no action"
116104
}
117105
},
118106
"compositePrimaryKeys": {
119107
"course_department_map_course_id_department_code_pk": {
120108
"name": "course_department_map_course_id_department_code_pk",
121-
"columns": [
122-
"course_id",
123-
"department_code"
124-
]
109+
"columns": ["course_id", "department_code"]
125110
}
126111
},
127112
"uniqueConstraints": {},
@@ -152,36 +137,25 @@
152137
"name": "course_instructor_map_course_id_courses_id_fk",
153138
"tableFrom": "course_instructor_map",
154139
"tableTo": "courses",
155-
"columnsFrom": [
156-
"course_id"
157-
],
158-
"columnsTo": [
159-
"id"
160-
],
140+
"columnsFrom": ["course_id"],
141+
"columnsTo": ["id"],
161142
"onDelete": "no action",
162143
"onUpdate": "no action"
163144
},
164145
"course_instructor_map_instructor_id_instructors_netid_fk": {
165146
"name": "course_instructor_map_instructor_id_instructors_netid_fk",
166147
"tableFrom": "course_instructor_map",
167148
"tableTo": "instructors",
168-
"columnsFrom": [
169-
"instructor_id"
170-
],
171-
"columnsTo": [
172-
"netid"
173-
],
149+
"columnsFrom": ["instructor_id"],
150+
"columnsTo": ["netid"],
174151
"onDelete": "no action",
175152
"onUpdate": "no action"
176153
}
177154
},
178155
"compositePrimaryKeys": {
179156
"course_instructor_map_course_id_instructor_id_pk": {
180157
"name": "course_instructor_map_course_id_instructor_id_pk",
181-
"columns": [
182-
"course_id",
183-
"instructor_id"
184-
]
158+
"columns": ["course_id", "instructor_id"]
185159
}
186160
},
187161
"uniqueConstraints": {},
@@ -299,12 +273,8 @@
299273
"name": "custom_events_user_id_users_id_fk",
300274
"tableFrom": "custom_events",
301275
"tableTo": "users",
302-
"columnsFrom": [
303-
"user_id"
304-
],
305-
"columnsTo": [
306-
"id"
307-
],
276+
"columnsFrom": ["user_id"],
277+
"columnsTo": ["id"],
308278
"onDelete": "no action",
309279
"onUpdate": "no action"
310280
}
@@ -399,12 +369,8 @@
399369
"name": "evaluations_course_id_courses_id_fk",
400370
"tableFrom": "evaluations",
401371
"tableTo": "courses",
402-
"columnsFrom": [
403-
"course_id"
404-
],
405-
"columnsTo": [
406-
"id"
407-
],
372+
"columnsFrom": ["course_id"],
373+
"columnsTo": ["id"],
408374
"onDelete": "no action",
409375
"onUpdate": "no action"
410376
}
@@ -458,12 +424,8 @@
458424
"name": "feedback_user_id_users_id_fk",
459425
"tableFrom": "feedback",
460426
"tableTo": "users",
461-
"columnsFrom": [
462-
"user_id"
463-
],
464-
"columnsTo": [
465-
"id"
466-
],
427+
"columnsFrom": ["user_id"],
428+
"columnsTo": ["id"],
467429
"onDelete": "no action",
468430
"onUpdate": "no action"
469431
}
@@ -509,25 +471,17 @@
509471
"name": "icals_user_id_users_id_fk",
510472
"tableFrom": "icals",
511473
"tableTo": "users",
512-
"columnsFrom": [
513-
"user_id"
514-
],
515-
"columnsTo": [
516-
"id"
517-
],
474+
"columnsFrom": ["user_id"],
475+
"columnsTo": ["id"],
518476
"onDelete": "no action",
519477
"onUpdate": "no action"
520478
},
521479
"icals_schedule_id_schedules_id_fk": {
522480
"name": "icals_schedule_id_schedules_id_fk",
523481
"tableFrom": "icals",
524482
"tableTo": "schedules",
525-
"columnsFrom": [
526-
"schedule_id"
527-
],
528-
"columnsTo": [
529-
"id"
530-
],
483+
"columnsFrom": ["schedule_id"],
484+
"columnsTo": ["id"],
531485
"onDelete": "no action",
532486
"onUpdate": "no action"
533487
}
@@ -654,36 +608,25 @@
654608
"name": "schedule_course_map_schedule_id_schedules_id_fk",
655609
"tableFrom": "schedule_course_map",
656610
"tableTo": "schedules",
657-
"columnsFrom": [
658-
"schedule_id"
659-
],
660-
"columnsTo": [
661-
"id"
662-
],
611+
"columnsFrom": ["schedule_id"],
612+
"columnsTo": ["id"],
663613
"onDelete": "no action",
664614
"onUpdate": "no action"
665615
},
666616
"schedule_course_map_course_id_courses_id_fk": {
667617
"name": "schedule_course_map_course_id_courses_id_fk",
668618
"tableFrom": "schedule_course_map",
669619
"tableTo": "courses",
670-
"columnsFrom": [
671-
"course_id"
672-
],
673-
"columnsTo": [
674-
"id"
675-
],
620+
"columnsFrom": ["course_id"],
621+
"columnsTo": ["id"],
676622
"onDelete": "no action",
677623
"onUpdate": "no action"
678624
}
679625
},
680626
"compositePrimaryKeys": {
681627
"schedule_course_map_schedule_id_course_id_pk": {
682628
"name": "schedule_course_map_schedule_id_course_id_pk",
683-
"columns": [
684-
"schedule_id",
685-
"course_id"
686-
]
629+
"columns": ["schedule_id", "course_id"]
687630
}
688631
},
689632
"uniqueConstraints": {},
@@ -714,36 +657,25 @@
714657
"name": "schedule_event_map_schedule_id_schedules_id_fk",
715658
"tableFrom": "schedule_event_map",
716659
"tableTo": "schedules",
717-
"columnsFrom": [
718-
"schedule_id"
719-
],
720-
"columnsTo": [
721-
"id"
722-
],
660+
"columnsFrom": ["schedule_id"],
661+
"columnsTo": ["id"],
723662
"onDelete": "no action",
724663
"onUpdate": "no action"
725664
},
726665
"schedule_event_map_custom_event_id_custom_events_id_fk": {
727666
"name": "schedule_event_map_custom_event_id_custom_events_id_fk",
728667
"tableFrom": "schedule_event_map",
729668
"tableTo": "custom_events",
730-
"columnsFrom": [
731-
"custom_event_id"
732-
],
733-
"columnsTo": [
734-
"id"
735-
],
669+
"columnsFrom": ["custom_event_id"],
670+
"columnsTo": ["id"],
736671
"onDelete": "no action",
737672
"onUpdate": "no action"
738673
}
739674
},
740675
"compositePrimaryKeys": {
741676
"schedule_event_map_schedule_id_custom_event_id_pk": {
742677
"name": "schedule_event_map_schedule_id_custom_event_id_pk",
743-
"columns": [
744-
"schedule_id",
745-
"custom_event_id"
746-
]
678+
"columns": ["schedule_id", "custom_event_id"]
747679
}
748680
},
749681
"uniqueConstraints": {},
@@ -799,12 +731,8 @@
799731
"name": "schedules_user_id_users_id_fk",
800732
"tableFrom": "schedules",
801733
"tableTo": "users",
802-
"columnsFrom": [
803-
"user_id"
804-
],
805-
"columnsTo": [
806-
"id"
807-
],
734+
"columnsFrom": ["user_id"],
735+
"columnsTo": ["id"],
808736
"onDelete": "no action",
809737
"onUpdate": "no action"
810738
}
@@ -894,12 +822,8 @@
894822
"name": "sections_course_id_courses_id_fk",
895823
"tableFrom": "sections",
896824
"tableTo": "courses",
897-
"columnsFrom": [
898-
"course_id"
899-
],
900-
"columnsTo": [
901-
"id"
902-
],
825+
"columnsFrom": ["course_id"],
826+
"columnsTo": ["id"],
903827
"onDelete": "no action",
904828
"onUpdate": "no action"
905829
}
@@ -966,11 +890,7 @@
966890
"public.status": {
967891
"name": "status",
968892
"schema": "public",
969-
"values": [
970-
"open",
971-
"closed",
972-
"canceled"
973-
]
893+
"values": ["open", "closed", "canceled"]
974894
}
975895
},
976896
"schemas": {},
@@ -983,4 +903,4 @@
983903
"schemas": {},
984904
"tables": {}
985905
}
986-
}
906+
}

apps/engine/drizzle/meta/_journal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"breakpoints": true
1111
}
1212
]
13-
}
13+
}

apps/engine/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
"type": "module",
33
"scripts": {
44
"start": "bun ./src/main.ts",
5+
"dev": "bun ./src/main.ts",
56
"cli": "bun ./src/cli.ts",
67
"format": "prettier --write .",
78
"lint": "eslint .",
89
"db:generate": "drizzle-kit generate",
910
"db:migrate": "drizzle-kit migrate",
1011
"db:studio": "drizzle-kit studio",
1112
"db:schema": "bun src/db/generate-dbml.ts",
12-
"docker:up": "docker-compose up -d",
13-
"docker:down": "docker-compose down",
14-
"docker:logs": "docker-compose logs -f",
15-
"docker:restart": "docker-compose restart",
16-
"docker:ps": "docker-compose ps",
17-
"docker:clean": "docker-compose down -v"
13+
"docker:up": "docker compose up -d",
14+
"docker:down": "docker compose down",
15+
"docker:logs": "docker compose logs -f",
16+
"docker:restart": "docker compose restart",
17+
"docker:ps": "docker compose ps",
18+
"docker:clean": "docker compose down -v"
1819
},
1920
"dependencies": {
2021
"@fastify/sensible": "^6.0.3",
@@ -26,7 +27,8 @@
2627
"fastify": "^5.5.0",
2728
"fastify-plugin": "^5.0.1",
2829
"jsdom": "^26.1.0",
29-
"pg": "^8.16.3"
30+
"pg": "^8.16.3",
31+
"redis": "^4.6.0"
3032
},
3133
"devDependencies": {
3234
"@eslint/js": "^9.34.0",

0 commit comments

Comments
 (0)