Skip to content

Commit

Permalink
Merge pull request #59 from hotungkhanh/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hotungkhanh authored Nov 2, 2024
2 parents 2ee423d + 2f8d312 commit 340b44e
Show file tree
Hide file tree
Showing 44 changed files with 2,099 additions and 287 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main


jobs:
build:
Expand All @@ -26,7 +27,11 @@ jobs:
- name: Build Frontend
run: |
cd frontend
npm run test
npm run build
env:
VITE_FRONTEND_USERNAME: ${{secrets.FRONTEND_USERNAME}}
VITE_FRONTEND_PASSWORD: ${{secrets.FRONTEND_PASSWORD}}

- name: Set up Java for Backend
uses: actions/setup-java@v4
Expand Down
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Licensing

This project, "Timetabling for VIT," was developed for the Victorian Institute of Technology (VIT) as part of an industry-based project facilitated by the University of Melbourne.

## Copyright Notice

Copyright © 2024 Victorian Institute of Technology (VIT). All rights reserved.

All intellectual property rights in the deliverables for this project are owned by the University of Melbourne and have been assigned to the Victorian Institute of Technology (VIT) under the terms of the Student Assignment and License Deed Poll. This assignment grants VIT exclusive rights to the code, documentation, and any related intellectual property created for this project.

## Use and Distribution Restrictions

The use, reproduction, modification, or distribution of this project's source code or any related deliverables is prohibited without the express written permission of the Victorian Institute of Technology. Unauthorized use of this project, in whole or in part, may result in legal action.

## Open-Source Components

This project may include open-source libraries or frameworks. Each such component retains its original license, and users are required to comply with the terms of each respective license. Please consult the documentation of each external component for detailed licensing information.

## Confidentiality

All confidential information, proprietary code, and other non-public materials remain the exclusive property of the Victorian Institute of Technology. By accessing or using this project, you agree to abide by these terms and to maintain the confidentiality of the project’s proprietary information.

---

For questions or permissions, please contact the Victorian Institute of Technology.
392 changes: 357 additions & 35 deletions README.md

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions backend/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.acme</groupId>
Expand Down Expand Up @@ -56,6 +55,14 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand All @@ -78,23 +85,23 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.26.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
1 change: 0 additions & 1 deletion backend/src/main/java/org/acme/domain/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class Unit extends PanacheEntity {
@PlanningVariable
public LocalTime startTime;

// TODO: change unit to be the owner, rather than the student being owner
@Transient
@JsonIgnoreProperties("units")
@ManyToMany(mappedBy = "units", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
Expand Down
26 changes: 0 additions & 26 deletions backend/src/main/java/org/acme/rest/StudentResource.java

This file was deleted.

37 changes: 9 additions & 28 deletions backend/src/main/java/org/acme/rest/TimetableResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public Response timetableUpdate(List<Unit> updatedUnits) {
* @param dbUnits List of all Unit objects in the database
* @return The updated Unit, null otherwise
*/
@PUT
@Transactional
@Consumes(MediaType.APPLICATION_JSON)
public Unit unitUpdate(Unit updatedUnit, List<Unit> dbUnits) {
Expand Down Expand Up @@ -129,8 +128,6 @@ public Room findRoom(Room inputRoom) {
return null;
}


@Path("/view")
@GET
@RolesAllowed({"user"})
@Produces(MediaType.APPLICATION_JSON)
Expand All @@ -147,6 +144,7 @@ public void findByCampusAndDelete(String campusName) {
}
}

@Path("/example")
@GET
@RolesAllowed({"user"})
@Transactional
Expand Down Expand Up @@ -175,48 +173,31 @@ public Timetable solveExample() throws ExecutionException, InterruptedException
var problem = new Timetable("Adelaide",
List.of(
u1, u2, u3, u4
// new Unit(5, "5", Duration.ofHours(2), List.of(c, d, e)),
// new Unit(6, "6", Duration.ofHours(2), List.of(f, g, h, i))
),

List.of(
DayOfWeek.MONDAY,
DayOfWeek.TUESDAY,
DayOfWeek.WEDNESDAY
// DayOfWeek.THURSDAY,
// DayOfWeek.FRIDAY
DayOfWeek.WEDNESDAY,
DayOfWeek.THURSDAY,
DayOfWeek.FRIDAY
),

List.of(
LocalTime.of(15, 0)
// LocalTime.of(17, 0)
// LocalTime.of(16,0),
// LocalTime.of(23,0)
LocalTime.of(15, 0),
LocalTime.of(17, 0),
LocalTime.of(16,0),
LocalTime.of(23,0)
),
List.of(r1, r2, r3)
);

/*
* During this solving phase, new Unit objects will be created with the
* allotted date and Room assignment.
*
* Currently, the 'old' Unit objects in the 'problem' variable and the
* 'new' Unit objects in the 'solution' variable are stored as different
* Units in the database due to our inability to control the behaviour
* of solverManager.solve
*
* i.e. after solving, there will be 2 copies of each Unit in the
* database, where the 'old' Unit has the list of students but no
* timetable assignment, while the 'new' Unit does not have the list
* of students enrolled, but does have the assigned date and room
*/

findByCampusAndDelete(problem.campusName);

Timetable solution = solverManager.solve("job 1", problem).getFinalBestSolution();

solution.persist();
// saves the solution timetable and all related entities to database
solution.persist();

return solution;
}
Expand Down
11 changes: 11 additions & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ quarkus.datasource.jdbc.initial-size=10
quarkus.datasource.jdbc.idle-removal-interval=5M
quarkus.datasource.jdbc.max-lifetime=30M

# Swagger UI for endpoint descriptions
quarkus.swagger-ui.always-include=true
quarkus.smallrye-openapi.info-title=Timetabling for VIT
%dev.quarkus.smallrye-openapi.info-title=Timetabling for VIT (development)
%test.quarkus.smallrye-openapi.info-title=Timetabling for VIT (test)
quarkus.smallrye-openapi.info-version=1.0.1
quarkus.smallrye-openapi.info-description=AI-powered timetabling solution for VIT
quarkus.smallrye-openapi.info-contact-email=[email protected]
quarkus.smallrye-openapi.info-contact-name=JetEdge Customer Support
quarkus.smallrye-openapi.info-license-name=Apache 2.0
quarkus.smallrye-openapi.info-license-url=https://www.apache.org/licenses/LICENSE-2.0.html

# -------------------------------------------
# Debuggers
Expand Down
Binary file added docs/Architecture Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Database ER Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Domain Model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Flow Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Motivational Model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/User Stories.xlsx
Binary file not shown.
Loading

0 comments on commit 340b44e

Please sign in to comment.