Skip to content

Commit fabb46f

Browse files
Merge pull request #257 from COS301-SE-2024/stable
Stable
2 parents f14c044 + 26fe1bf commit fabb46f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1104
-302
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/deploy.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Vercel Production Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.PROJECT_ID }}
5+
on:
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
Deploy-Production:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install Vercel CLI
15+
run: npm install --global vercel@latest
16+
- name: Pull Vercel Environment Information
17+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_ACCESS_TOKEN }}
18+
- name: Build Project Artifacts
19+
run: vercel build --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}
20+
- name: Deploy Project Artifacts to Vercel
21+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}

.github/workflows/preview.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# .github/workflows/preview.yml
2+
3+
name: Preview Environment
4+
5+
env:
6+
VERCEL_ACCESS_TOKEN: ${{ secrets.VERCEL_ACCESS_TOKEN }}
7+
VERCEL_PROJECT_ID: ${{ secrets.PROJECT_ID }}
8+
9+
on:
10+
pull_request:
11+
types: [opened, synchronize, closed]
12+
branches:
13+
- develop
14+
- stable
15+
- main
16+
17+
jobs:
18+
deploy:
19+
if: ${{ github.event.action == 'opened' || github.event.action == 'synchronize' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: snaplet/vercel-action@v3
23+
delete:
24+
if: ${{ github.event.action == 'closed' }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: snaplet/vercel-action@v3
28+
with:
29+
delete: true

.github/workflows/tests.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name: Run Tests
22
on:
3-
push:
4-
branches:
5-
- main
6-
- develop
7-
pull_request:
8-
branches:
9-
- main
10-
- develop
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- main
10+
- develop
11+
1112
jobs:
1213
build:
1314
name: Unit
@@ -19,14 +20,18 @@ jobs:
1920
node-version: 18.17.0
2021
- uses: oven-sh/setup-bun@v1
2122
with:
22-
bun-version: latest
23+
bun-version: latest
2324
- name: Create .env file
2425
run: |
25-
echo AUTH_SECRET=${{ secrets.AUTH_SECRET }} >> src/.env
26-
echo TEST_PASSWORD=${{ secrets.TEST_PASSWORD }} >> src/.env
27-
echo SENDGRID_RECOVERY=${{ secrets.SENDGRID_RECOVERY }} >> src/.env
28-
echo SENDGRID_API_KEY=${{ secrets.SENDGRID_API_KEY }} >> src/.env
29-
echo FROM_EMAIL=${{ secrets.FROM_EMAIL }} >> src/.env
26+
echo AUTH_SECRET=${{ secrets.AUTH_SECRET }} >> src/.env
27+
echo TEST_PASSWORD=${{ secrets.TEST_PASSWORD }} >> src/.env
28+
echo SENDGRID_RECOVERY=${{ secrets.SENDGRID_RECOVERY }} >> src/.env
29+
echo SENDGRID_API_KEY=${{ secrets.SENDGRID_API_KEY }} >> src/.env
30+
echo FROM_EMAIL=${{ secrets.FROM_EMAIL }} >> src/.env
31+
- name: Create certificate and key with certs folder
32+
run: |
33+
mkdir src/certs
34+
openssl req -x509 -newkey rsa:4096 -keyout src/certs/key.pem -out src/certs/cert.pem -days 365 -nodes -subj "/C=US/ST=CA/L=San Francisco/O=Localhost/OU=Localhost/CN=localhost"
3035
- name: Install dependencies for the frontend
3136
run: bun install
3237
working-directory: src
@@ -36,4 +41,4 @@ jobs:
3641
- name: Upload coverage reports to Codecov
3742
uses: codecov/[email protected]
3843
with:
39-
token: ${{ secrets.CODECOV_TOKEN }}
44+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Files
22
.env
3+
.pem
34

45
# Directories
6+
certs
57
build
68
.vscode
79
.vercel

src/.DS_Store

6 KB
Binary file not shown.

src/bun.lockb

-54.9 KB
Binary file not shown.

src/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
},
6565
"type": "module",
6666
"dependencies": {
67+
"@dimforge/rapier3d-compat": "^0.14.0",
6768
"@lucia-auth/adapter-mongodb": "^1.0.3",
6869
"@node-rs/argon2": "^1.8.3",
6970
"@sendgrid/mail": "^8.1.3",
@@ -72,21 +73,23 @@
7273
"@sveltejs/adapter-vercel": "^5.4.3",
7374
"@threlte/core": "^7.3.1",
7475
"@threlte/extras": "^8.11.4",
76+
"@threlte/rapier": "^2.0.1",
7577
"@threlte/xr": "^0.1.4",
7678
"@types/canvas-confetti": "^1.6.4",
77-
"@types/three": "^0.168.0",
79+
"@types/three": "^0.165.0",
7880
"@vercel/analytics": "^1.3.1",
7981
"@vercel/speed-insights": "^1.0.12",
8082
"aws-sdk": "^2.1670.0",
8183
"axios": "^1.7.2",
8284
"bcrypt": "^5.1.1",
8385
"canvas-confetti": "^1.9.3",
86+
"date-fns": "^4.1.0",
8487
"mongodb": "^6.8.0",
8588
"mongoose": "^8.4.5",
8689
"playroomkit": "^0.0.79",
8790
"stream-chat": "^8.37.0",
8891
"svelte-french-toast": "^1.2.0",
8992
"svelte-tweakpane-ui": "^1.3.0",
90-
"three": "^0.168.0"
93+
"three": "^0.165.0"
9194
}
9295
}

src/src/lib/components/announcements/Main.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$: ({ id, role, announcements } = data);
1313
</script>
1414

15-
<main class="container mx-auto my-2 px-4">
15+
<main class="container mx-auto my-2 mt-24 px-4">
1616
{#if announcements.length === 0}
1717
<div
1818
class="flex h-full w-full flex-col items-center justify-center space-x-8 space-y-16 lg:flex-row lg:space-y-0 2xl:space-x-0"

src/src/lib/components/common/Navbar.svelte

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,46 @@
3232
];
3333
3434
const currentLinks = navLinks[role];
35+
36+
const signout = () => {
37+
window.location.href = '/signout';
38+
};
3539
</script>
3640

37-
<Navbar class="fixed start-0 top-0 z-20 w-full border-b px-2 py-2.5 sm:px-4">
38-
<NavBrand href="/">
39-
<img src="images/class-connect-logo.png" class="mr-3 h-8 sm:h-10" alt="ClassConnect Logo" />
40-
<span
41-
class="self-center whitespace-nowrap text-xl font-semibold text-gray-800 transition-colors duration-300 dark:text-white"
42-
>ClassConnect</span
43-
>
44-
</NavBrand>
45-
<NavHamburger />
46-
<NavUl>
47-
{#each currentLinks as { name, href }}
48-
<NavLi {href} active={activeUrl === href}>
49-
{name}
41+
<div class="relative px-8">
42+
<Navbar class="fixed start-0 top-0 z-20 w-full border-b px-2 sm:px-4 md:py-0.5 lg:py-0.5">
43+
<NavBrand href="/">
44+
<img src="images/class-connect-logo.png" class="mr-3 h-8 sm:h-10" alt="ClassConnect Logo" />
45+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white"
46+
>ClassConnect</span
47+
>
48+
</NavBrand>
49+
<NavHamburger />
50+
<NavUl>
51+
{#each [...currentLinks, ...commonLinks] as { name, href }}
52+
<NavLi {href} active={activeUrl === href} class="nav-link font-semibold">
53+
{name}
54+
</NavLi>
55+
{/each}
56+
<NavLi on:click={signout}>
57+
<button
58+
class="w-full transform rounded-lg bg-red-600 px-3.5 py-2 text-left font-semibold text-white transition duration-300 ease-in-out hover:bg-red-700 hover:shadow-xl dark:bg-red-700 dark:hover:bg-red-800"
59+
>
60+
Sign Out
61+
</button>
5062
</NavLi>
51-
{/each}
52-
{#each commonLinks as { name, href }}
53-
<NavLi {href} active={activeUrl === href}>
54-
{name}
55-
</NavLi>
56-
{/each}
57-
</NavUl>
58-
</Navbar>
63+
</NavUl>
64+
</Navbar>
65+
</div>
66+
67+
<style>
68+
:global(.nav-link) {
69+
padding-top: 0.5rem;
70+
}
71+
@media (max-width: 768px) {
72+
:global(.nav-link) {
73+
padding-left: 1.5rem !important;
74+
font-weight: bold;
75+
}
76+
}
77+
</style>

0 commit comments

Comments
 (0)