Skip to content

Commit

Permalink
chore: Course fetching for classes, code splitting, dependency upgrad…
Browse files Browse the repository at this point in the history
…es, etc.
  • Loading branch information
mathhulk committed Nov 22, 2024
1 parent ce2aff4 commit 1f2f584
Show file tree
Hide file tree
Showing 26 changed files with 5,961 additions and 4,655 deletions.
58 changes: 29 additions & 29 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,56 @@
"update:grades": "tsx --env-file=.env ./src/scripts/update-grade-distributions.ts"
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-typescript": "^7.24.7",
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/graphql-modules-preset": "^4.0.9",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/graphql-modules-preset": "^4.0.11",
"@graphql-codegen/introspection": "4.0.3",
"@graphql-codegen/typescript": "^4.0.9",
"@graphql-codegen/typescript-resolvers": "^4.2.1",
"@graphql-codegen/typescript": "^4.1.1",
"@graphql-codegen/typescript-resolvers": "^4.4.0",
"@repo/typescript-config": "*",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
"@types/express-session": "^1.18.0",
"@types/lodash": "^4.17.7",
"@types/node": "^20.14.12",
"@types/lodash": "^4.17.13",
"@types/node": "^22.9.1",
"@types/passport-google-oauth20": "^2.0.16",
"eslint": "^8.56.0",
"tsx": "^4.16.2",
"typescript": "^5.5.4"
"eslint": "^9.15.0",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
},
"dependencies": {
"@apollo/server": "^4.10.5",
"@apollo/server": "^4.11.2",
"@apollo/server-plugin-response-cache": "^4.1.3",
"@apollo/utils.keyvadapter": "^3.1.0",
"@aws-sdk/client-athena": "^3.679.0",
"@aws-sdk/client-s3": "^3.679.0",
"@escape.tech/graphql-armor": "^3.0.1",
"@graphql-tools/schema": "^10.0.4",
"@graphql-tools/utils": "^10.3.2",
"@keyv/redis": "^3.0.1",
"@apollo/utils.keyvadapter": "^4.0.0",
"@aws-sdk/client-athena": "^3.696.0",
"@aws-sdk/client-s3": "^3.698.0",
"@escape.tech/graphql-armor": "^3.1.1",
"@graphql-tools/schema": "^10.0.8",
"@graphql-tools/utils": "^10.5.6",
"@keyv/redis": "^4.0.1",
"@repo/common": "*",
"@repo/sis-api": "*",
"@types/papaparse": "^5.3.15",
"compression": "^1.7.4",
"compression": "^1.7.5",
"connect-redis": "^7.1.1",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-session": "^1.18.0",
"express": "^4.21.1",
"express-session": "^1.18.1",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"graphql-modules": "^2.3.0",
"graphql-modules": "^2.4.0",
"graphql-type-json": "^0.3.2",
"helmet": "^7.1.0",
"keyv": "^5.1.0",
"helmet": "^8.0.0",
"keyv": "^5.2.1",
"lodash": "^4.17.21",
"mongodb": "^6.8.0",
"mongoose": "^8.5.1",
"mongodb": "^6.10.0",
"mongoose": "^8.8.2",
"papaparse": "^5.4.1",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"redis": "^4.6.15"
"redis": "^4.7.0"
}
}
9 changes: 6 additions & 3 deletions apps/backend/src/modules/class/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import {
} from "../../generated-types/graphql";
import { ClassModule } from "./generated-types/module-types";

