Skip to content
Open
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
2ae9718
how does routers keep getting undeleted
probably-neb May 29, 2023
e40afd4
npm run lint --fix
probably-neb May 29, 2023
1edb17c
fix reimport in MenuBar
probably-neb May 29, 2023
d8c6656
remove warnings for unused variables that start with '_'
probably-neb May 29, 2023
49285db
remove unused files
probably-neb May 29, 2023
bd7b990
disable eslint for incomplete scraping files
probably-neb May 29, 2023
ea45c3c
remove unused imports
probably-neb May 29, 2023
4f087ce
add key to course card iter
probably-neb May 29, 2023
8404cbf
remove unused CourseDetails and Comment files
probably-neb May 29, 2023
235c998
remove ts-ignores
probably-neb May 29, 2023
f290d56
remove unused variables
probably-neb May 29, 2023
0e45b0c
remove unused course assignment file
probably-neb May 29, 2023
f5d918e
fix typing in coursecard
probably-neb May 29, 2023
7c7f34f
fixup! remove unused CourseDetails and Comment files
probably-neb May 29, 2023
9419321
add provided.placeholder to Quarter again
probably-neb May 29, 2023
abbc94b
gitignore package-lock
probably-neb May 29, 2023
8c0d67b
run prettier
probably-neb May 29, 2023
e3aa2cf
create prisma connection
probably-neb May 30, 2023
4a6fe46
update prisma db to align with scraped types
probably-neb May 30, 2023
19654fc
use db for degrees
probably-neb May 30, 2023
5be368b
use url segement as degree id
probably-neb May 30, 2023
8271ea3
remove unnecessary aliases to t.procedure and t.router
probably-neb May 30, 2023
7a6c5ca
make quarters subrouter
probably-neb May 30, 2023
dd893dc
create degrees subrouter
probably-neb May 30, 2023
e27944e
move scraping of department courses into catalog
probably-neb May 31, 2023
611a373
clean up prisma schema
probably-neb May 31, 2023
227f353
department and degree ids from catalog url routes
probably-neb May 31, 2023
39aab62
remove crosslist syntax from parsed degree requirements
probably-neb May 31, 2023
33a702c
function to update all catalog data in db
probably-neb Jun 1, 2023
c72bfa3
create dedicated file for updating db from scraped data and bash scri…
probably-neb Jun 2, 2023
5ce47ab
create CourseCodeSchema for validation
probably-neb Jun 2, 2023
a0d6d93
extract major courses function
probably-neb Jun 4, 2023
13a2a0f
refactor requirements list as list of and/or groups
probably-neb Jun 4, 2023
8946e4a
add course req kind
probably-neb Jun 4, 2023
7d25f14
parsing ge reqs table
probably-neb Jun 4, 2023
378053f
include ge units
probably-neb Jun 4, 2023
3c38fb2
rigid course code schema
probably-neb Jun 5, 2023
f627d0d
ge area scraping
probably-neb Jun 5, 2023
7689bf6
parse subareas previously included in constraints
probably-neb Jun 5, 2023
656f9cc
scrape uscp courses
probably-neb Jun 6, 2023
87fea6f
fetch-retry
probably-neb Jun 6, 2023
fcba140
scrape concentrations
probably-neb Jun 6, 2023
54c9828
update prisma schema for new requirements
probably-neb Jun 7, 2023
f927d6c
rewrite course requirement scraping logic
probably-neb Jun 7, 2023
8bc9fe5
further improvements to scraping
probably-neb Jun 7, 2023
05bdd31
further updates to schmea
probably-neb Jun 8, 2023
2ff6de5
minor bug fixes/cleaning in scraping
probably-neb Jun 8, 2023
e405c5e
working degree/course/subject creation
probably-neb Jun 8, 2023
71364c2
update prisma client
probably-neb Jun 8, 2023
4b5c4a5
catch and log scraping errors with FIXME's for later
probably-neb Jun 8, 2023
1f8e203
working course requirement creation
probably-neb Jun 8, 2023
1fe8549
working ge requirement creation
probably-neb Jun 8, 2023
bf7e5d7
working concentration creation
probably-neb Jun 8, 2023
59302b1
Merge branch 'main' into db
probably-neb Jun 8, 2023
0314651
working db course requirement fetching
probably-neb Jun 9, 2023
17d15f1
returning ge requirements
probably-neb Jun 9, 2023
b7b780f
Merge branch 'main' into db
probably-neb Jun 9, 2023
f76b08f
wipe db function
probably-neb Jun 9, 2023
9bdf728
use db in backend
probably-neb Jun 9, 2023
c4f1f1d
fullfillments endpoint
probably-neb Jun 9, 2023
346d89e
check all ids unique
probably-neb Jun 9, 2023
17be8a8
sections endpoint!
probably-neb Jun 9, 2023
0a7ac50
oops import the type
probably-neb Jun 9, 2023
68c0fa1
uscp+gwr requirements
probably-neb Jun 9, 2023
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
5 changes: 3 additions & 2 deletions kanban-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"dev": "npx prisma db push && next dev",
"postinstall": "prisma generate",
"lint": "next lint",
"start": "next start",
"format": "npx prettier --write src/"
},
"dependencies": {
"@headlessui/react": "^1.7.15",
"@prisma/client": "^4.11.0",
"@prisma/client": "^4.14.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.4",
"@radix-ui/react-avatar": "^1.0.3",
Expand Down Expand Up @@ -46,6 +46,7 @@
"clsx": "^1.2.1",
"cmdk": "^0.2.0",
"eslint-config-next": "^13.4.2",
"fetch-retry": "^5.0.6",
"framer-motion": "^10.12.16",
"lucide-react": "^0.233.0",
"moment": "^2.29.4",
Expand Down
326 changes: 187 additions & 139 deletions kanban-dashboard/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,164 +1,212 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// NOTE: models have either id or code fields
// Models whose primary key is not explicitly used by cal poly have an id field although it may be something aquired from cal poly such as
// the degree id which is determined from the degree page url path on the catalog site
// Models (such as subject) whose primary key is used by cal poly have a code field

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}

