Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ NEXTAUTH_URL='http://localhost:3000'
# Ably
ABLY_SERVER_API_KEY='<ABLY_SERVER_API_KEY>'
NEXT_PUBLIC_ABLY_CLIENT_API_KEY='<ABLY_CLIENT_API_KEY>'

# Course Info
NEXT_PUBLIC_COURSE_ID='<COURSE_ID>'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "simple-office-hours-queue",
"version": "0.1.0",
"engines": {"node": ">=18.17"},
"private": true,
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
Expand Down
2 changes: 2 additions & 0 deletions src/env/schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const serverSchema = z.object({
*/
export const clientSchema = z.object({
NEXT_PUBLIC_ABLY_CLIENT_API_KEY: z.string(),
NEXT_PUBLIC_COURSE_ID: z.string()
});

/**
Expand All @@ -31,4 +32,5 @@ export const clientSchema = z.object({
*/
export const clientEnv = {
NEXT_PUBLIC_ABLY_CLIENT_API_KEY: process.env.NEXT_PUBLIC_ABLY_CLIENT_API_KEY,
NEXT_PUBLIC_COURSE_ID: process.env.NEXT_PUBLIC_COURSE_ID,
};
4 changes: 3 additions & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const COURSE_ID = "CS61B";
import { clientEnv } from "../env/schema.mjs";

export const COURSE_ID = clientEnv.NEXT_PUBLIC_COURSE_ID;

export const EMAIL_REGEX =
/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
Expand Down