interface Relationships {
export interface ClassRelationships {
course: null;
term: null;
primarySection: null;
sections: null;
gradeDistribution: null;
}

export type IntermediateClass = Omit<ClassModule.Class, keyof Relationships> &
Relationships;
export type IntermediateClass = Omit<
ClassModule.Class,
keyof ClassRelationships
> &
ClassRelationships;

export const formatDate = (date?: string | number | Date | null) => {
if (!date) return date;
Expand Down
6 changes: 3 additions & 3 deletions apps/backend/src/modules/course/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { formatDate } from "../class/formatter";
import { CourseModule } from "./generated-types/module-types";

interface Relationships {
export interface CourseRelationships {
classes: null;
crossListing: string[];
requiredCourses: string[];
Expand All @@ -18,9 +18,9 @@ interface Relationships {

export type IntermediateCourse = Omit<
CourseModule.Course,
keyof Relationships
keyof CourseRelationships
> &
Relationships;
CourseRelationships;

export function formatCourse(course: CourseType) {
return {
Expand Down
6 changes: 3 additions & 3 deletions apps/backend/src/modules/schedule/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { ScheduleType } from "@repo/common";

import { ScheduleModule } from "./generated-types/module-types";

interface Relationships {
export interface ScheduleRelationships {
classes: ScheduleModule.SelectedClassInput[];
term: null;
}

export type IntermediateSchedule = Omit<
ScheduleModule.Schedule,
keyof Relationships
keyof ScheduleRelationships
> &
Relationships;
ScheduleRelationships;

export const formatSchedule = async (schedule: ScheduleType) => {
return {
Expand Down
6 changes: 3 additions & 3 deletions apps/backend/src/modules/user/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { UserType } from "@repo/common";

import { UserModule } from "./generated-types/module-types";

interface Relationships {
export interface UserRelationships {
bookmarkedCourses: UserModule.BookmarkedCourseInput[];
bookmarkedClasses: UserModule.BookmarkedClassInput[];
}

export type IntermediateUser = Omit<UserModule.User, keyof Relationships> &
Relationships;
export type IntermediateUser = Omit<UserModule.User, keyof UserRelationships> &
UserRelationships;

export const formatUser = (user: UserType) => {
return {
Expand Down
6 changes: 3 additions & 3 deletions apps/datapuller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"course": "tsx src/course.ts"
},
"devDependencies": {
"@types/node": "^20.14.12",
"eslint": "^8.56.0",
"typescript": "^5.5.4"
"@types/node": "^22.9.1",
"eslint": "^9.15.0",
"typescript": "^5.6.3"
},
"dependencies": {
"@repo/common": "*",
Expand Down
57 changes: 29 additions & 28 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,48 @@
"start": "serve -s dist -p 3000"
},
"dependencies": {
"@apollo/client": "^3.11.1",
"@floating-ui/dom": "^1.6.8",
"@apollo/client": "^3.11.10",
"@floating-ui/dom": "^1.6.12",
"@mapbox/mapbox-gl-directions": "^4.3.1",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.4",
"@repo/theme": "*",
"@shopify/draggable": "^1.1.3",
"@tanstack/react-virtual": "^3.8.3",
"@tanstack/react-virtual": "^3.10.9",
"classnames": "^2.5.1",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"iconoir-react": "^7.8.0",
"mapbox-gl": "^3.5.2",
"iconoir-react": "^7.10.0",
"mapbox-gl": "^3.8.0",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.25.1",
"recharts": "^2.12.7"
"react-router-dom": "^6.28.0",
"recharts": "^2.13.3",
"sass-embedded": "^1.81.0"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@types/mapbox-gl": "^3.1.0",
"@types/node": "^20.14.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.9",
"sass": "^1.77.8",
"serve": "^14.2.3",
"typescript": "^5.5.4",
"vite": "^5.3.5"
"@types/mapbox-gl": "^3.4.1",
"@types/node": "^22.9.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^9.15.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"sass": "^1.81.0",
"serve": "^14.2.4",
"typescript": "^5.6.3",
"vite": "^5.4.11"
}
}
8 changes: 5 additions & 3 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {

import { ThemeProvider } from "@repo/theme";

import Catalog from "@/app/Catalog";
import Enrollment from "@/app/Enrollment";
import Grades from "@/app/Grades";
import Landing from "@/app/Landing";
import Layout from "@/components/Layout";
import PinsProvider from "@/components/PinsProvider";

// TODO: Experiment with server-side rendering for static pages and hydration for dynamic pages

const Class = {
Enrollment: lazy(() => import("@/components/Class/Enrollment")),
Grades: lazy(() => import("@/components/Class/Grades")),
Expand All @@ -31,6 +30,9 @@ const Course = {
Classes: lazy(() => import("@/components/Course/Classes")),
};

const Catalog = lazy(() => import("@/app/Catalog"));
const Enrollment = lazy(() => import("@/app/Enrollment"));
const Grades = lazy(() => import("@/app/Grades"));
const About = lazy(() => import("@/app/About"));
const Discover = lazy(() => import("@/app/Discover"));
const Plan = lazy(() => import("@/app/Plan"));
Expand Down
Loading

0 comments on commit 1f2f584

Please sign in to comment.