Skip to content

Commit

Permalink
chore: update env
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrastopoulos committed Aug 27, 2024
1 parent b070f90 commit 8aa57aa
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 16 deletions.
3 changes: 2 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"type": "module",
"scripts": {
"start": "bun run ./build/app.js",
"dev": "dotenv -e ../.env -- bun --watch src/app.ts",
"dev": "bun --watch src/app.ts",
"build": "bun build ./src/app.ts --target=bun --outdir=build",
"format": "prettier --write . --ignore-path .gitignore",
"lint": "./node_modules/.bin/eslint ./src/**"
},
"dependencies": {
"@clerk/clerk-sdk-node": "^5.0.30",
"@cmucourses/db": "workspace:*",
"axios": "^0.27.1",
"cors": "^2.8.5",
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@types/mongoose": "^5.11.97",
"@types/uuid": "^8.3.4",
"axios": "^0.24.0",
"dotenv": "^16.4.5",
"downshift": "^6.1.7",
"fuse.js": "^7.0.0",
"jose": "^4.8.1",
Expand Down
8 changes: 4 additions & 4 deletions apps/frontend/src/app/api/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const fetchCourseInfos = createAsyncThunk<
const newIds = ids.filter((id) => !(id in state.cache.courseResults));
if (newIds.length === 0) return [];

const url = `${process.env.backendUrl || ""}/courses?`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/courses?`;
const params = new URLSearchParams(ids.map((id) => ["courseID", id]));

params.set("schedules", "true");
Expand Down Expand Up @@ -56,7 +56,7 @@ export const fetchCourseInfosByPage = createAsyncThunk<
>("fetchCourseInfosByPage", async (page: number, thunkAPI) => {
const state = thunkAPI.getState();

const url = `${process.env.backendUrl || ""}/courses/search?`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/courses/search?`;
const params = new URLSearchParams({
page: `${page}`,
schedules: "true",
Expand Down Expand Up @@ -129,7 +129,7 @@ export const fetchCourseInfo = createAsyncThunk<
const state = thunkAPI.getState();
if (courseID in state.cache.courseResults && !schedules) return;

const url = `${process.env.backendUrl || ""}/course/${courseID}?`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/course/${courseID}?`;
const params = new URLSearchParams({
schedules: schedules ? "true" : "false",
});
Expand All @@ -145,7 +145,7 @@ export const fetchAllCourses = createAsyncThunk<
void,
{ state: RootState }
>("fetchAllCourses", async (_, thunkAPI) => {
const url = `${process.env.backendUrl || ""}/courses/all`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/courses/all`;
const state = thunkAPI.getState();

if (state.cache.allCourses.length > 0) return;
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/app/api/fce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const fetchFCEInfosByCourse = createAsyncThunk<
const newIds = courseIDs.filter((id) => !(id in state.cache.fces));
if (newIds.length === 0) return;

const url = `${process.env.backendUrl || ""}/fces?`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/fces?`;
const params = new URLSearchParams();

newIds.forEach((courseID) => params.append("courseID", courseID));
Expand Down Expand Up @@ -43,7 +43,7 @@ export const fetchFCEInfosByInstructor = createAsyncThunk<

if (instructor in state.cache.instructorResults) return;

const url = `${process.env.backendUrl || ""}/fces?`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/fces?`;
const params = new URLSearchParams();
params.append("instructor", instructor);

Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/app/api/instructors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const fetchAllInstructors = createAsyncThunk<
void,
{ state: RootState }
>("fetchAllInstructors", async (_, thunkAPI) => {
const url = `${process.env.backendUrl || ""}/instructors`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL || ""}/instructors`;
const state = thunkAPI.getState();

if (state.cache.allInstructors.length > 0) return;
Expand Down
24 changes: 20 additions & 4 deletions apps/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,35 @@
"outDir": "./build",
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
"~/*": [
"./src/*"
]
},
"plugins": [{ "name": "next" }],
"plugins": [
{
"name": "next"
}
],
"declaration": false,
"declarationMap": false,
"incremental": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"module": "ESNext",
"noEmit": true,
"resolveJsonModule": true,
"strict": true,
"target": "ES6"
},
"include": ["./src/**/*"]
"include": [
"./src/**/*",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"dependsOn": ["^db-generate"]
},
"dev": {
"dependsOn": ["^db-generate"]
"dependsOn": ["^db-generate"],
"configurations": {
"development": {}
}
},
"build": {
"dependsOn": ["^db-generate"]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"packageManager": "[email protected]",
"scripts": {
"dev": "nx run-many -t dev --parallel",
"dev": "nx run-many -c development -t dev --parallel",
"build": "nx run-many -t build --parallel",
"start": "nx run-many -t start --parallel"
},
Expand Down
1 change: 0 additions & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"main": "index.ts",
"dependencies": {
"@prisma/client": "^5.6.0",
"dotenv": "^16.3.1",
"typescript": "^5.5.4"
},
"devDependencies": {
Expand Down

0 comments on commit 8aa57aa

Please sign in to comment.