Skip to content

Commit

Permalink
feat: Course, Class, CourseDrawer, ClassDrawer
Browse files Browse the repository at this point in the history
  • Loading branch information
mathhulk committed Jul 15, 2024
1 parent e1d99e3 commit 6fb2209
Show file tree
Hide file tree
Showing 36 changed files with 881 additions and 714 deletions.
8 changes: 6 additions & 2 deletions backend/src/bootstrap/loaders/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { RedisClientType } from "redis";
import passportLoader from "./passport";
import { config } from "../../config";

export default async (app: Application, server: ApolloServer, redis: RedisClientType) => {
export default async (
app: Application,
server: ApolloServer,
redis: RedisClientType
) => {
app.use(compression());

// Body parser only needed during POST on the graphQL path
Expand All @@ -19,7 +23,7 @@ export default async (app: Application, server: ApolloServer, redis: RedisClient
app.use(
cors({
// Allow requests from the local frontend (should be the only requirement)
origin: [config.url, "http://localhost:3000"],
origin: [config.url, "http://localhost:8080", "http://localhost:5173"],
credentials: true,
})
);
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@shopify/draggable": "^1.1.3",
"@tanstack/react-virtual": "^3.8.2",
Expand Down
38 changes: 23 additions & 15 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { lazy } from "react";

import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client";
import * as Tooltip from "@radix-ui/react-tooltip";
import { IconoirProvider } from "iconoir-react";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
Expand All @@ -11,10 +12,10 @@ import Landing from "@/app/Landing";
import Layout from "@/components/Layout";

const About = lazy(() => import("@/app/About"));
const CatalogEnrollment = lazy(() => import("@/app/Catalog/Class/Enrollment"));
const CatalogGrades = lazy(() => import("@/app/Catalog/Class/Grades"));
const CatalogOverview = lazy(() => import("@/app/Catalog/Class/Overview"));
const CatalogSections = lazy(() => import("@/app/Catalog/Class/Sections"));
const CatalogEnrollment = lazy(() => import("@/components/Class/Enrollment"));
const CatalogGrades = lazy(() => import("@/components/Class/Grades"));
const CatalogOverview = lazy(() => import("@/components/Class/Overview"));
const CatalogSections = lazy(() => import("@/components/Class/Sections"));
const Discover = lazy(() => import("@/app/Discover"));
const Plan = lazy(() => import("@/app/Plan"));
const Schedule = lazy(() => import("@/app/Schedule"));
Expand Down Expand Up @@ -119,18 +120,25 @@ const router = createBrowserRouter([
},
]);

const client = new ApolloClient({
uri: "http://192.168.86.21:8080/api/graphql",
cache: new InMemoryCache(),
});

export default function App() {
return (
<IconoirProvider
iconProps={{
strokeWidth: 2,
width: 16,
height: 16,
}}
>
<Tooltip.Provider delayDuration={0}>
<RouterProvider router={router} />
</Tooltip.Provider>
</IconoirProvider>
<ApolloProvider client={client}>
<IconoirProvider
iconProps={{
strokeWidth: 2,
width: 16,
height: 16,
}}
>
<Tooltip.Provider delayDuration={0}>
<RouterProvider router={router} />
</Tooltip.Provider>
</IconoirProvider>
</ApolloProvider>
);
}
Loading

0 comments on commit 6fb2209

Please sign in to comment.