Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
87fae8d
Merge pull request #4 from IMS-coding-projects/main
An0n-01 May 28, 2025
cc2b7e7
added new reservation form
AnonNanoo May 28, 2025
2d98c4c
Refactor component imports and add OpenAPI specification for reservat…
An0n-01 May 28, 2025
98db4e5
working api
AnonNanoo Jun 11, 2025
146f617
Update document title to reflect application name
An0n-01 Jun 11, 2025
12bba09
Merge branch 'dev' of https://github.com/IMS-coding-projects/M223 int…
An0n-01 Jun 11, 2025
df04e19
added the functional api to the new form, BUT it needs major improvem…
AnonNanoo Jun 11, 2025
d3a0cbc
Merge branch 'dev' of https://github.com/IMS-coding-projects/M223 int…
AnonNanoo Jun 11, 2025
633ae5d
changed frontend port
AnonNanoo Jun 11, 2025
014f62a
NEEDS .ENV NOW!!! Add AccessKeys and CurrentReservation components; u…
An0n-01 Jun 11, 2025
a57a9f7
Merge remote-tracking branch 'origin/dev' into dev
An0n-01 Jun 11, 2025
cf3b82e
Adds room management and reservation enhancements
An0n-01 Jun 12, 2025
6cb7c88
Enhances AccessKeys component to handle reservation loading with erro…
An0n-01 Jun 12, 2025
4cff052
Adds RoomFeaturesSerializer class
An0n-01 Jun 12, 2025
202f6e2
Adds custom serializer for Room features and improves reservation edi…
An0n-01 Jun 12, 2025
f0c8206
Removes unused React logo asset, updates theme styles and color token…
An0n-01 Jun 13, 2025
0a5e1b1
Adds sharing functionality and integrates `NewReservationDialog` comp…
An0n-01 Jun 13, 2025
66fdd26
Refactors CurrentReservation and AccessKeys components for improved l…
An0n-01 Jun 15, 2025
0e4cdf5
reverted github logo and adjusted card heights
AnonNanoo Jun 15, 2025
9285599
Standardizes room feature names and enhances reservation logic
An0n-01 Jun 15, 2025
6559373
Merge branch 'dev' of https://github.com/IMS-coding-projects/M223 int…
An0n-01 Jun 15, 2025
0f050ba
added delete
AnonNanoo Jun 15, 2025
54be8b5
added a neat delete button animation
AnonNanoo Jun 15, 2025
d32e74a
Enhances AccessKeys component with alert messages for key sharing, up…
An0n-01 Jun 16, 2025
1ec8be7
Updates reservation update method to return error messages and modifi…
An0n-01 Jun 16, 2025
dc8e61c
everything works EXCEPT editing - Adds DeleteSingleReservationDialog …
An0n-01 Jun 16, 2025
bf92d1e
Enhances reservation management and UI interactions
An0n-01 Jun 16, 2025
81e5054
WORKS NOW.... SHOULD NOT CONTAIN BUGS - Refactors reservation and roo…
An0n-01 Jun 16, 2025
5b0f932
added favicon that actually looks good
AnonNanoo Jun 16, 2025
4f95fca
the biggest part should be finished... Enhances reservation system UI…
An0n-01 Jun 16, 2025
26cc6d4
Merge remote-tracking branch 'origin/dev' into dev
An0n-01 Jun 16, 2025
f6f36c7
Merge pull request #5 from IMS-coding-projects/main
An0n-01 Jun 18, 2025
117fd6b
Update README.md
An0n-01 Jun 18, 2025
1cd639a
Optimizes build output and enhances UI consistency
An0n-01 Jun 18, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
.env
*.env
10 changes: 10 additions & 0 deletions OrariAperti/backend/.run/Backend.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Backend" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
<module name="OrariAperti" />
<option name="SPRING_BOOT_MAIN_CLASS" value="ims.orariaperti.OrariApertiApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
11 changes: 8 additions & 3 deletions OrariAperti/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ OrariAperti is a room reservation system built with Spring Boot and React.

### Backend Development

To run the backend only:
To run the backend:

1. **Copy and Modify the [application.properties](./src/main/resources/application.properties.example)**
```bash
mvn spring-boot:run
mv ./src/main/resources/application.properties.example ./src/main/resources/application.properties
```

and then:
3. **Build the Application**
```bash
mvn spring-boot:run
```

