Skip to content

Commit d0b9648

Browse files
Merge pull request #37 from COS301-SE-2024/stable
Stable
2 parents 8420486 + 9a4a31f commit d0b9648

File tree

165 files changed

+18653
-14428
lines changed

Some content is hidden

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

165 files changed

+18653
-14428
lines changed

.github/workflows/backend-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build:
14-
name: Run ESLint
14+
name: Run Backend tests
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v2
@@ -25,7 +25,7 @@ jobs:
2525
run: bun install
2626
working-directory: src/server/workspace
2727
- name: Run Backend Tests
28-
run: bun run test
28+
run: bun run test:cov
2929
working-directory: src/server/workspace
3030
- name: Upload coverage reports to Codecov
3131
uses: codecov/[email protected]

.github/workflows/frontend-tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Run Frontend Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- main
10+
- develop
11+
12+
jobs:
13+
build:
14+
name: Frontend tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: 18.17.0
21+
- uses: oven-sh/setup-bun@v1
22+
with:
23+
bun-version: latest
24+
- name: Install dependencies for the frontend
25+
run: bun install
26+
working-directory: src/client
27+
- name: Boot frontend
28+
run: bash boot.sh
29+
working-directory: scripts
30+
- name: Run Frontend Tests
31+
run: npm run cy:run-ct
32+
working-directory: src/client
33+
- name: Upload coverage reports to Codecov
34+
uses: codecov/[email protected]
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
working-directory: src/client
3333
- name: Run Backend Linters
3434
run: bun run lint
35-
working-directory: src/server/workspace
35+
working-directory: src/server/workspace

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,16 @@ is revolutionising education by making learning more immersive and engaging.
2727

2828
#### Main Documentation
2929

30-
- [SRS Documentation](#)
31-
- [Software Architectures](#)
30+
- [SRS Documentation](https://drive.google.com/file/d/1wYVm633sFN6IBOVznN6bsqExY96VErcM/view?usp=sharing)
31+
- [Services Contract](https://drive.google.com/file/d/1WEbWfYYVXaN96uxKSO9148U9itmog2K2/view?usp=sharing)
3232

33-
#### Extra Documentation
34-
35-
- [Coding Standards](#)
36-
- [Testing Policy](#)
37-
- [Development Diagram](#)
38-
- [Installation Manual](#)
39-
- [User Manuals](#)
4033

4134
### Demos
4235

4336
#### Demo 1
4437

45-
- [Demo 1 Slides](#)
46-
- [Demo 1 Video](#)
38+
- [Demo 1 Slides](https://docs.google.com/presentation/d/1L8ZY2dsLOlN_DjLjXGGN0u27xAqYxq00/edit?usp=sharing&ouid=106314516968758648353&rtpof=true&sd=true)
39+
- [Demo 1 Video](https://drive.google.com/file/d/1AJAgftIAKCBaGVa4KQGHvoX01R3dvBUb/view?usp=sharing)
4740

4841
### Technologies
4942

@@ -55,7 +48,7 @@ is revolutionising education by making learning more immersive and engaging.
5548

5649
### Project Management
5750

58-
[Project Board](#)
51+
[Project Board](https://github.com/orgs/COS301-SE-2024/projects/80)
5952

6053
### Team Members And Their Roles
6154

scripts/boot.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Start up the frontend
4+
cd ../src/client || exit
5+
bun run dev &
6+
7+
# Store the process ID (PID) of the server
8+
next_pid=$!
9+
10+
# Wait for the server to start up
11+
while ! curl -s http://localhost:5173 > /dev/null
12+
do
13+
echo "Waiting for server to start up..."
14+
sleep 1
15+
done
16+
17+
sleep 10
18+
19+
echo "Server has started."

src/client/.eslintrc.cjs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,18 @@ module.exports = {
2727
parser: '@typescript-eslint/parser'
2828
}
2929
}
30-
]
30+
],
31+
rules: {
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/ban-types': [
34+
'error',
35+
{
36+
extendDefaults: true,
37+
types: {
38+
'{}': false
39+
}
40+
}
41+
],
42+
'@typescript-eslint/no-namespace': 'off'
43+
}
3144
};

src/client/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
77
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
88
}

src/client/bun.lockb

39.7 KB
Binary file not shown.

src/client/cypress.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
component: {
5+
devServer: {
6+
framework: 'svelte',
7+
bundler: 'vite'
8+
},
9+
typescript: {
10+
configFile: './tsconfig.json'
11+
}
12+
},
13+
14+
e2e: {}
15+
});

src/client/cypress/e2e/act.cy.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
describe('Activities page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/activities');
4+
cy.get('h1').contains('Activities').should('be.visible');
5+
});
6+
7+
const activities = [
8+
'Budget Planning Meeting',
9+
'Faculty Evaluation',
10+
'Student Affairs Committee',
11+
'Campus Safety Review',
12+
'Strategic Planning Workshop',
13+
'Alumni Networking Event'
14+
];
15+
16+
activities.forEach((activity) => {
17+
it(`displays the activity: ${activity}`, () => {
18+
cy.visit('http://localhost:5173/activities');
19+
cy.contains(activity).should('be.visible');
20+
});
21+
});
22+
});

src/client/cypress/e2e/adm.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('Admins page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/admins');
4+
cy.get('h2').contains('Admins').should('be.visible');
5+
});
6+
7+
it('displays the button', () => {
8+
cy.visit('http://localhost:5173/admins');
9+
cy.get('button').should('be.visible');
10+
});
11+
12+
it('displays the search input', () => {
13+
cy.visit('http://localhost:5173/admins');
14+
cy.get('input[type="text"]').should('be.visible');
15+
});
16+
});