model Department {
id Int @id @default(autoincrement())
long_name String
short_name String @unique
Program Program[]
Instructor Instructor[]
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}

model Course {
id Int @id @default(autoincrement())
// TODO: make department table and convert this to a foreign key
department String
number Int
code String @id
subjectCode String
subject Subject @relation(fields: [subjectCode], references: [code])
title String
number Int
description String @db.LongText
// string because it can be range or single number and we only need
// to display it either way
units String
minUnits Int
maxUnits Int
// string of comma separated terms
terms String

fulfillsRequirements Requirement[]

prerequisites Prerequisite[] @relation("Prereq")
prerequisiteFor Prerequisite[] @relation("PrereqFor")
sections Section[]

@@unique([department, number])
}

model Prerequisite {
id Int @id @default(autoincrement())
requiredCourse Course @relation(name: "Prereq", fields: [requiredCourseId], references: [id])
forCourse Course @relation(name: "PrereqFor", fields: [forCourseId], references: [id])
forCourseId Int
requiredCourseId Int

@@unique([requiredCourseId, forCourseId])
}

model Requirement {
// TODO: figure out how to make unique ids based on the requirement
id Int @id @default(autoincrement())
course Course @relation(fields: [courseId], references: [id])
program Program @relation(fields: [programId], references: [id])
// Ge, major, tech elective, etc.
// TODO: make this an enum
kind String

courseId Int
programId Int
}

model Program {
id Int @id @default(autoincrement())
department Department @relation(fields: [departmentId], references: [id])
// BS, BA, etc.
type String
requirements Requirement[]
departmentId Int
catolog Catolog @relation(fields: [catologId], references: [id])
catologId Int
User User[]

@@unique([departmentId, type])
}

model Catolog {
id Int @id @default(autoincrement())
startYear Int
endYear Int
programs Program[]
}

model Instructor {
id Int @id @default(autoincrement())
name String @unique
department Department @relation(fields: [departmentId], references: [id])
departmentId Int
officeHours String
Section Section[]
}

// TODO: make sure this is the best way we could store this
model Meeting {
id Int @id @default(autoincrement())
startTime DateTime
endTime DateTime
section Section? @relation(fields: [sectionClassNumber], references: [classNumber])
sectionClassNumber Int?
location String
}

model Availability {
id Int @id @default(autoincrement())
seats Int
capacity Int
waitlist Int
waitlistCapacity Int
time DateTime @default(now())
section Section @relation(fields: [sectionClassNumber], references: [classNumber])
sectionClassNumber Int
}

model Section {
classNumber Int @id
course Course @relation(fields: [courseId], references: [id])
courseId Int
quarter Quarter @relation(fields: [quarterId], references: [id])
quarterId Int
status String
session String
intstructionMode String
career String
// TODO: make sure this aligns with a quarters start and end
// dates MeetingTime
instructor Instructor @relation(fields: [instructorId], references: [id])
instructorId Int
meetings Meeting[]
grading String
location String
campus String
classComponents String
availability Availability[]
}