3. **Run the Application**
```bash
java -jar target/OrariAperti-0.0.1-SNAPSHOT.jar
```
Expand Down
220 changes: 220 additions & 0 deletions OrariAperti/backend/backend-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
openapi: "3.1.0"
info:
title: "OrariAperti Backend API"
description: "Backend API Description of the OrariAperti application."
version: "1.0.0"
servers:
- url: "http://localhost:8080"
description: "Local server"
paths:
/api/reservation:
get:
summary: "Get reservation by key"
operationId: "getReservationByKey"
parameters:
- name: "publicKey"
in: "header"
required: false
schema:
type: "string"
format: "uuid"
- name: "privateKey"
in: "header"
required: false
schema:
type: "string"
format: "uuid"
responses:
"200":
description: "Reservation found"
content:
application/json:
schema:
type: object
properties:
reservationDetails:
$ref: "#/components/schemas/Reservation"
privateKey:
type: string
format: uuid
publicKey:
type: string
format: uuid
"400":
description: "Bad request"
"404":
description: "Not found"
post:
summary: "Create a new reservation"
operationId: "createReservation"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ReservationDTO"
responses:
"200":
description: "Reservation created"
content:
application/json:
schema:
type: object
properties:
reservation:
$ref: "#/components/schemas/Reservation"
privateKey:
type: string
format: uuid
publicKey:
type: string
format: uuid
"400":
description: "Bad request"
/api/reservation/{id}:
put:
summary: "Update a reservation"
operationId: "updateReservation"
parameters:
- name: "id"
in: "path"
required: true
schema:
type: "string"
format: "uuid"
- name: "privateKey"
in: "header"
required: true
schema:
type: "string"
format: "uuid"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ReservationDTO"
responses:
"200":
description: "Reservation updated"
content:
application/json:
schema:
$ref: "#/components/schemas/Reservation"
"400":
description: "Bad request"
"401":
description: "Unauthorized"
"404":
description: "Not found"
delete:
summary: "Delete a reservation"
operationId: "deleteReservation"
parameters:
- name: "id"
in: "path"
required: true
schema:
type: "string"
format: "uuid"
- name: "privateKey"
in: "header"
required: true
schema:
type: "string"
format: "uuid"
responses:
"200":
description: "Reservation deleted"
"401":
description: "Unauthorized"
"404":
description: "Not found"
/api/room:
get:
summary: "Get all rooms"
operationId: "getRooms"
responses:
"200":
description: "List of rooms"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Room"
"404":
description: "No rooms found"
components:
schemas:
Room:
type: object
properties:
id:
type: string
format: uuid
roomNumber:
type: string
roomFeatures:
type: array
items:
$ref: "#/components/schemas/RoomFeatures"
RoomFeatures:
type: string
enum:
- "Beamer"
- "Water Tap"
- "Whiteboard"
- "Air Conditioning"
- "Projector Screen"
- "Speaker System"
- "Video Conferencing"
- "WiFi"
- "Power Outlets"
- "Natural Light"
- "Soundproofing"
- "Smart Board"
- "Telephone"
- "Coffee Machine"
- "Printer"
- "Lockers"
Reservation:
type: object
properties:
id:
type: string
format: uuid
date:
type: string
format: date
startTime:
type: string
format: partial-time
endTime:
type: string
format: partial-time
room:
$ref: "#/components/schemas/Room"
description:
type: string
participants:
type: string
ReservationDTO:
type: object
properties:
date:
type: string
format: date
startTime:
type: string
format: partial-time
endTime:
type: string
format: partial-time
roomId:
type: string
format: uuid
description:
type: string
participants:
type: string
2 changes: 1 addition & 1 deletion OrariAperti/backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<url/>
</scm>
<properties>
<java.version>21</java.version>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ public class ReservationDTO {
private LocalDate date;
private LocalTime startTime;
private LocalTime endTime;
private int room;
private UUID roomId;
private String description;
private String participants;

public ReservationDTO() {
}

public ReservationDTO(LocalDate date, LocalTime startTime, LocalTime endTime, int room, String description, String participants) {
public ReservationDTO(LocalDate date, LocalTime startTime, LocalTime endTime, UUID roomId, String description, String participants) {
this.date = date;
this.startTime = startTime;
this.endTime = endTime;
this.room = room;
this.roomId = roomId;
this.description = description;
this.participants = participants;
}
Expand Down Expand Up @@ -48,12 +48,12 @@ public void setEndTime(LocalTime endTime) {
this.endTime = endTime;
}

public int getRoom() {
return room;
public UUID getRoomId() {
return roomId;
}

public void setRoom(int room) {
this.room = room;
public void setRoomId(UUID roomId) {
this.roomId = roomId;
}

public String getDescription() {
Expand All @@ -78,7 +78,7 @@ public String toString() {
", date=" + date +
", startTime=" + startTime +
", endTime=" + endTime +
", room=" + room +
", roomId=" + roomId +
", description='" + description + '\'' +
", participants='" + participants + '\'' +
'}';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
package ims.orariaperti.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.*;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Value("${frontend.url}")
private String frontendUrl;

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// Serve static resources from the react-app directory
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/react-app/");
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins(frontendUrl, "http://localhost:8080")
.allowedMethods("*")
.allowedHeaders("*");
}

@Override
public void addViewControllers(ViewControllerRegistry registry) {
// Forward requests to the index.html for client-side routing
registry.addViewController("/").setViewName("forward:/index.html");
registry.addViewController("/{x:[\\w\\-]+}").setViewName("forward:/index.html");
registry.addViewController("/{x:^(?!api$).*$}/**").setViewName("forward:/index.html");
registry.addViewController("/").setViewName("redirect:" + frontendUrl);
registry.addViewController("/{x:[\\w\\-]+}").setViewName("redirect:" + frontendUrl);
registry.addViewController("/{x:^(?!api$).*$}/**").setViewName("redirect:" + frontendUrl);
}
}
}
Loading