src/client/cypress/e2e/ann.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
describe('Announcements page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/announcements');
4+
cy.get('h1').contains('Announcements').should('be.visible');
5+
});
6+
7+
const announcements = ['Campus Safety Drill', 'New Library Hours', 'Guest Lecture Series'];
8+
9+
announcements.forEach((announcement) => {
10+
it(`displays the announcement: ${announcement}`, () => {
11+
cy.visit('http://localhost:5173/announcements');
12+
cy.contains(announcement).should('be.visible');
13+
});
14+
});
15+
});

src/client/cypress/e2e/hm.cy.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
describe('Degree Dashboard page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173');
4+
cy.get('h1').contains('Degree Dashboard').should('be.visible');
5+
});
6+
7+
const degrees = [
8+
'BEng Mechanical Engineering',
9+
'BEng Electrical Engineering',
10+
'BEng Civil Engineering',
11+
'BSc Computer Science',
12+
'BEng Chemical Engineering',
13+
'BSc Information Technology',
14+
'MEng Industrial Engineering',
15+
'MEng Mechanical Engineering',
16+
'MEng Electrical Engineering',
17+
'MSc Computer Science',
18+
'PhD Civil Engineering',
19+
'PhD Information Technology'
20+
];
21+
22+
degrees.forEach((degree) => {
23+
it(`displays the degree: ${degree}`, () => {
24+
cy.visit('http://localhost:5173');
25+
cy.contains(degree).should('be.visible');
26+
});
27+
});
28+
});

src/client/cypress/e2e/lec.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('Lecturers page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/lecturers');
4+
cy.get('h2').contains('Lecturers').should('be.visible');
5+
});
6+
7+
it('displays the button', () => {
8+
cy.visit('http://localhost:5173/lecturers');
9+
cy.get('button').should('be.visible');
10+
});
11+
12+
it('displays the search input', () => {
13+
cy.visit('http://localhost:5173/lecturers');
14+
cy.get('input[type="text"]').should('be.visible');
15+
});
16+
});

src/client/cypress/e2e/org.cy.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe('Organisation page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/organisation');
4+
cy.get('h2').contains('Organisation').should('be.visible');
5+
});
6+
7+
it('displays the button', () => {
8+
cy.visit('http://localhost:5173/organisation');
9+
cy.get('button').should('be.visible');
10+
});
11+
});

src/client/cypress/e2e/stu.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('Students page', () => {
2+
it('displays the heading', () => {
3+
cy.visit('http://localhost:5173/students');
4+
cy.get('h2').contains('Students').should('be.visible');
5+
});
6+
7+
it('displays the button', () => {
8+
cy.visit('http://localhost:5173/students');
9+
cy.get('button').should('be.visible');
10+
});
11+
12+
it('displays the search input', () => {
13+
cy.visit('http://localhost:5173/students');
14+
cy.get('input[type="text"]').should('be.visible');
15+
});
16+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// ***********************************************************
2+
// This example support/component.ts is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands';
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
21+
22+
import { mount } from 'cypress/svelte';
23+
24+
// Augment the Cypress namespace to include type definitions for
25+
// your custom command.
26+
// Alternatively, can be defined in cypress/support/component.d.ts
27+
// with a <reference path="./component" /> at the top of your spec.
28+
declare global {
29+
namespace Cypress {
30+
interface Chainable {
31+
mount: typeof mount;
32+
}
33+
}
34+
}
35+
36+
Cypress.Commands.add('mount', mount);
37+
38+
// Example use:
39+
// cy.mount(MyComponent)

0 commit comments

Comments
 (0)