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
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
35 changes: 35 additions & 0 deletions .github/workflows/build-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Backend

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Set up Maven
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: mvn spring-boot:run
working-directory: ./OrariAperti/backend
50 changes: 16 additions & 34 deletions OrariAperti/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ OrariAperti is a room reservation system built with Spring Boot and React.

## Project Structure

- `src/main/java` - Java backend code
- `src/main/resources` - Backend resources
- `frontend` - React frontend code
- `./src/main/java` - Java backend code

## Prerequisites

- Java 21
- Maven
- Node.js and npm (optional, as they will be installed by Maven)

## Development

Expand All @@ -24,56 +21,41 @@ To run the backend only:
mvn spring-boot:run
```

### Frontend Development

To run the frontend in development mode:

```bash
cd frontend
npm install
npm run dev
```

This will start the Vite development server with hot reloading.

## Building and Running the Application

To build the entire application (both backend and frontend):

```bash
mvn clean install
```

This will:
1. Install Node.js and npm (if not already installed)
2. Install frontend dependencies
3. Build the React frontend
4. Package everything into a Spring Boot JAR

To run the built application:
and then:

```bash
java -jar target/OrariAperti-0.0.1-SNAPSHOT.jar
```

## Accessing the Application

Once running, the application can be accessed at:
Once running, the backend application can be accessed at:

- http://localhost:8080/

- http://localhost:8080
> [!NOTE]
> If you are visiting an invalid URL, the backend will redirect you to the frontend application.

## API Endpoints

Please check out the [OpenAPI documentation](./backend-openapi.yaml) for a more detailed view of the API.

## In short

The backend provides the following REST API endpoints:

- `GET /api/reservation` - Get a reservation using a private or public key
- `POST /api/reservation` - Create a new reservation
- `PUT /api/reservation/{id}` - Update an existing reservation
- `DELETE /api/reservation/{id}` - Delete a reservation
- `GET /api/room` - Get all rooms

## Features

- Create, view, update, and delete room reservations
- Private and public keys for accessing reservations
- Validation for overlapping reservations
- Responsive UI

## License

This project is licensed under the [GNU General Public License v3.0](../../LICENSE). Refer to the LICENSE file for more details.
39 changes: 0 additions & 39 deletions OrariAperti/backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,45 +72,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<workingDirectory>frontend</workingDirectory>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v18.16.0</nodeVersion>
<npmVersion>9.5.1</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
102 changes: 51 additions & 51 deletions OrariAperti/frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
# OrariAperti Frontend

This is the frontend for OrariAperti, built with React, TypeScript, and Vite.

## Getting Started

### Prerequisites

- Node.js
- npm

### Development

To start the frontend in development mode:

```bash
cd OrariAperti/frontend
mv .env.example .env
# Modify .env as needed. Check out the .env.example file for available options.
npm install
npm run dev
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
})
This will start the Vite development server at [http://localhost:3000](http://localhost:3000) (default).

### Building for Production

```bash
npm run build
```

The production build will be output to the `dist` directory.

## Features

- Modern React + TypeScript codebase
- Tailwind CSS for styling
- UI components by ui/Shadcn
- Responsive design
- Connects to the OrariAperti backend REST API

## Project Structure

- `src/` — React components and app code
- `index.html` — Main HTML entry point
- `index.css` — Global styles

## Linting & Formatting

- ESLint for code quality

## License

This project is licensed under the [GNU General Public License v3.0](../../LICENSE). Refer to the LICENSE file for more details.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# M223
Source Code Repository of M223
# OrariAperti

OrariAperti is a multi-user room reservation system built with Spring Boot (Java) for the backend and React (TypeScript, Vite) for the frontend.

## Project Structure

- [`backend`](./OrariAperti/backend): Spring Boot backend REST API and static resources
- [`frontend`](./OrariAperti/frontend): React + TypeScript + Vite + Tailwind + Shadcn/ui frontend app

## Getting Started

See the [backend README](./OrariAperti/backend/README.md) and [frontend README](./OrariAperti/frontend/README.md) for setup and usage instructions.

## Features

- Create, view, update, and delete room reservations
- Private and public keys for secure reservation access
- Responsive UI
- Validation for overlapping reservations
- and many more

## License

This project is licensed under the [GNU General Public License v3.0](./LICENSE). Refer to the license file for more details.