model Quarter {
id Int @id @default(autoincrement())
term String
year Int
classes Section[]
user User? @relation(fields: [userCalPolyUsername], references: [calPolyUsername])
userCalPolyUsername String?
UserFlowchart UserFlowchart? @relation(fields: [userFlowchartId], references: [id])
userFlowchartId Int?
startDate DateTime
endDate DateTime
// TODO: make this a bitmask
termsTypicallyOffered String

fullfillsGERequirements GEAreaFullfillmentCourse[]
fullfillsCourseRequirements CourseRequirement[]
USCP Boolean @default(false)
GWR Boolean @default(false)

@@index([code, USCP, GWR])
}

model Subject {
code String @id
name String
courses Course[]
}

// TODO: make this a type
model RecommendedCompletion {
year Int
term Term
GERequirement GERequirement[]
CourseRequirement CourseRequirement[]

@@id([year, term])
}

enum Term {
F
W
SP
SU
}

enum GEArea {
A
B
C
D
E
F
ELECTIVE
}

enum GESubArea {
LowerDivision
UpperDivision
LowerDivisionElective
UpperDivisionElective
F
E
Elective
A1
A2
A3
A4
B1
B2
B3
B4
C1
C2
C3
C4
D1
D2
D3
D4
}

model GERequirement {
area GEArea
subArea GESubArea
units Int
recommendedCompletion RecommendedCompletion? @relation(fields: [recommendedCompletionYear, recommendedCompletionTerm], references: [year, term])
recommendedCompletionYear Int?
recommendedCompletionTerm Term?
degree Degree @relation(fields: [degreeId], references: [id])
degreeId String
// TODO: connect to course requirement

@@id([area, subArea, degreeId])
}

enum RequirementKind {
major
support
elective
}

model CourseRequirement {
course Course @relation(fields: [courseCode], references: [code])
courseCode String
kind RequirementKind
recommendedCompletion RecommendedCompletion? @relation(fields: [recommendedCompletionYear, recommendedCompletionTerm], references: [year, term])
recommendedCompletionYear Int?
recommendedCompletionTerm Term?
RequirementGroup CourseRequirementGroup @relation(fields: [requirementGroupId], references: [id])
requirementGroupId Int

@@id([courseCode, requirementGroupId])
}

enum RequirementGroupKind {
or
and
}

// represents a series (such as PHYS 1,2,3) or a list of choices (such as an elective)
model CourseRequirementGroup {
id Int @id @default(autoincrement())
groupKind RequirementGroupKind
coursesKind RequirementKind
// e.x. Life Science Support where coursesKind is elective
courseKindInfo String?
courses CourseRequirement[]
// child and parent are swapped in the relation name because it is referring to the reference to itself
// i.e. the reference to this groups parent views this group as the child
parentGroup CourseRequirementGroup? @relation("toParent", fields: [parentId], references: [id], onDelete: NoAction, onUpdate: NoAction)
parentId Int?
childGroups CourseRequirementGroup[] @relation("toParent")
// should be total units for and group or total required for or group
unitsOf Int?
degree Degree? @relation(fields: [degreeId], references: [id])
concentration Concentration? @relation(fields: [concentrationId], references: [id])
degreeId String?
concentrationId String?

@@index([id])
}

enum RequirementsKind {
degree
concentration
}

model Concentration {
id String @id
name String
courseRequirements CourseRequirementGroup[]
degree Degree @relation(fields: [degreeId], references: [id])
degreeId String

@@unique([degreeId, name])
}

model Degree {
id String @id
name String
link String
// TODO: make this an enum of BS, BA, etc.
kind String
requirements CourseRequirementGroup[]
concentrations Concentration[]
GERequirement GERequirement[]

@@unique([name, kind])
@@index([id])
}

model GEAreaFullfillmentCourse {
id Int @id @default(autoincrement())
area GEArea
subArea GESubArea
courseId String
course Course @relation(fields: [courseId], references: [code])

@@unique([area, subArea, courseId])
}

model User {
calPolyUsername String @id
program Program @relation(fields: [programId], references: [id])
year Int
quarters Quarter[]
programId Int
flowcharts UserFlowchart[]
}

model UserFlowchart {
id Int @id @default(autoincrement())
user User @relation(fields: [userCalPolyUsername], references: [calPolyUsername])
quarters Quarter[]
id Int @id @default(autoincrement())
user User @relation(fields: [userCalPolyUsername], references: [calPolyUsername])
startYear Int
userCalPolyUsername String
}
Loading