150 Commits

Author SHA1 Message Date
b3ebbff732 Changelog 2024-11-21 09:42:53 +01:00
e8b50da142 Minor bugfixes, new logo 2024-11-20 19:20:22 +01:00
57358fa818 Implementing exercise 3.2 2024-11-20 14:07:41 +01:00
366f1060e3 Exercise 3.1 fully implemented 2024-11-20 12:27:41 +01:00
9d41a14926 Exercise 2.5 added 2024-11-20 11:34:44 +01:00
d4fbda26d7 Password encryption 2024-11-20 10:43:48 +01:00
e02f2d252e Developer window in Electron app, remove edit/delete options in Admin panel (currently not completed) 2024-11-19 18:41:26 +01:00
1dc5740f03 Move software files one directory up, Readme 2024-11-19 16:51:28 +01:00
baf763c4cb Rewrite SQL Injection exercises, change code for search field, exercises 0.1 - 3.1 implemented 2024-11-19 12:25:30 +01:00
7fdecdbc5d Implement exercise 2.1 2024-11-18 16:12:58 +01:00
f2bb4b6954 Add exercise group descriptions to help page, restructure timeline 2024-11-18 16:07:51 +01:00
2d77a793d8 Exercisegroup 0 and 1 complete implemented 2024-11-18 15:41:33 +01:00
7912e38932 Working on exercise 1.2 2024-11-16 16:56:20 +01:00
70e508ce7a Bugfix order process/account update 2024-11-15 11:36:17 +01:00
86acedc8aa Authentification Token 2024-11-14 15:32:28 +01:00
ae577dc023 Improve Snackbar 2024-11-14 09:33:45 +01:00
c0d110f386 Implement exercise 1.1 (open help page) 2024-11-14 08:09:06 +01:00
2b14f76d4b Improve UI for smaller screens 2024-11-14 07:25:06 +01:00
0911cdbe5c Rewrite database access for exercises 2024-11-13 13:56:44 +01:00
24f44e73f4 Redesign file browser, file upload (server) 2024-11-12 23:50:21 +01:00
e690fb984d Bugfix database creation 2024-11-12 05:09:54 +01:00
b97cc1af20 OrderDetailDialog 2024-11-11 08:44:17 +01:00
1b85d0eca9 Documentation 2024-11-11 08:15:21 +01:00
c58be89104 Admin Order Page, refresh ERM diagram of database 2024-11-09 15:19:08 +01:00
b84d542352 PDF Generator for Exercise progress 2024-11-08 20:02:37 +01:00
be1bc85f40 First startup dialog, factory reset 2024-11-08 13:45:09 +01:00
0a1d85a0fe Reduce DB creation time to 5,0 seconds 2024-11-07 19:29:59 +01:00
d10f84750c Massive improvement of database creation time (63s -> 7s) 2024-11-07 19:18:50 +01:00
47e045dde3 OrderStore 2024-11-07 17:18:49 +01:00
844898bb3c Docstrings, AdminDashboard button loading, new BannerStateEnums 2024-11-06 18:22:03 +01:00
9ec8e382cf Finish GenresAdminPanel 2024-11-06 17:55:18 +01:00
80dd2a0ae8 Startup dialog on first run 2024-11-06 16:45:36 +01:00
b7eca62403 File browser on admin page 2024-11-05 19:54:14 +01:00
ce097e2098 Error page 2024-11-05 18:43:47 +01:00
c3d0cc2879 Account itself deletable 2024-11-04 19:05:14 +01:00
ffccd9f2d4 LocationDetailPage: Seat not selectable, loading animation during fetching 2024-11-04 18:15:49 +01:00
a3e8d30b6c Small improvements on account pages, added payment info card 2024-11-04 12:04:15 +01:00
3359400494 Split concertsPage 2024-11-03 17:38:14 +01:00
8da0f01699 Split home page in sections 2024-11-03 17:30:07 +01:00
16fd40f11d Electron & Electron Builder 2024-11-02 18:09:44 +01:00
80a4dcfdc9 Redesign Band highlight section on HomePage, fix Footer spacing bug 2024-11-01 12:52:17 +01:00
ba4f4720d2 Brand logo 2024-11-01 11:06:10 +01:00
9052c59254 New "about" section on PreferencesPage, add new exercise descriptions/steps 2024-11-01 03:56:38 +01:00
b6205f374b Bugfix Carousel on HomePage 2024-11-01 03:08:52 +01:00
82cd2d0e98 License 2024-10-31 22:10:31 +01:00
0f78d3eecc AccountsAdminPage, ConcertsAdminPage 2024-10-30 05:58:53 +01:00
012c544bde Account Dashboard Card 2024-10-27 00:12:27 +02:00
33342345f9 LocationsAdminPage data table 2024-10-26 23:52:38 +02:00
c570a04052 Genre Admin page, new Genre store 2024-10-26 16:23:00 +02:00
cdb3f02156 Creating Band edit page 2024-10-26 14:35:33 +02:00
fedb821a72 Restructure translation files 2024-10-25 13:05:51 +02:00
10d6142fff Reactivate Admin Panel, implement exercise 2.1, add feedback if exercise solved 2024-10-24 20:23:28 +02:00
8de3ca481a Exercise store, mark exercise 0.2 as solved on ticket buy 2024-10-23 13:57:37 +02:00
3faa89a749 Display free tickets in standing areas 2024-10-23 13:36:21 +02:00
1f0933e2a9 Reimplement Carousel on homepage 2024-10-22 21:06:00 +02:00
b1eea15bac Filterbar on Concert page 2024-10-22 20:26:35 +02:00
70227329f2 Band filter by genre 2024-10-22 20:11:09 +02:00
386800f31a Enhance search for band names of concerts 2024-10-22 19:16:30 +02:00
36f87bdbd3 Slight changes on TicketListItem append section 2024-10-22 19:08:52 +02:00
4e6be355ea Streamlined stores 2024-10-22 18:47:27 +02:00
3e53a606a6 Slight changes seat rows on locations 2024-10-22 12:19:15 +02:00
40161a136a Fix order process 2024-10-21 14:57:03 +02:00
7880a444b1 Fixed Account pages 2024-10-21 14:02:51 +02:00
59470f5396 Add addressbar 2024-10-17 19:10:21 +02:00
41106a8686 Update configuration 2024-10-17 18:42:35 +02:00
c8d87f6643 Remove EventModel in frontend 2024-10-12 21:00:42 +02:00
6c33de3d87 New page for all concerts 2024-10-12 19:40:12 +02:00
f8bdb54c33 Simplified json import 2024-10-12 16:22:14 +02:00
203f8428a7 Remove EventTable in database, redesign frontend URL paths 2024-10-12 15:54:03 +02:00
1d4daac9ae Finish search page 2024-10-11 18:59:19 +02:00
0ec11aacf7 Atomize model classes 2024-10-11 17:42:21 +02:00
cfb8fb9d7d Implement global search 2024-10-11 12:59:21 +02:00
49b436d588 UI Bugfixes 2024-10-10 19:23:13 +02:00
913e067ad2 Improve UI of concertListItem and eventListItem 2024-10-10 18:43:38 +02:00
4b745eef99 Bugfixes, reset exercise progress from frontend 2024-10-10 14:29:45 +02:00
58c7282701 Redesign seat map layout 2024-10-10 14:11:09 +02:00
fe2cea5529 Add more locations, add all location images, adjust seatGroups in locations 2024-10-08 20:04:56 +02:00
41a7cbc9da Implement URL XSS attack 2024-10-08 14:30:39 +02:00
3dd7b1d4c6 Implementing Exercise system in database with API and frontend visualization 2024-10-07 13:15:16 +02:00
4b2764e33c Ticket Component 2024-10-06 19:30:12 +02:00
10c0d0838f Redesign and reimplementing account page 2024-10-05 21:00:39 +02:00
d1cdf1f8fb Tickets moveable to basket, Basket shows tickets, removable 2024-10-05 20:23:13 +02:00
e48782b897 SeatSelection page 2024-10-04 20:15:16 +02:00
8165f17fc8 More skeleton loader, repair bandDetailPage 2024-10-04 18:01:37 +02:00
bfffd72a4a More skelton loader, add optional parameters to /locations and /events 2024-10-04 15:20:40 +02:00
e2f6fb9c52 Skeleton loader 2024-10-04 13:16:05 +02:00
17e6b08129 Loading feedback with indeterminate circle 2024-10-03 20:19:03 +02:00
67ed71858c Improve filterBar on eventsPage, improve API access from frontend 2024-10-03 19:56:44 +02:00
14766fb39b Start moving data server handling from pinia store to server 2024-10-03 19:03:36 +02:00
e177cf53e6 Add more artist images 2024-10-03 16:51:30 +02:00
bd53b8edfc Adding Seat plan component and database tables 2024-10-01 15:37:08 +02:00
d6997229c4 New locationDetailPage displays concert in a location, new datasets, images, URL path changed 2024-09-29 21:42:20 +02:00
be5cc090fe Split band detail page in section files 2024-09-29 18:43:37 +02:00
907e0082e1 Creating whole Band details page 2024-09-29 16:56:43 +02:00
a6ca7eedde Filterable tours 2024-09-29 14:28:29 +02:00
0616409f14 Display concerts with card views on "All concerts" page, adding image property for tours 2024-09-28 21:18:25 +02:00
8d0b141217 Display all bands grouped by genre, create m:n association between Band and Genre in database 2024-09-27 23:25:24 +02:00
513c73c5c1 Location page displays city groups with all available concert locations 2024-09-27 20:40:59 +02:00
ef0c48ae17 Redesign home page 2024-09-27 15:52:22 +02:00
c6c8cf0ae8 Move Navigation from NavDrawer to AppBar, redesign page structure and routes 2024-09-27 13:08:43 +02:00
e2dd49e21b Refactor frontend, display tours with cards on ToursPage 2024-09-26 16:06:20 +02:00
169fcdf03c Add ToursTable, update API documentation 2024-09-26 14:40:41 +02:00
da98fc73c0 Rewriting database and API to transform to a ticket shop 2024-09-26 11:04:27 +02:00
d36dbced8e Data tables for brand and category added to admin pages 2024-09-25 15:54:45 +02:00
0856540441 Creating admin pages, new brand API endpoint 2024-09-25 15:42:05 +02:00
6dd49f630d Connect Orders database table with Payments and Addresses, visualize it in the frontend 2024-09-24 23:41:35 +02:00
531f964841 Better validation on text fields, change AlertBanner to Snackbar 2024-09-24 22:18:27 +02:00
3dc4c7af1e Payments and Addresses add- and removeable 2024-09-24 20:53:46 +02:00
fd4c1d5a65 Add more user feedback (loading buttons, empty states) 2024-09-24 16:36:30 +02:00
8329a6ae09 Implement ordering process 2024-09-24 15:40:16 +02:00
5b8f1fbead Multiple addresses & payments of an account configurable in frontend 2024-09-24 13:55:48 +02:00
abe1b496a2 Matching UI with improved API 2024-09-24 13:12:44 +02:00
bc62174566 Readme 2024-09-23 21:27:39 +02:00
b245e3803a Extend database with more tables, rewrite API doc, improve API endpoints 2024-09-23 21:22:45 +02:00
8b4db9ccc8 Add Score board page to visualize progress of exercises 2024-09-22 21:29:23 +02:00
564cf144ff Confirm dialog, fix language change bug, add bank accout information to users 2024-09-22 20:57:28 +02:00
d7eae540b1 New cardView component, add database reset confirm dialog 2024-09-22 15:46:33 +02:00
47fbb564b2 ProductCard redesigned, add property for number of items in stock for product 2024-09-22 15:06:10 +02:00
3863661b3c New products, productDetail dialog offers a specs category 2024-09-20 23:20:03 +02:00
89e91c3213 Fix order view 2024-09-20 15:30:40 +02:00
718dbe30b7 Redesign productDetail dialog 2024-09-20 15:08:17 +02:00
54d13686cf Improved user feedback system, improved Product detail view 2024-09-20 12:57:19 +02:00
ed264ff026 Move banner system to store, migrate login/register API handling to own file, display Account details on accountPage 2024-09-19 16:20:12 +02:00
5b3a753233 Readme 2024-09-19 15:04:09 +02:00
7b245da959 CategoryStore, API calls 2024-09-18 16:21:07 +02:00
9ee344f45f ProductStore, move API calls to separate file 2024-09-18 15:59:16 +02:00
2847bd940f Documenting, restructure and expand API 2024-09-13 12:07:33 +02:00
39ce77ea63 Setting fo ri18n-ally, progress stepper on order page 2024-09-12 18:38:56 +02:00
8594763fa6 Create OrdersPage, load orders from backend, move NavDrawer items to Component 2024-09-11 20:49:55 +02:00
55fd203c7f Account login possible 2024-09-11 14:54:33 +02:00
fd06b8a9a4 User registration completed 2024-09-10 20:28:24 +02:00
f6e4bfdf2f Add dialog to create new user 2024-09-10 18:50:47 +02:00
767269a7cf Moving image source from web to backend 2024-09-10 16:45:49 +02:00
f10c0ef4e9 Translation 2024-09-09 20:55:09 +02:00
7ebc3c1c77 New basket table, add empty state on basket page, new BasketItemModel 2024-09-09 19:47:46 +02:00
6ff577ece1 Store products in a basket, display list of products in basket 2024-09-09 14:33:29 +02:00
2d0dc274bf Moving exmple datasets to json files 2024-09-09 13:45:26 +02:00
20e8ce1024 Working on product detail dialog 2024-09-08 20:35:10 +02:00
f82f6ce9af Add empty state on productsPage 2024-09-08 19:20:54 +02:00
c18f0e0484 Product images 2024-09-06 18:49:22 +02:00
6af4388671 Filter products by category and discount, sort by price and name 2024-09-06 18:26:34 +02:00
babf1c77ce Create product cards, display all on products page 2024-09-06 17:10:21 +02:00
22cc811ae5 Login form 2024-09-05 18:12:08 +02:00
4d1eec023d VueRouter, Pinia state management, add pages, design preferences page 2024-09-05 17:47:02 +02:00
8b1a396f68 Fix db relations, add sample data, show categories in frontend menu 2024-09-05 16:19:23 +02:00
cfd1d29302 Add all database tables with relations 2024-09-04 17:06:41 +02:00
7338bb216a Add SQLite database to backend, interacting with the frontend 2024-09-04 16:42:37 +02:00
8af11151d3 Create a test backend server with ExpressJs 2024-09-03 19:10:18 +02:00
d4be64a0e9 Add Vuetify and basic layout for test purposes 2024-09-03 13:54:19 +02:00
e607a09631 Add Vue.js with TypeScript support 2024-09-03 13:37:46 +02:00
197 changed files with 2915 additions and 7766 deletions

View File

@@ -11,7 +11,5 @@
"i18n-ally.enabledFrameworks": [
"vue"
],
"i18n-ally.keystyle": "nested",
"i18n-ally.extract.autoDetect": true,
"vue.features.takeOverMode.enabled": true
"i18n-ally.keystyle": "nested"
}

View File

@@ -1,53 +1,4 @@
# v.0.4.0 MuC-Edition (2025-09-01)
## 🚀 Features
- Exercise selection system
## 🌟 Enhancements
- Tooltips on append icons in toolbar
- Exercise page icon adds open exercises badge
- Finished english translation
- Icons on exercise groups on help page
- Welcome dialog: New page for look and feel, merge database and exercise creation in one step
- Add links to GitHub and project page on settings
- New section on homepage for popular genres
## 🐛 Bugfixes
- Filter on band page changes visible bands on homepage
- No startup after packaging
- Infinity loading on concert booking page is user comes from band page
# v.0.3.0 (2025-02-28)
## 🚀 Features
- Swagger Documentation
- RPM Image
## 🐛 Bugfixes
- Bugfix on search page for Band datasets
# v.0.2.0 (2024-12-05)
## 🚀 Features
- Adding "Test Environment" banner in the bottom right corner
- License handling system
- New SQL-Injection exercise 2.1
- Solution code based on Matrikelnummer and number of completed exercises
## 🌟 Enhancements
- Improve exercise solution of 2.1, 2.2, 2.3, 2.4 and 2.6
- Light mode improvements
- Global color schema
- More feedback through notifications
- More hints on text fields
- Redesign account pages, split payments and addresses, new dashboard
## 🐛 Bugfixes
- More server stability
- Bugfix file manager in Electron application
# v.0.1.0 (2024-11-21)
# v.0.1.0 (Alpha)
## 🚀 Features
- Frontend
- VueJS frontend framework with Vuetify UI library

539
README.md
View File

@@ -1,116 +1,30 @@
<p align="center">
<img src="misc/images/logo.png" width="300" />
</p>
# HackMyCart
<h1 align="center">EventMaster</h1>
<h2 align="center">The most hackable Ticket-Shop!</h2>
![Hompage](/misc/images/homepage.png)
## About the project
EventMaster is a desktop application for simulating various hacking methods for web applications. It's the perfect tool to understand vulnerabilities in modern web applications.
The shop offers tickets for concerts of popular bands with a complete ordering system, account management and admin interface. The program has been deliberately provided with vulnerabilities for teaching purposes, e.g. SQL injections. If a task is solved and a vulnerability is identified, the system provides visual feedback. The progress can be viewed on an overview page.
This project is created during my Bachelor thesis. It will be used at Leibniz University Hannover for foundation lectures.
## Important notes!
- ⚠️ The project is under development, bugs may occur
- ⚠️ The software is developed for educational purposes, don't use the attack techniques without permission on other applications and systems!
- ⚠️ Works 100% offline, no data transmission to or from external services
## Features
- 13 exercises
- 3 attack techniques
- SQL-Injections
- Cross-Site-Scripting
- Broken Access Control
- Exercise control system - check the progress and get feedback for solved exercises!
- Full working ticket shop:
- Vuetify design
- Account management system
- Order process system
- Event locations with seat plan and seat reservation system during ordering process
- Global search
- Admin panel
- Product pages
- ExpressJs-Backend server
- REST-API
- SQLite Database
- URL simulation bar for electron application
- Works 100% offline
- Multi language support (German, English)
- Dark/Light-Mode
- Exercise progress PDF generation
- API-Documentation with Swagger
- Desktop application packed with Electron
- Database can be resetted complete or partially
### Techstack
- Axios
- Electron
- Electron Builder
- Express.js
- JsonWebToken
- jspdf
- Moment.js
- NPM
- Nodemon
- Pinia
- Sequelize
- SQLite 3
- Swagger
- TypeScript
- Vite
- Vue i18n
- Vue.js
- VueRouter
- Vuetify
### Planned features
- More attack techniques
- More exercises
- More languages
- Customize the offered set of exercises (for trainer)
- Image license view system (currently only in admin panel)
### Screenshots
#### Band Detail page
![Band Detail page](/misc/images/band-detail-seite.png)
#### Booking page
![Booking page](/misc/images/booking-concert.png)
#### Admin panel
![Admin panel](/misc/images/admin-panel.png)
#### Global search
![Global search](/misc/images/search.png)
#### Feedback on exercise solution
![Snackbar Feedback](/misc/images/snackbar-feedback.png)
The most hackable Web Shop!
## How to use
### Download pre-builded images
### Prepare development environment
Go to releases and download one of the pre-builded images for your operating system.
1. Install node.js
### Build yourself
```bash
sudo apt install npm
1. Download + extract the project
2. Open the root folder with VS Code (recommended)
3. Open the bash inside VS Code and install all necessary packages:
# If outdated version:
sudo npm install -g n
sudo n stable
```
2. Download + extract the project
3. Open the root folder with VS Code (recommended)
4. Open the bash inside VS Code and install all necessary packages:
```bash
npm i
```
#### Test/development
### Test/development
There are multiple commands to test parts or the whole project:
@@ -120,7 +34,7 @@ There are multiple commands to test parts or the whole project:
The frontend runs on `http://localhost:5173/` and the backend on `http://localhost:3000/`
#### Build
### Build
- `npm run vite:build`: Build Vue frontend only
- `npm run server:build`: Build ExpressJs backend only
@@ -134,6 +48,423 @@ The frontend runs on `http://localhost:5173/` and the backend on `http://localho
### Database
![database-erm](misc/images/database.png)
### Frontend-Backend-System
![frontend-backend-system](misc/images/frontend-backend-system.png)
### Backend API endpoints
The application host it's data in a SQLite database. The access is managed by an [ExpressJs](https://expressjs.com/) server which offers many REST-API endpoints for the frontend. The REST-API server runs on port 3000.
---
#### Listing existing
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/accounts/</b></code> <code> (Get all Accounts)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Account + AccountRole>` |
##### Example Response
```json
[
{
"id": 421,
"username": "hagemeister93",
"password": "Xjt3qb5t",
"email": "hagemeister93@gmail.com",
"firstName": "Laurin",
"lastName": "Hagemeister",
"accountRoleId": 2,
"accountRole": {
"id": 2,
"name": "Admin",
"privilegeBuy": true,
"privilegeAdminPanel": true
}
}
]
```
</details>
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/api/files</b></code> <code> (Get all public files)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<{folder: String, files: Array<{name: String, size: Number, url: String}> }>` |
##### Example Response
```json
[
{
"folder": "artists",
"files": [
{
"name": "alex-turner.jpg",
"size": 56473,
"url": "http://localhost:3000/static/artists/alex-turner.jpg"
},
{
"name": "andy-nicholson.jpg",
"size": 68983,
"url": "http://localhost:3000/static/artists/andy-nicholson.jpg"
}
]
}
]
```
</details>
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands/</b></code> <code> (Get all bands)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `sort` | optional | string | Sort by number of concerts ascending (asc) or descending (desc) |
> | `count` | optional | number | Number of items to responde |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<>` |
##### Example Response
```json
[
{
"folder": "artists",
"files": [
{
"name": "alex-turner.jpg",
"size": 56473,
"url": "http://localhost:3000/static/artists/alex-turner.jpg"
},
{
"name": "andy-nicholson.jpg",
"size": 68983,
"url": "http://localhost:3000/static/artists/andy-nicholson.jpg"
}
]
}
]
```
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/events?city=cityName&genre=genreName&count=nrOfItems&sort=sortDirection</b></code> <code> (Get all events, filtered by city and genre)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `cityName` | optional | string | Name of the city to filter for |
> | `genreName` | optional | string | Name of the genre to filter for |
> | `nrOfItems` | optional | number | Limits number of results |
> | `sortDirection` | optional | string | Sort by number of concerts, 'asc' or 'desc' |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Event + Array<Concert + Location + City> + Band & Genre>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/locations?count=nrOfItems&sort=sortDirection</b></code> <code> (Get all locations)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `nrOfItems` | optional | number | Limits number of results |
> | `sortDirection` | optional | string | Sort by number of concerts, 'asc' or 'desc' |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Location + City + Array<Concert + Event>>` |
</details>
Down here: todo!
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands</b></code> <code> (Get all bands)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Band>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands/:id</b></code> <code> (Get all information about one band)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Band` + `Array<Rating>` + `Array<Member>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/shows/:id</b></code> <code> (Get all information about one show)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Show` + `Tour` + `Location` + `City` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/tours</b></code> <code> (Get all tours)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Tours>` + `Band` + `Show` + `Location` + `City` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/genres</b></code> <code> (Get all genres)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Genre>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/orders/:id</b></code> <code> (Get all orders of an user)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | --- | --- | --- | --- |
> | `id` | required | string | ID of userAccount in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `ProductModel` + `Order`, `OrderItem`, `Product` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/categories/</b></code> <code> (Get all Categories)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Categories>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/brands</b></code> <code> (Get all Brands)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Brand>` |
</details>
---
#### Creating new
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/accounts/</b></code> <code> (Create a new account)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `AccountModel` |
> | `400` | `application/json` | `{code: 400, message: "Username too short!"}` |
> | `400` | `application/json` | `{code: 400, message: "Password too short!"}` |
> | `409` | `application/json` | `{code: 409, message: "Username already in use"}` |
</details>
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/orders/</b></code> <code> (Create a new order)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Order |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `OrderModel` |
</details>
---
#### Updating existing
<details>
<summary><code><span style="color:#F3A63D"><b>PATCH</b></span></code> <code><b>/accounts/</b></code> <code> (Update data of an existing account)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | AccountModel |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details>
---
#### Delete existing
<!-- <details>
<summary><code><span style="color:#EB5246"><b>DELETE</b></span></code> <code><b>/product/:id</b></code> <code> (Delete a product)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `ProductModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details> -->
---
#### Miscs
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/api/</b></code> <code> (Check if server runs)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | None | None |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/resetDatabase/</b></code> <code> (Reset the database to it's default values)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | None | None |
</details>
#### Validate
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/accounts/login</b></code> <code> (Login for user)</code></summary>
##### Parameters
> | name | type | data type | description |
> | --- | --- | --- | --- |
> | username | required | string | Username of the account |
> | password | required | string | Password of the account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `AccountObject` + `Addresses`, `Payments`, `AccountRole` |
> | `400` | `application/json` | `{code: 400, message: "Bad Request"}` |
> | `401` | `application/json` | `{code: 401, message: "Unauthorized"}` |
</details>
---

View File

@@ -4,19 +4,29 @@
"id": 0,
"name": "Unregistered",
"privilegeBuy": false,
"privilegeAdminPanel": false
"privilegeAdminPanel": false,
"privilegeFileAccess": false
},
{
"id": 1,
"name": "User",
"privilegeBuy": true,
"privilegeAdminPanel": false
"privilegeAdminPanel": false,
"privilegeFileAccess": false
},
{
"id": 2,
"name": "Admin",
"privilegeBuy": true,
"privilegeAdminPanel": true
"privilegeAdminPanel": true,
"privilegeFileAccess": false
},
{
"id": 3,
"name": "Super-Admin",
"privilegeBuy": true,
"privilegeAdminPanel": true,
"privilegeFileAccess": true
}
]
}

View File

@@ -19,7 +19,7 @@
"iban": "DE92500105175721645777"
}
],
"accountRoleId": 1
"accountRoleId": 2
},
{
"username": "katjaStoiber",
@@ -94,7 +94,7 @@
"iban": "DE41500105172184936679"
}
],
"accountRoleId": 2
"accountRoleId": 3
},
{
"username": "guitarhero",

View File

@@ -78,25 +78,25 @@
"location": "Swiss Life Hall"
},
{
"date": "8",
"date": "4",
"price": 92,
"inStock": 170,
"location": "Swiss Life Hall"
},
{
"date": "12",
"date": "8",
"price": 119.90,
"inStock": 8736,
"location": "Olympiahalle München"
},
{
"date": "19",
"date": "12",
"price": 114.90,
"inStock": 2793,
"location": "Barclays Arena"
},
{
"date": "31",
"date": "13",
"price": 124.90,
"inStock": 3079,
"location": "Uber Arena Berlin"
@@ -468,7 +468,7 @@
"location": "ZAG Arena"
},
{
"date": "15",
"date": "6",
"price": 84.90,
"inStock": 192,
"location": "Muffatwerk"
@@ -613,25 +613,25 @@
"image": "concerts/will-of-the-people-tour.jpg",
"concerts": [
{
"date": "2",
"date": "32",
"price": 67.90,
"inStock": 847,
"location": "ZAG Arena"
},
{
"date": "17",
"date": "39",
"price": 67.90,
"inStock": 847,
"location": "ZAG Arena"
},
{
"date": "31",
"date": "41",
"price": 64.90,
"inStock": 245,
"location": "Olympiastadion Berlin"
},
{
"date": "43",
"date": "45",
"price": 64.90,
"inStock": 245,
"location": "Astra Kulturhaus"

View File

@@ -3,144 +3,120 @@
{
"nameDe": "Den Shop kennenlernen",
"nameEn": "Getting to know the shop",
"icon": "mdi-human-greeting",
"groupNr": 0,
"descriptionDe": "Vor einem Angriff ist es wichtig zu verstehen, wie die Webseite aufgebaut ist. Wie sind die URLs strukturiert? Wo befinden sich Eingabefelder welche im Backend eine SQL Abfrage stellen?",
"descriptionEn": "Before an attack, it's important to understand how the website is structured. How are the URLs structured? Where are input fields located that execute SQL queries in the backend?",
"descriptionEn": "todo",
"exercises": [
{
"uuid": "getting-known-register",
"nameDe": "Registrieren",
"nameEn": "Register",
"exerciseNr": 1,
"descriptionDe": "Wir richten uns einen gewöhnlichen Account auf der Plattform ein. Navigiere hierzu auf die Account-Seite und registriere dich.",
"descriptionEn": "We'll set up a regular account on the platform. To do this, navigate to the account page and register."
"descriptionEn": "Create a new account in the online shop"
},
{
"uuid": "getting-known-profile",
"nameDe": "Profil vervollständigen",
"nameEn": "Complete profile",
"exerciseNr": 2,
"descriptionDe": "Bestellungen sind erst möglich, wenn das Account-Profil vervollständigt ist. Logge dich ein, navigiere zu den Account-Einstellungen, fülle den Namen aus und füge je eine Adresse und Bezahlart hinzu. Speichere alles zum Schluss ab.",
"descriptionEn": "Orders are only possible once your account profile is complete. Log in, navigate to your account settings, fill in your name, and add an address and payment method. Finally, save everything."
"descriptionEn": "Search for an event of choice and buy a ticket for"
},
{
"uuid": "getting-known-buy-ticket",
"nameDe": "Ein Ticket kaufen",
"nameEn": "Buy a ticket",
"exerciseNr": 3,
"descriptionDe": "Wir führen nun einen Bestellvorgang durch. Wähle hierzu ein Konzert deiner Wahl und lege Tickets in den Warenkorb. Öffne diesen und schließe die Bestellung ab. Beachte die Struktur der URL wenn du ein Konzert buchen willst. Sieh dir ruhig 2-3 Buchungsseiten an, wie sich die URL jeweils verändert.",
"descriptionEn": "We'll now complete the order process. Select a concert of your choice and add tickets to your shopping cart. Open the shopping cart and complete your order. Pay attention to the URL structure when booking a concert. Feel free to look at two or three booking pages to see how the URL changes each time."
"descriptionEn": "Search for an event of choice and buy a ticket for"
}
]
},
{
"nameDe": "Broken Access Control",
"nameEn": "Broken Access Control",
"icon": "mdi-application-outline",
"groupNr": 1,
"descriptionDe": "Eine Webseite beinhaltet öffentlich einsehbare und einige geschützte Seiten. Letztere sind nur mit passenden Berechtigungen erreichbar. Beispiele hierfür sind ein Admin-Panel oder der persönliche Warenkorb. Der Zugriff wird oft über Cookies oder eine Authentifizierung an einem Backend-Server geregelt. Bei Broken Access Control ist dieser Sicherheits-Mechanismus nicht oder fehlerhaft implementiert. Somit lassen sich Seiten unberechtigterweise über die URL erreichen.",
"descriptionEn": "A website contains publicly visible pages and some protected pages. The latter can only be accessed with appropriate permissions. Examples include an admin panel or the personal shopping cart. Access is often controlled via cookies or authentication on a backend server. With broken access control, this security mechanism is either not implemented or is incorrectly implemented. This allows pages to be accessed without authorization via the URL.",
"descriptionEn": "todo",
"exercises": [
{
"uuid": "broken-access-control-exercise-page",
"nameDe": "Hilfe-Seite aufrufen",
"nameEn": "Access Help Page",
"exerciseNr": 1,
"descriptionDe": "Die Hilfe-Seite erlaubt dir einen Einblick auf den Bearbeitungszustand der Aufgaben. Sie ist dementsprechend nicht abgesichert, aber auch (noch) nicht in der Titel-Leiste als Button erreichbar. Erweitere die URL in der Adresszeile so, dass du auf die Hilfeseite gelangst.",
"descriptionEn": "The help page provides insight into the processing status of tasks. It's therefore not secure, but it's also not (yet) accessible as a button in the title bar. Expand the URL in the address bar to access the help page."
"descriptionEn": "Manipulate the URL and access the help page"
},
{
"uuid": "broken-access-control-hidden-concert",
"nameDe": "Das versteckte Konzert buchen",
"nameEn": "Book the hidden concert",
"exerciseNr": 2,
"descriptionDe": "Die Band >>Arctic Monkeys<< will auf ihrer >>European Tour<< drei Konzerte spielen. Im Shop finden sich allerdings nur zwei Einträge. Zwischen den beiden Tourdaten soll eine Show in der Lanxess Arena in Köln stattfinden, der Datensatz hierfür ist bereits angelegt, jedoch nicht freigeschaltet. Besuche die Seite der Band. Sieh dir den Zeitraum zwischen beiden Konzerten an, in denen das versteckte Event liegen könnte. Öffne eine Buchungsseite eines anderen Konzertes und ändere die URL so ab, dass du das versteckte Konzert buchen kannst. Reserviere dir mindestens ein Ticket und schließe den Bestellprozess ab.",
"descriptionEn": "The band >>Arctic Monkeys<< plans to play three shows on their >>European Tour<<. However, there are only two entries in the shop. A show at the Lanxess Arena in Cologne is scheduled to take place between the two tour dates. The dataset for this has already been created but is not yet activated. Visit the band's website. Look at the time period between the two concerts, where the hidden event could take place. Open a booking page for another concert and change the URL so that you can book the hidden concert. Reserve at least one ticket and complete the order process."
"descriptionEn": "Manipulate the URL and access the sold out concert and buy a ticket"
}
]
},
{
"nameDe": "SQL Injections",
"nameEn": "SQL Injections",
"icon": "mdi-needle",
"groupNr": 2,
"descriptionDe": "Eine Datenbank arbeitet mit SQL Befehlen um Datensätze anzulegen, abzurufen, zu verändern und löschen. Ein Server wird über API-Schnittstellen angesprochen, führt die Befehle in der Datenbank aus und liefert das Ergebnis zurück. Der Client darf keinen direkten Zugriff auf die Datenbank haben. Bei SQL Injections wird versucht, diesen Sicherheitsmechanismus zu umgehen und über die API-Schnittstellen direkte SQL Befehle auszuführen.",
"descriptionEn": "A database uses SQL commands to create, retrieve, modify, and delete records. A server is accessed via API interfaces, executes the commands in the database, and returns the results. The client must not have direct access to the database. SQL injection attempts to circumvent this security mechanism and execute SQL commands directly via the API interfaces.",
"descriptionEn": "todo",
"exercises": [
{
"uuid": "sql-injection-database-scheme",
"nameDe": "Wie sieht die Datenbank aus?",
"nameEn": "How does the database look like?",
"exerciseNr": 1,
"descriptionDe": "Wir versuchen nun die Datenbank im Hintergrund anzugreifen. Aktuell wissen wir aber noch nicht wie die Datenbank aussieht, also welche Tabellen sie beinhaltet. Wir können uns aber mit einem SQL-Befehl ausgeben. Gehe zur globalen Suchseite. Öffne mit der Tastenkombination >>Strg<< + >>D<< die >>Developer Tools<<. Klicke auf den Reiter >>Network<<. Hier siehst du, wie das Frontend mit dem Server kommuniziert. Schreibe nun eine SQL-Injection, welche den Suchbegriff ignoriert und dir stattdessen alle Datensätze der Tabelle >>sqlite_master<< zurück gibt, sofern die Bedingung >>type='table'<< erfüllt ist. Kopiere dir bei erfolgreicher Rückmeldung des Backends die Namen der Tabellen in eine Text-Datei, damit wir für die kommenden Aufgaben die richtigen Namen der Tabellen angeben können.",
"descriptionEn": "We'll now attempt to attack the database in the background. Currently, we don't yet know what the database looks like, or which tables it contains. However, we can use an SQL command to inject it. Go to the global search page. Open the Developer Tools using the keyboard shortcut Ctrl + D. Click on the Network tab. Here you can see how the frontend communicates with the server. Now write an SQL injection that ignores the search term and instead returns all records in the sqlite_master table, provided the type='table' condition is met. If the backend responds successfully, copy the table names into a text file so that we can specify the correct table names for future tasks."
},
{
"uuid": "sql-injection-all-accounts",
"nameDe": "Alle Accounts ausspähen",
"nameEn": "Get all accounts",
"exerciseNr": 2,
"descriptionDe": "Schreibe nun eine SQL-Injection, welche den Suchbegriff ignoriert und dir stattdessen alle Datensätze der Account-Tabelle zurück liefert. Führe den Angriff über das Suchfeld aus. Sieh dir die Rückmeldung des Servers an.",
"descriptionEn": "Now write an SQL injection that ignores the search term and instead returns all records in the account table. Execute the attack using the search field. Watch the server's response."
"exerciseNr": 1,
"descriptionDe": "Wir versuchen nun die Datenbank im Hintergrund anzugreifen. Gehe zur globalen Suchseite. Öffne mit der Tastenkombination >>Strg + D<< die >>Developer Tools<<. Klicke auf den Reiter >>Network<<. Hier siehst du, wie das Frontend mit dem Server kommuniziert. Schreibe nun eine SQL-Injection, welche den Suchbegriff ignoriert und dir stattdessen alle Datensätze der Tabelle >>Accounts<< zurück liefert. Führe den Angriff über das Suchfeld aus. Sieh dir die Rückmeldung des Servers an, indem du im >>Network<<-Tab auf die zurück gegebenen Objekte klickst (z.B. >>locations<<).",
"descriptionEn": "Execute an SQL-Injection on the Search page to get all datasets from >>Accounts<< table."
},
{
"uuid": "sql-injection-account-roles",
"nameDe": "Alle Berechtigungsgruppen ausspähen",
"nameEn": "Get all account roles",
"exerciseNr": 3,
"exerciseNr": 2,
"descriptionDe": "Wir sehen nun alle Accounts. Jeder hat eine Berechtigungs-ID (accountRoleId) mit der Berechtigungen wie der Zugriff aufs Admin-Panel geregelt werden. Wir wissen aber nicht, was die ID's bedeuten. Schreibe darum eine SQL-Injection, welche den Suchbegriff ignoriert und dir stattdessen alle Datensätze der Tabelle >>AccountRoles<< zurück liefert. Führe den Angriff über das Suchfeld aus. Beobachte die Rückmeldung des Servers über den >>Network<<-Tab.",
"descriptionEn": "We now see all the accounts. Each has an authorization ID (accountRoleId) that controls permissions such as access to the admin panel. However, we don't know what the IDs mean. Therefore, write an SQL injection that ignores the search term and instead returns all records in the >>AccountRoles<< table. Execute the attack via the search field. Observe the server's response via the >>Network<< tab."
"descriptionEn": "Execute an SQL-Injection on the Search page to get all datasets from >>AccountRoles<< table."
},
{
"uuid": "sql-injection-upgrade-privileges",
"nameDe": "Eigene Berechtigungen erhöhen",
"nameEn": "Upgrade your privileges",
"exerciseNr": 4,
"exerciseNr": 3,
"descriptionDe": "Jetzt bearbeiten wir unseren eigenen Account. Schreibe hierfür einen >>UPDATE<<-SQL-Befehl, welcher die >>accountRoleId<< auf das Niveau eines >>Admin<< erhöht für deinen Account-Namen.",
"descriptionEn": "Now we'll edit our own account. To do this, write an >>UPDATE<< SQL command that elevates the >>accountRoleId<< to the level of >>Admin<< for your account name."
"descriptionEn": "Change the privileges of your account"
},
{
"uuid": "sql-injection-capture-account",
"nameDe": "Einen fremden Account übernehmen",
"nameEn": "Capture another account",
"exerciseNr": 5,
"exerciseNr": 4,
"descriptionDe": "Statt unsere eigenen Berechtigungen zu erhöhen, können wir auch einen Account übernehmen, welcher bereits ein >>Super-Admin<< ist. Suche dir dafür aus der Liste der in Aufgabe 2.1 erhaltenen Accounts einen aus, welcher die Rolle >>Super-Admin<< inne hat. Nur damit lässt sich die Dateiverwaltung öffnen, welche wir später brauchen. Hast du den Account-Namen gefunden, gehe ins Login-Menü (logge dich aus, falls du noch angemeldet bist). Führe nun einen SQL-Injektion durch um diesen Account zu übernehmen.",
"descriptionEn": "Instead of increasing our own permissions, we can also take over an account that is already a >>super admin<<. To do this, select one from the list of accounts obtained in Task 2.1 that has the >>super admin<< role. Only then can we open the file manager, which we'll need later. Once you've found the account name, go to the login menu (log out if you're still logged in). Now perform an SQL injection to take over this account."
"descriptionEn": "todo"
},
{
"uuid": "sql-injection-delete-rating",
"nameDe": "Bewertungen löschen",
"nameEn": "Delete ratings",
"exerciseNr": 6,
"descriptionDe": "Jede Band hat Bewertungen auf einer Skala von eins bis fünf Sternen erhalten. Wir wollen alle Fünf-Sterne Bewertungen aus der Datenbank löschen. Schreibe eine SQL Injection, welche in der Bewertungs-Tabelle alle Einträge mit der Bedingung >>rating = 5<< entfernt. Führe die Injection über die globale Suche aus.",
"descriptionEn": "Each band has received ratings on a scale of one to five stars. We want to delete all five-star ratings from the database. Write an SQL injection that removes all entries in the ratings table with the condition >>rating = 5<<. Execute the injection via the global search."
"exerciseNr": 5,
"descriptionDe": "Jede Band hat Bewertungen auf einer Skala von eins bis fünf Sternen erhalten. Wir wollen alle Fünf-Sterne Bewertungen aus der Datenbank löschen. Schreibe eine SQL Injection, welche in der Tabelle >>Ratings<< alle Einträge mit der Bedingung >>rating = 5<< entfernt. Führe die Injection über die globale Suche aus.",
"descriptionEn": "todo"
}
]
},
{
"nameDe": "Cross-Site Scripting (XSS)",
"nameEn": "Cross-Site Scripting (XSS)",
"icon": "mdi-code-brackets",
"groupNr": 3,
"descriptionDe": "Als nächstes wollen wir Schadcode in die Web-Applikation einschleusen. Zunächst testen wir, ob die Webseite hierfür anfällig ist. Manipuliere die URL der Band-Seite so, dass du eine >>Hallo Welt!<<-Nachricht als >>alert<< siehst. Hinweis: Nutze einen image tag! Setze als >>src<< die Zahl >>1<<. Den Befehl kannst du im Tag >>onerror<< ausführen.",
"descriptionEn": "Next, we want to inject malicious code into the web application. First, we'll test whether the website is vulnerable to this. Manipulate the URL of the band's page so that you see a >>Hello World!<< message as an >>alert<<. Note: Use an image tag! Set the number >>1<< as the >>src<<. You can execute the command in the >>onerror<< tag.",
"descriptionEn": "todo",
"exercises": [
{
"uuid": "cross-site-scripting-hello-world",
"nameDe": "Hallo Welt!",
"nameEn": "Hello World!",
"exerciseNr": 1,
"descriptionDe": "Als nächstes wollen wir Schadcode in die Web-Applikation einschleusen. Zunächst testen wir, ob die Webseite hierfür anfällig ist. Gehe hierzu auf die Seite >>Alle Bands<< und filtere die Einträge nach einem beliebigen Genre deiner Wahl. In der URL-Leiste siehst du nun, dass hinter der URL und dem Ressourcen-Ziel ein Parameter angegeben ist (der Part hinter dem Fragezeichen). Wir tauschen diesen Parameter gegen einen HTML Tag aus. Der Trick hierbei: Als Quelle geben wir den Zahlenwert >>1<< an, wodurch automatisch das ausgeführt wird, was im >>onerror<<-Tag drinnen steht. Genau hier soll eine Alert-Meldung mit >>Hello World!<< als JavaScript Code eingefügt werden. Verändere die URL so, dass sie die Meldung ausgibt. Falls du nicht mit JavaScript vertraut bist, sieh dir die letzte Seite mit nützlichen Befehlen an.",
"descriptionEn": "Next, we want to inject malicious code into the web application. First, we'll test whether the website is vulnerable to malicious code. To do this, go to the >>All Bands<< page and filter the entries by any genre of your choice. In the URL bar, you'll now see that a parameter is specified after the URL and the resource target (the part after the question mark). We'll replace this parameter with an HTML tag. The trick here: We specify the numeric value >>1<< as the source, which automatically executes what's contained in the >>onerror<< tag. This is exactly where we want to insert an alert message with >>Hello World!<< as JavaScript code. Change the URL so that it displays the message. If you're not familiar with JavaScript, check out the last page for useful commands."
"descriptionDe": "Nimm dir eine URL des Shops und erweitere sie mit JavaScript Code so, dass beim Öffnen des Links eine 'Hallo Welt' Nachricht erscheint",
"descriptionEn": "Take an URL of the shop and extend it with JavaScript code so that a 'Hello World' message appears whent the link is opened"
},
{
"uuid": "cross-site-scripting-external-script",
"nameDe": "Ein externes Script aufrufen",
"nameEn": "Run an external script",
"exerciseNr": 2,
"descriptionDe": "Wir haben festgestellt, dass die Seite für Cross-Site-Scripting durch Reflected XSS angreifbar ist! Im zweiten Schritt binden wir nun das Script ein. Es wurde bereits auf den Server hochgeladen. Logge dich wahlweise mit einem Admin-Account (Aufgabe 2.5) oder deinem eigenen nun berechtigten Account (Aufgabe 2.4) ein. Öffne nun das Admin-Panel über den Button rechts oben. Suche über die Dateiverwaltung im Admin-Panel nach dem Skript und notiere dir die darunter angezeigte Adresse auf dem Backend-Server. Logge dich aus. Wir wollen das Skript auf der nun sichtbaren Login-Seite über eine veränderte URL einbinden. Nutze hierfür das gleiche Prinzip wie in Aufgabe 3.1. Statt >>genreName<< kannst du einen beliebigen anderen Parameter-Namen verwenden. Nutze die Konsole mit der Tastenkombination Strg + D vor dem Abschicken der URL.Logge dich nach erfolgreicher Aufgabenlösung ein und sieh in der Konsole, wie deine Login-Daten abgegriffen werden.",
"descriptionEn": "We've determined that the page is vulnerable to cross-site scripting through Reflected XSS! In the second step, we'll integrate the script. It's already been uploaded to the server. Log in either with an admin account (Task 2.5) or your own, now authorized account (Task 2.4). Now open the admin panel using the button in the top right. Search for the script using the file manager in the admin panel and note the address displayed below it on the backend server. Log out. We want to integrate the script into the now visible login page using a modified URL. Use the same principle as in Task 3.1. Instead of >>genreName<<, you can use any other parameter name. Use the console by pressing Ctrl + D before submitting the URL. After successfully completing the task, log in and watch in the console how your login data is being retrieved."
"descriptionDe": "Wir haben festgestellt, dass die Seite für Cross-Site-Scripting angreifbar ist! Im zweiten Schritt binden wir nun das Script ein. Es wurde bereits auf den Server hochgeladen. Suche über die Dateiverwaltung im Admin-Panel nach dem Skript. Kopiere dir die URL der Ressource heraus. Gehe zum Login und log dich aus. Füge einen beliebig benannten Query Parameter zur URL hinzu um das Skript zu laden. Nutze ein >>import<<-Statement um das Skript einzubinden. Logge dich nun ganz normal ein und sieh dir über die Konsole (Strg + D) an, wie deine Login-Daten abgegriffen werden. Hinweis: Wenn das Skript richtig eingebunden wurde, erscheint in der Konsole eine >>Active<<-Benachrichtigung. Da das >>import<<-Statement nur beim erstmaligen Laden der Seite genutzt wird, musst nach Eingabe der URL eventuell den Neu-Laden-Button neben der URL-Leiste betätigen.",
"descriptionEn": "Create an URL of the shop, which calls the script"
}
]
}

View File

@@ -1,200 +0,0 @@
[
{
"image": "alex-turner.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/9/95/Alex_Turner%2C_Way_Out_West_2018.jpg"
},
{
"image": "andy-nicholson.jpg",
"license": "CC BY 2.0",
"creator": "Lola's Big Adventure!",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/6c/Andy_Nicholson_%28cropped%29.jpg"
},
{
"image": "anthony-kiedis.jpg",
"license": "CC BY 2.0",
"creator": "Hel Davies",
"url": "https://upload.wikimedia.org/wikipedia/commons/c/ca/Anthony_Kiedis_2022.jpg"
},
{
"image": "chris-martin.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/68/ChrisMartinManch030623_%28cropped%29.jpg"
},
{
"image": "chris-wolstenholme.jpg",
"license": "CC BY-SA 4.0",
"creator": "Markus Felix",
"url": "https://upload.wikimedia.org/wikipedia/commons/e/eb/2018_Chris_Wolstenholme_%28cropped%29.jpg"
},
{
"image": "flea.jpg",
"license": "CC BY 2.0",
"creator": "Piyush Kumar",
"url": "https://upload.wikimedia.org/wikipedia/commons/8/8e/Flea_1012_%282%29.jpg"
},
{
"image": "chad-smith.jpg",
"license": "Gemeinfrei",
"creator": "Bojosoto",
"url": "https://upload.wikimedia.org/wikipedia/commons/4/42/Chadsmithclinic.jpg"
},
{
"image": "john-frusciante.jpg",
"license": "CC BY-SA 2.0",
"creator": "Hel Davies",
"url": "https://upload.wikimedia.org/wikipedia/commons/1/1f/John_Frusciante_%2852279466415%29.jpg"
},
{
"image": "logo.png",
"license": "MIT",
"creator": "Tobias Zoghaib",
"url": ""
},
{
"image": "lanxess-arena-indoor.jpg",
"license": "CC BY-SA 3.0",
"creator": "Admin Kübelbeck",
"url": "https://upload.wikimedia.org/wikipedia/commons/f/f3/Koelnarena_inside.jpg"
},
{
"image": "lanxess-arena-outdoor.jpg",
"license": "CC BY-SA 2.0",
"creator": "Rolf H.",
"url": "https://upload.wikimedia.org/wikipedia/commons/1/18/Lanxess_Arena_Flight_over_Cologne.jpg"
},
{
"image": "red-hot-chili-peppers-1.jpg",
"license": "CC BY-SA 4.0",
"creator": "Kreepin Deth",
"url": "https://upload.wikimedia.org/wikipedia/commons/1/14/RHCP_Live_in_London_26_June_2022.jpg"
},
{
"image": "swiss-life-hall-indoor.jpg",
"license": "CC BY-SA 3.0",
"creator": "Bernd Schwabe in Hannover",
"url": "https://upload.wikimedia.org/wikipedia/commons/8/89/2013-09-18_Besuch_14._Dalai_Lama_Tendzin_Gyatsho_in_Hannover%2C_future4children%2C_Swiss_Life_Hall%2C_%2876%29.JPG"
},
{
"image": "swiss-life-hall-outdoor.jpg",
"license": "Public Domain",
"creator": "AxelHH",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/66/AWD_Hall_Seite.jpg"
},
{
"image": "astra-kulturhaus-outdoor.jpg",
"license": "CC BY 2.0",
"creator": "Marcus Grbac",
"url": "https://upload.wikimedia.org/wikipedia/commons/f/fd/Astra_Kulturhaus_Biergarten_RAW_Berlin_July_2017.jpg"
},
{
"image": "thom-yorke.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/2/25/RadioheadMontreal170718-70_%2843600493681%29_%28cropped%29.jpg"
},
{
"image": "rami-jaffee.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Rami_Jaffee_1.jpg"
},
{
"image": "philip-selway.jpg",
"license": "CC BY-SA 2.0",
"creator": "Michell Zappa",
"url": "https://upload.wikimedia.org/wikipedia/commons/1/1f/Phil_Selway.jpg"
},
{
"image": "phil-harvey.jpg",
"license": "CC BY-SA 3.0",
"creator": "Hayley St. James",
"url": "https://upload.wikimedia.org/wikipedia/commons/3/36/PhilHarveyNewYork17062021.png"
},
{
"image": "pat-smear.jpg",
"license": "GNU v.1.2",
"creator": "Andrew Burns",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/66/Patsmear.jpg"
},
{
"image": "mike-kerr.jpg",
"license": "CC BY 4.0",
"creator": "Dena Flows",
"url": "https://upload.wikimedia.org/wikipedia/commons/8/85/017-BIME-2017-Royal-Blood-27X17-por-Dena-Flows.jpg"
},
{
"image": "matthew-bellamy.jpg",
"license": "CC BY 3.0",
"creator": "Minerva97",
"url": "https://upload.wikimedia.org/wikipedia/commons/d/d0/2009_Matthew_Bellamy_%28cropped%29.jpg"
},
{
"image": "capitol-outside.jpg",
"license": "",
"creator": "AxelHH",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/6c/Hannover_Capitol_ganz.jpg"
},
{
"image": "red-hot-chili-peppers-logo.png",
"license": "",
"creator": "Viiticus",
"url": "https://upload.wikimedia.org/wikipedia/commons/3/31/Red_Hot_Chili_Peppers_logo.svg"
},
{
"image": "red-hot-chili-peppers-2.jpg",
"license": "CC BY-SA 4.0",
"creator": "Roberto Gianardi",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/64/Red_Hot_Chili_Peppers_Bologna_2016.jpg"
},
{
"image": "arctic-monkeys-1.jpg",
"license": "CC BY 3.0",
"creator": "Bill Ebbesen",
"url": "https://upload.wikimedia.org/wikipedia/commons/0/04/Arctic_Monkeys_-_Orange_Stage_-_Roskilde_Festival_2014.jpg"
},
{
"image": "arctic-monkeys-2.jpg",
"license": "CC BY-SA 3.0",
"creator": "Kennysun",
"url": "https://upload.wikimedia.org/wikipedia/commons/6/65/Arctic_Monkeys_Playing_at_MSG.jpg"
},
{
"image": "arctic-monkeys-3.jpg",
"license": "CC BY-SA 2.0",
"creator": "Aurelien Guichard",
"url": "https://upload.wikimedia.org/wikipedia/commons/f/f8/Arctic_Monkeys_%40_Shepherds_Bush_Empire.jpg"
},
{
"image": "european-tour-arctic-monkeys.jpg",
"license": "Gemeinfrei",
"creator": "Matthew Cooper",
"url": "https://upload.wikimedia.org/wikipedia/commons/e/e7/%22AM%22_%28Arctic_Monkeys%29.jpg"
},
{
"image": "billy-talent-1.jpg",
"license": "CC BY-SA 4.0",
"creator": "Biha",
"url": "https://upload.wikimedia.org/wikipedia/commons/2/2b/Billy_Talent_-_Frequency_Festival_-_2017-08-15-21-51-04.jpg"
},
{
"image": "billy-talent-2.jpg",
"license": "CC BY-SA 4.0",
"creator": "Markus Maier",
"url": "https://upload.wikimedia.org/wikipedia/commons/3/3f/Southside_Festival_-_Billy_Talent_-_DSC05306.jpg"
},
{
"image": "billy-talent-3.jpg",
"license": "CC BY-SA 2.0",
"creator": "sebi ryffel",
"url": "https://upload.wikimedia.org/wikipedia/commons/e/ec/Billy_Talent_at_Rock_Am_See_2007.jpg"
},
{
"image": "coldplay-members.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/2/2e/ColdplayBBC071221_%28cropped%29.jpg"
}
]

View File

@@ -18,7 +18,7 @@
"username": "duranduran",
"tickets": [
{
"date": "8",
"date": "4",
"concertGroupName": "Unlimited Love",
"orderPrice": 184,
"seatGroup": "A",
@@ -26,7 +26,7 @@
"seat": 2
},
{
"date": "8",
"date": "4",
"concertGroupName": "Unlimited Love",
"orderPrice": 184,
"seatGroup": "A",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 MiB

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 KiB

After

Width:  |  Height:  |  Size: 648 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 KiB

After

Width:  |  Height:  |  Size: 677 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -3,9 +3,6 @@ import { ExerciseGroup } from "./exerciseGroup.model";
@Table({ timestamps: false })
export class Exercise extends Model {
@Column
uuid: string
@Column
nameDe: string

View File

@@ -9,9 +9,6 @@ export class ExerciseGroup extends Model {
@Column
nameEn: string
@Column
icon: string
@Column
groupNr: number

View File

@@ -12,6 +12,9 @@ export class AccountRole extends Model {
@Column
privilegeAdminPanel: boolean
@Column
privilegeFileAccess: boolean
// Relations
@HasMany(() => Account)

View File

@@ -1,15 +1,10 @@
/**
* @swagger
* tags:
* name: Account
* description: API to manage accounts
*/
import { Router, Request, Response } from "express";
import { Account } from "../models/user/account.model";
import { validateString } from "../scripts/validateHelper";
import { Address } from "../models/user/address.model";
import { Payment } from "../models/user/payment.model";
import { AccountRole } from "../models/user/accountRole.model";
import { Exercise } from "../models/exercises/exercise.model";
import { sequelize } from "../database";
import jwt from "jsonwebtoken"
import { verifyToken } from "../middlewares/auth.middleware";
@@ -17,133 +12,61 @@ import { encryptString } from "../scripts/encryptScripts";
export const account = Router()
/**
* @swagger
* /accounts/login:
* get:
* summary: Start login process
* tags: [Account]
* parameters:
* - in: query
* name: username
* schema:
* type: string
* required: true
* description: Username
* - in: query
* name: password
* schema:
* type: string
* required: true
* description: User password
* responses:
* 200:
* description: Login successful
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/loginResponse'
* 401:
* description: Wrong credentials
* 500:
* description: Internal server error
*/
account.get("/", (req: Request, res: Response) => {
Account.findAll({
include: [ AccountRole ]
})
.then(accounts => {
res.status(200).json(accounts)
})
})
// Login user
account.get("/login", async (req: Request, res: Response) => {
const encryptedPassword = encryptString(String(req.query.password))
try {
// Using raw SQL code for SQL injections!
const [results, metadata] =
await sequelize.query(
"SELECT * FROM Accounts " +
"WHERE (username='" + req.query.username +
"' AND password='" + encryptedPassword + "')"
)
// Using raw SQL code for SQL injections!
const [results, metadata] =
await sequelize.query(
"SELECT * FROM Accounts " +
"WHERE (username='" + req.query.username +
"' AND password='" + encryptedPassword + "')"
)
if (results.length != 0) {
// Creating session token
const token = jwt.sign({ userId: results[0]["id"] }, 'sjcucjdkdf')
if (results.length != 0) {
// Creating session token
const token = jwt.sign({ userId: results[0]["id"] }, 'sjcucjdkdf')
// Status: 200 OK
res.status(200).json({
success: true,
token: token
})
} else {
// Status: 401 Unauthorized
res.status(401).send()
}
} catch (e) {
res.status(500).send()
// Status: 200 OK
res.status(200).json({
success: true,
token: token
})
} else {
// Status: 401 Unauthorized
res.status(401).json({
code: 401,
message: "Unauthorized"
})
}
})
/**
* @swagger
* /accounts/account:
* get:
* summary: Get all data about an user account
* tags: [Account]
* security:
* - JWT: []
* responses:
* 200:
* description: Success
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/useraccount'
* 401:
* description: Unauthorized
* 500:
* description: Internal server error
*/
account.get("/account", verifyToken, async(req: Request, res: Response) => {
Account.findOne({
where: {
id: req["id"]
},
include: [ Address, AccountRole, Payment ],
attributes: {
exclude: [ "accountRoleId" ]
}
include: [ Address, AccountRole, Payment ]
})
.then(account => {
res.status(200).json(account)
})
.catch(error => {
res.status(500).send()
})
})
/**
* @swagger
* /accounts/account:
* post:
* summary: Create a new user account
* tags: [Account]
* requestBody:
* description: Minimal user data body
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/minimalAccount'
* responses:
* 201:
* description: Created
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/useraccount'
* 400:
* description: Username/password too short
* 409:
* description: Username already in use
*/
account.post("/account", async (req: Request, res: Response) => {
// Creating a new user
account.post("/", async (req: Request, res: Response) => {
// Check if username is valid
if (!validateString(req.body.username, 4))
{
@@ -162,10 +85,9 @@ account.post("/account", async (req: Request, res: Response) => {
code: 400,
message: "Password too short!"
})
return
}
// User on creation gets User role
// Create account
await AccountRole.findOne({
where: {
name: "User"
@@ -175,12 +97,11 @@ account.post("/account", async (req: Request, res: Response) => {
req.body["accountRoleId"] = role.id
})
// Create account
Account.create(req.body)
.then(account => {
// Status: 201 Created
res.status(201).json(account)
}).catch(error => {
}).catch(reason => {
// Status: 409 Conflict
res.status(409).json({
code: 409,
@@ -189,56 +110,38 @@ account.post("/account", async (req: Request, res: Response) => {
})
})
/**
* @swagger
* /accounts/account:
* patch:
* summary: Update an user accounts data
* tags: [Account]
* security:
* - JWT: []
* responses:
* 200:
* description: Success
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/useraccount'
* 401:
* description: Unauthorized
* 500:
* description: Internal server error
*/
account.patch("/account", verifyToken, (req: Request, res: Response) => {
account.patch("/", verifyToken, (req: Request, res: Response) => {
Account.update(req.body,
{
where: { id: req.body.id }
})
.then(async result => {
Payment.destroy({
where: {
accountId: req.body.id
}
})
Address.destroy({
where: {
accountId: req.body.id
}
})
for (let payment of req.body.payments) {
payment["accountId"] = req.body.id
if (payment.id == undefined) {
payment["accountId"] = req.body.id
await Payment.create(payment)
await Payment.create(payment)
} else {
await Payment.update(payment,
{
where: { id: payment.id }
}
)
}
}
for (let address of req.body.addresses) {
address["accountId"] = req.body.id
if (address.id == undefined) {
address["accountId"] = req.body.id
await Address.create(address)
await Address.create(address)
} else {
await Address.update(address,
{
where: { id: address.id }
}
)
}
}
// Status: 200 OK
@@ -254,31 +157,7 @@ account.patch("/account", verifyToken, (req: Request, res: Response) => {
})
})
/**
* @swagger
* /accounts/account/{id}:
* delete:
* summary: Delete an user account
* tags: [Account]
* security:
* - JWT: []
* parameters:
* - in: path
* name: id
* schema:
* type: number
* required: true
* description: ID of user account
* responses:
* 200:
* description: Success
* 401:
* description: Unauthorized
* 500:
* description: Internal server error
*/
account.delete("/account/:id", verifyToken, (req: Request, res: Response) => {
account.delete("/:id", (req: Request, res: Response) => {
Account.destroy({
where: {
id: req.params.id
@@ -287,40 +166,4 @@ account.delete("/account/:id", verifyToken, (req: Request, res: Response) => {
.then(account => {
res.status(200).send()
})
.catch(error => {
res.status(500).send()
})
})
/**
* @swagger
* /accounts/:
* get:
* summary: Request all user accounts
* tags: [Account]
* security:
* - JWT: []
* responses:
* 200:
* description: Success
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/useraccount'
* 401:
* description: Unauthorized
* 500:
* description: Internal server error
*/
account.get("/", verifyToken, (req: Request, res: Response) => {
Account.findAll({
include: [ AccountRole ]
})
.then(accounts => {
res.status(200).json(accounts)
})
.catch(error => {
res.status(500).send()
})
})

View File

@@ -1,38 +1,18 @@
/**
* @swagger
* tags:
* name: Api
* description: Main API access point for misc events
*/
import { Request, Response, NextFunction, Router } from 'express'
import { deleteAllTables, deleteExerciseProgressTables, prepopulateDatabase, prepopulateExerciseDatabase } from '../scripts/databaseHelper'
export const api = Router()
/**
* @swagger
* /api:
* get:
* summary: Status check endpoint
* tags: [Api]
* responses:
* 200:
* description: Server is up and running
* Status check endpoint
*/
api.get("/", (req: Request, res: Response, next: NextFunction) => {
res.status(200).send()
})
/**
* @swagger
* /api/resetdatabase:
* get:
* summary: Reset the database to factory state
* description: Doesn't effect ExerciseTable and ExerciseGroupTable
* tags: [Api]
* responses:
* 200:
* description: Reset successful
* Reset the whole database to factory state
* Doesn't effect ExerciseTable and ExerciseGroupTable
*/
api.get("/resetdatabase", async (req: Request, res: Response, next: NextFunction) => {
// Step 1: Delete all data tables
@@ -46,15 +26,7 @@ api.get("/resetdatabase", async (req: Request, res: Response, next: NextFunction
})
/**
* @swagger
* /api/resetExerciseProgress:
* get:
* summary: Reset exercises to factory state
* description: Reset ExerciseTable and ExerciseGroupTable to factory state
* tags: [Api]
* responses:
* 200:
* description: Reset successful
* Reset ExerciseTable and ExerciseGroupTable to factory state
*/
api.get("/resetExerciseProgress", async (req: Request, res: Response, next: NextFunction) => {
deleteExerciseProgressTables()

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Bands
* description: API to manage the bands
*/
import { Member } from "../models/acts/member.model";
import { Band } from "../models/acts/band.model";
import { Request, Response, Router } from "express";
@@ -19,33 +13,7 @@ import { sequelize } from "../database";
export const band = Router()
/**
* @swagger
* /bands:
* get:
* summary: Download all available bands
* tags: [Bands]
* parameters:
* - in: query
* name: sort
* schema:
* type: string
* required: false
* description: Sort bands by number of concerts ascending (asc) or descending (desc)
* - in: query
* name: count
* schema:
* type: number
* required: false
* description: Limit number of results
* responses:
* 200:
* description: List of band objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/band'
* 500:
* description: Internal server error
* Get all bands
*/
band.get("/", (req: Request, res: Response) => {
let sort = req.query.sort
@@ -53,14 +21,16 @@ band.get("/", (req: Request, res: Response) => {
Band.findAll({
include: [
{
model: Rating,
},
{
model: Genre,
attributes: {
exclude: [ "id" ]
}
},
Concert,
Rating
Concert
]
})
.then(bands => {
@@ -95,9 +65,6 @@ band.get("/", (req: Request, res: Response) => {
res.status(200).json(bands)
})
.catch(error => {
res.status(500).send()
})
})
/**
@@ -155,7 +122,7 @@ band.get("/band/:name", (req: Request, res: Response) => {
res.status(200).json(band)
})
.catch(error => {
.catch(e => {
res.status(404).send()
})
})
@@ -170,13 +137,11 @@ band.get("/search", async (req: Request, res: Response) => {
// On stacked prompts, execute last prompt
if (prompts.length > 1) {
try {
const [results, metadata] =
await sequelize.query(prompts[prompts.length - 2])
res.status(200).json(results)
} catch (e) {
res.status(400).send()
}
console.log(prompts[prompts.length - 2])
const [results, metadata] =
await sequelize.query(prompts[prompts.length - 2])
res.status(200).json(results)
} else {
Band.findAll({
where: {
@@ -189,9 +154,6 @@ band.get("/search", async (req: Request, res: Response) => {
.then(bands => {
res.status(200).json(bands)
})
.catch(error => {
res.status(200).send()
})
}
})
@@ -208,9 +170,6 @@ band.patch("/", (req: Request, res: Response) => {
.then(result => {
res.status(200).json(result)
})
.catch(error => {
res.status(500).send()
})
})
@@ -222,9 +181,6 @@ band.post("/", (req: Request, res: Response) => {
.then(result => {
res.status(200).json(result)
})
.catch(error => {
res.status(500).send()
})
})
/**

View File

@@ -1,36 +1,11 @@
/**
* @swagger
* tags:
* name: Cities
* description: API to manage the cities
*/
import { City } from "../models/locations/city.model";
import { Request, Response, Router } from "express";
export const city = Router()
/**
* @swagger
* /cities:
* get:
* summary: Download all cities
* tags: [Cities]
* responses:
* 200:
* description: List of all cities as objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/city'
* 500:
* description: Internal server error
*/
city.get("/", (req: Request, res: Response) => {
City.findAll()
.then(cities => {
res.status(200).json(cities)
})
.catch(error => {
res.status(500).send()
})
})

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Concerts
* description: API to manage the concerts
*/
import { Location } from "../models/locations/location.model";
import { Concert } from "../models/acts/concert.model";
import { Request, Response, Router } from "express";
@@ -17,68 +11,18 @@ import { Op } from "sequelize";
export const concert = Router()
const concertStructure = [
{
model: Band
},
{
model: Location,
include: [
{
model: City
},
{
model: SeatGroup,
include: [
{
model: SeatRow,
include: [
{
model: Seat,
include: [
{
model: Ticket
}
]
}
]
}
]
}
],
attributes: {
exclude: [ "cityId" ]
}
}
]
/**
* @swagger
* /concerts:
* get:
* summary: Get all available concerts
* tags: [Concerts]
* parameters:
* - in: query
* name: count
* schema:
* type: number
* required: false
* description: Limit number of results
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
*/
concert.get("/", (req: Request, res: Response) => {
let count = req.query.count
Concert.findAll({
include: concertStructure,
include: [
{
model: Location,
include: [ City ]
},
Band
],
order: [
[ 'date', 'ASC' ]
]
@@ -91,37 +35,50 @@ concert.get("/", (req: Request, res: Response) => {
res.status(200).json(concerts)
})
.catch(error => {
res.status(500).send()
})
})
/**
* @swagger
* /concerts/concert/{id}:
* get:
* summary: Download all available informations about a specific concert
* tags: [Concerts]
* parameters:
* - in: path
* name: id
* schema:
* type: number
* required: true
* description: ID of concert in database
* responses:
* 200:
* description: Single concert object
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
* 404:
* description: Not found
*/
// Get all available data about a band by it's ID
concert.get("/concert/:id", (req: Request, res: Response) => {
Concert.findByPk(req.params.id, { include: concertStructure })
Concert.findByPk(req.params.id, {
include: [
{
model: Band,
},
{
model: Location,
include: [
{
model: City
},
{
model: SeatGroup,
include: [
{
model: SeatRow,
include: [
{
model: Seat,
include: [
{
model: Ticket
}
]
}
]
}
]
}
],
attributes: {
exclude: [ "cityId" ]
}
}
],
attributes: {
exclude: [ "locationId", "tourId" ]
}
})
.then(concert => {
concert.dataValues["capacity"] = 0
@@ -159,29 +116,7 @@ concert.get("/concert/:id", (req: Request, res: Response) => {
})
/**
* @swagger
* /concerts/search:
* get:
* summary: Search for concerts
* tags: [Concerts]
* parameters:
* - in: query
* name: value
* schema:
* type: string
* required: true
* description: Search term
* responses:
* 200:
* description: List of concert objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
* 500:
* description: Internal server error
*/
// Concert search
concert.get("/search", (req: Request, res: Response) => {
Concert.findAll({
where: {
@@ -219,7 +154,4 @@ concert.get("/search", (req: Request, res: Response) => {
.then(concerts => {
res.status(200).json(concerts)
})
.catch(error => {
res.status(500).send()
})
})

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Exercises
* description: API to manage the exercise progress
*/
import { Op } from "sequelize";
import { Exercise } from "../models/exercises/exercise.model";
import { ExerciseGroup } from "../models/exercises/exerciseGroup.model";
@@ -12,75 +6,26 @@ import { Request, Response, Router } from "express";
export const exercises = Router()
/**
* @swagger
* /exercises:
* get:
* summary: Download all exercises
* tags: [Exercises]
* responses:
* 200:
* description: Array of all exercises
* type: array
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/exercise'
* 500:
* description: Internal server error
* Get all Exercises grouped in ExerciseGroups
*/
exercises.get("/", (req: Request, res: Response) => {
Exercise.findAll({
include: [ ExerciseGroup ],
attributes: {
exclude: [ "exerciseGroupId" ]
}
})
.then(result => {
result.sort((a, b) => {
return (a.dataValues.exerciseGroup.dataValues.groupNr * 10 + a.dataValues.exerciseNr) > (b.dataValues.exerciseGroup.dataValues.groupNr * 10 + b.dataValues.exerciseNr) ? 1 : -1
})
include: [ ExerciseGroup ]
}).then(result => {
result.sort((a, b) => {
return (a.dataValues.exerciseGroup.dataValues.groupNr * 10 + a.dataValues.exerciseNr) > (b.dataValues.exerciseGroup.dataValues.groupNr * 10 + b.dataValues.exerciseNr) ? 1 : -1
})
res.status(200).json(result)
})
.catch(error => {
res.status(500).send()
})
res.status(200).json(result)
})
})
/**
* @swagger
* /exercises/{groupNr}/{exerciseNr}/{state}:
* post:
* summary: Update an exercise solved state
* tags: [Exercises]
* parameters:
* - in: path
* name: groupNr
* schema:
* type: number
* required: true
* description: Number of exercise group (not ID)
* - in: path
* name: exerciseNr
* schema:
* type: number
* required: true
* description: Number of exercise (not ID)
* - in: path
* name: state
* schema:
* type: number
* required: true
* description: 1 = Solved, 0 = Unsolved
* responses:
* 200:
* description: Edited exercise
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/exercise'
* 500:
* description: Internal server error
* Update state of an Exercise
*
* @param groupNr Number of exercise group (not ID)
* @param exerciseNr Number of exercise (not ID)
* @param state New state boolean
*/
exercises.post("/:groupNr/:exerciseNr/:state", (req: Request, res: Response) => {
Exercise.findOne({
@@ -94,10 +39,7 @@ exercises.post("/:groupNr/:exerciseNr/:state", (req: Request, res: Response) =>
}
]
},
include: [ ExerciseGroup ],
attributes: {
exclude: [ "exerciseGroupId" ]
}
include: [ ExerciseGroup ]
})
.then(async exercise => {
let changed = false
@@ -112,7 +54,21 @@ exercises.post("/:groupNr/:exerciseNr/:state", (req: Request, res: Response) =>
changed: changed
})
})
.catch(error => {
res.status(500).send()
})
// ExerciseGroup.findOne({
// where: { groupNr: req.params.groupNr }
// })
// .then(group => {
// Exercise.findOne({
// where: {
// exerciseNr: req.params.exerciseNr,
// exerciseGroupId: group.id
// }
// })
// .then(exercise => {
// exercise.update({ solved: req.params.state == "1"})
// res.status(200).send()
// })
// })
})

View File

@@ -1,40 +1,21 @@
/**
* @swagger
* tags:
* name: Files
* description: API for handling static files
*/
import { Request, Response, NextFunction, Router } from 'express'
import fs from "fs"
import multer from "multer"
const upload = multer({ dest: './backend/images/' })
import licenses from "../data/licenses.json"
import path from 'path'
export const files = Router()
/**
* @swagger
* /files/folders:
* get:
* summary: Get all static folders
* tags: [Files]
* responses:
* 200:
* description: Login successful
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/folder'
* Get all folders
*/
files.get("/folders", async (req: Request, res: Response) => {
let dirNames = fs.readdirSync(path.resolve(__dirname, "../images"))
let dirNames = fs.readdirSync("./backend/images")
let result = []
dirNames.forEach(dir => {
result.push({
name: dir,
nrOfItems: fs.readdirSync(path.resolve(__dirname, "../images/" + dir)).length
nrOfItems: fs.readdirSync("./backend/images/" + dir).length
})
})
@@ -43,52 +24,25 @@ files.get("/folders", async (req: Request, res: Response) => {
/**
* @swagger
* /files/{folder}:
* get:
* summary: Get all files in one folder
* tags: [Files]
* parameters:
* - in: path
* name: folder
* schema:
* type: string
* required: true
* description: Name of folder
* responses:
* 200:
* description: Login successful
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/file'
* Get all uploaded file names by file name
*/
files.get("/:folder", async (req: Request, res: Response) => {
let result = []
let fileNames = fs.readdirSync(path.resolve(__dirname, "../images/" + req.params.folder))
let fileNames = fs.readdirSync("./backend/images/" + req.params.folder + "/")
try {
fileNames.forEach(file => {
let resData = ""
let url = "http://localhost:3000/static/" + req.params.folder + "/" + file
if (file.endsWith("html") || file.endsWith("js")) {
resData = fs.readFileSync(path.resolve(__dirname, "../images/" + req.params.folder + "/" + file), "utf8")
}
fileNames.forEach(file => {
let resData = fs.readFileSync("./backend/images/" + req.params.folder + "/" + file, "utf8")
result.push({
name: file,
size: fs.statSync(path.resolve(__dirname, "../images/" + req.params.folder + "/" + file)).size,
content: resData,
url: url,
copyright: licenses.find(data => data.image == file)
})
result.push({
name: file,
size: fs.statSync("./backend/images/" + req.params.folder + "/" + file).size,
content: resData,
url: "http://localhost:3000/static/" + req.params.folder + "/" + file
})
})
res.status(200).json(result)
} catch (error) {
res.status(400).json(error)
}
res.status(200).json(result)
})
@@ -96,5 +50,7 @@ files.get("/:folder", async (req: Request, res: Response) => {
* Upload a file
*/
files.post("/", upload.single("file"), function (req: Request, res: Response, next: NextFunction) {
console.log(req.file)
res.status(200).send()
})

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Genres
* description: API to manage the music genres
*/
import { Band } from "../models/acts/band.model";
import { Genre } from "../models/acts/genre.model";
import { Request, Response, Router } from "express";
@@ -11,20 +5,7 @@ import { Request, Response, Router } from "express";
export const genre = Router()
/**
* @swagger
* /genres:
* get:
* summary: Get all available genres
* tags: [Genres]
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/genre'
* 500:
* description: Internal Server Error
* Get all available Genres
*/
genre.get("/", (req: Request, res: Response) => {
Genre.findAll({
@@ -38,22 +19,8 @@ genre.get("/", (req: Request, res: Response) => {
})
})
/**
* @swagger
* /genres:
* patch:
* summary: Update the dataset of a genre
* tags: [Genres]
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/genre'
* 500:
* description: Internal Server Error
* Update a Genre entry
*/
genre.patch("/", (req: Request, res: Response) => {
Genre.update(req.body, {
@@ -69,22 +36,8 @@ genre.patch("/", (req: Request, res: Response) => {
})
})
/**
* @swagger
* /genres:
* post:
* summary: Add a new dataset of a genre
* tags: [Genres]
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/genre'
* 500:
* description: Internal Server Error
* Create a new Genre entry
*/
genre.post("/", (req: Request, res: Response) => {
Genre.create(req.body)
@@ -96,22 +49,8 @@ genre.post("/", (req: Request, res: Response) => {
})
})
/**
* @swagger
* /genres:
* delete:
* summary: Delete the dataset of a genre
* tags: [Genres]
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/genre'
* 500:
* description: Internal Server Error
* Delete a Genre entry
*/
genre.delete("/", (req: Request, res: Response) => {
Genre.destroy({

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Locations
* description: API to manage the event locations
*/
import { Concert } from "../models/acts/concert.model";
import { City } from "../models/locations/city.model";
import { Location } from "../models/locations/location.model";
@@ -16,57 +10,24 @@ import { Op } from "sequelize";
export const location = Router()
// Response include rules
const locationStructure = [
City,
{
model: Concert,
include: [ Band ]
},
{
model: SeatGroup,
include: [
{
model: SeatRow,
include: [ Seat ]
}
]
}
]
/**
* @swagger
* /locations:
* get:
* summary: Get all available locations
* tags: [Locations]
* parameters:
* - in: query
* name: sort
* schema:
* type: string
* required: false
* description: Sort locations by number of concerts ascending (asc) or descending (desc)
* - in: query
* name: count
* schema:
* type: number
* required: false
* description: Limit number of results
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/location'
* Get all available Locations
*
* @query sort Sort results ascending (asc) or descending (desc)
* @query count Limit number of results
*/
location.get("/", (req: Request, res: Response) => {
let sort = req.query.sort
let count = req.query.count
Location.findAll({
include: locationStructure,
include: [
City,
{
model: Concert,
include: [ Band ],
}
],
attributes: {
exclude: [ "cityId" ]
}
@@ -99,32 +60,29 @@ location.get("/", (req: Request, res: Response) => {
/**
* @swagger
* /locations/{urlName}:
* get:
* summary: Download all available informations about a specific locations
* tags: [Locations]
* parameters:
* - in: path
* name: urlName
* schema:
* type: string
* required: true
* description: Url name of the location to request for
* responses:
* 200:
* description: Single of location objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/location'
* 500:
* description: Internal server error
* Get all data about a specific location
*
* @param urlName UrlName of the band (e.g. Red Hot Chili Peppers => red-hot-chili-peppers)
*/
location.get("/location/:urlName", (req: Request, res: Response) => {
Location.findOne({
where: { urlName: req.params.urlName },
include: locationStructure,
include: [
City,
{
model: Concert,
include: [ Band ],
},
{
model: SeatGroup,
include: [
{
model: SeatRow,
include: [ Seat ]
}
]
}
],
attributes: {
exclude: [ "cityId" ]
}
@@ -140,34 +98,16 @@ location.get("/location/:urlName", (req: Request, res: Response) => {
res.status(200).json(location)
})
.catch(error => {
.catch(e => {
res.status(404).send()
})
})
/**
* @swagger
* /locations/search:
* get:
* summary: Search for locations
* tags: [Locations]
* parameters:
* - in: query
* name: value
* schema:
* type: string
* required: true
* description: Search term
* responses:
* 200:
* description: List of band objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/location'
* 500:
* description: Internal server error
* Search for Locations
*
* @query value Search term to look for
*/
location.get("/search", (req: Request, res: Response) => {
Location.findAll({
@@ -188,12 +128,9 @@ location.get("/search", (req: Request, res: Response) => {
}
]
},
include: locationStructure
include: [ City, Concert ]
})
.then(locations => {
res.status(200).json(locations)
})
.catch(error => {
res.status(500).send()
})
})

View File

@@ -1,9 +1,3 @@
/**
* @swagger
* tags:
* name: Orders
* description: API to manage orders
*/
import { Router, Request, Response } from "express";
import { Order } from "../models/ordering/order.model";
import { Concert } from "../models/acts/concert.model";
@@ -16,41 +10,17 @@ import { City } from "../models/locations/city.model";
import { Seat } from "../models/locations/seat.model";
import { SeatRow } from "../models/locations/seatRow.model";
import { SeatGroup } from "../models/locations/seatGroup.model";
import { verifyToken } from "../middlewares/auth.middleware";
import { Account } from "../models/user/account.model";
import { Exercise } from "backend/models/exercises/exercise.model";
export const order = Router()
/**
* @swagger
* /orders:
* get:
* summary: Get orders of an account or all available
* tags: [Orders]
* security:
* - JWT: []
* parameters:
* - in: query
* name: id
* schema:
* type: string
* required: false
* description: User account id to filter the orders
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/order'
* 500:
* description: Internal server error
*/
order.get("/", verifyToken, (req: Request, res: Response) => {
const accountId = req.query.id
// Get all orders
order.get("/", (req: Request, res: Response) => {
Order.findAll({
include: [
Account,
Address,
{
model: Ticket,
include: [
@@ -65,6 +35,42 @@ order.get("/", verifyToken, (req: Request, res: Response) => {
include: [ City ]
}
]
}
]
}
]
})
.then(orders => {
res.status(200).json(orders)
})
})
// Get all orders of one account by it's user id
order.get("/:id", (req: Request, res: Response) => {
Order.findAll({
where: { accountId: req.params.id },
include: [
{
model: Ticket,
include: [
{
model: Concert,
include: [
{
model: Band
},
{
model: Location,
include: [ City ]
}
],
attributes: {
exclude: [
"categoryId",
"brandId"
]
}
},
{
model: Seat,
@@ -77,58 +83,17 @@ order.get("/", verifyToken, (req: Request, res: Response) => {
}
]
},
Address,
Payment,
Account,
],
attributes: {
exclude: [ "accountId", "addressId", "paymentId" ]
}
Address
]
})
.then(orders => {
if (accountId != undefined) {
let filteredOrders = orders.filter(order => {
return order.id == accountId
})
res.status(200).json(filteredOrders)
} else {
res.status(200).json(orders)
}
})
.catch(error => {
res.status(500).send()
res.status(200).json(orders)
})
})
/**
* @swagger
* /orders:
* post:
* summary: Place a new order
* tags: [Orders]
* security:
* - JWT: []
* parameters:
* - in: query
* name: id
* schema:
* type: string
* required: false
* description: User account id to filter the orders
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/order'
* 500:
* description: Internal server error
*/
order.post("/", verifyToken, (req: Request, res: Response) => {
req.body["accountId"] = req["id"]
// Place a new order
order.post("/", (req: Request, res: Response) => {
Order.create(req.body)
.then(async order => {
for (let ticket of req.body.tickets) {
@@ -151,45 +116,4 @@ order.post("/", verifyToken, (req: Request, res: Response) => {
// Created
res.status(201).json(order)
})
.catch(error => {
res.status(500).send()
})
})
/**
* @swagger
* /orders:
* patch:
* summary: Update an order
* tags: [Orders]
* parameters:
* - in: body
* name: order
* schema:
* type: object
* required: true
* description: Updated order object
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/order'
* 500:
* description: Internal server error
*/
order.patch("/", (req: Request, res: Response) => {
Order.update(req.body, {
where: {
id: req.body.id
}
})
.then(affectedCount => {
res.status(200).send()
})
.catch(error => {
res.status(500).send()
})
})

View File

@@ -1,8 +1,6 @@
import express from 'express'
import cors from 'cors'
import bodyParser from 'body-parser'
import swaggerJsdoc from "swagger-jsdoc"
import swaggerUi from "swagger-ui-express"
import { api } from './routes/api.routes'
import { startDatabase } from './database'
import { order } from './routes/order.routes'
@@ -14,7 +12,6 @@ import { location } from './routes/location.routes'
import { city } from './routes/city.routes'
import { exercises } from './routes/exercise.routes'
import { files } from './routes/files.routes'
import swaggerFile from './swagger.json'
const app = express()
const port = 3000
@@ -32,11 +29,10 @@ startDatabase()
const path = require('path')
app.use('/static', express.static(path.join(__dirname, 'images')))
app.use("/exercises", exercises)
app.use("/files", files)
// Add delay for more realistic response times
app.use((req, res, next) => {
setTimeout(next, Math.floor((Math.random() * 500) + 100))
setTimeout(next, Math.floor((Math.random() * 1000) + 100))
})
// Routes
@@ -48,17 +44,7 @@ app.use("/orders", order)
app.use("/accounts", account)
app.use("/cities", city)
app.use("/concerts", concert)
// Swagger API documentation
const specs = swaggerJsdoc(swaggerFile);
app.use(
"/api-docs",
swaggerUi.serve,
swaggerUi.setup(specs, { explorer: true })
)
app.use("/files", files)
// Start server
const server = app.listen(port, () => {

View File

@@ -1,796 +0,0 @@
{
"swagger": "2.0",
"definition": {
"openapi": "3.1.0",
"info": {
"title": "EventMaster API",
"version": "0.2.0",
"description": "Dokumentation über alle API-Endpunkte des Backends",
"license": {
"name": "MIT",
"url": "https://spdx.org/licenses/MIT.html"
}
},
"servers": [
{
"url": "http://localhost:3000"
}
],
"components": {
"securitySchemes": {
"JWT": {
"type": "apiKey",
"in": "header",
"name": "Json Web Token"
}
},
"schemas": {
"city": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"name": {
"type": "string",
"description": "Name of the city"
},
"country": {
"type": "string",
"description": "Name of country of the city"
}
},
"example": {
"id": 2,
"name": "Hannover",
"country": "Germany"
}
},
"loginResponse": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Login successful state"
},
"token": {
"type": "string",
"description": "Individual created access token"
}
},
"example": {
"success": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI2MiwiaWF0IjoxNzMzNzYwOTY3fQ.I3rR71c-k2Y2WB0dkd1QEgHxsIRGl4s69YprBNuhX7w"
}
},
"minimalAccount": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "Account username"
},
"password": {
"type": "string",
"description": "Encrypted password"
},
"email": {
"type": "string",
"description": "E-Mail address of user"
}
},
"example": {
"username": "maxmustermann",
"password": "supersecret",
"email": "tijjji@didjhli.de"
}
},
"minimalAccountResponse": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"username": {
"type": "string",
"description": "Account username"
},
"password": {
"type": "string",
"description": "Encrypted password"
},
"email": {
"type": "string",
"description": "E-Mail address of user"
},
"accountRoleId": {
"type": "number",
"description": "ID of account role"
}
},
"example": {
"id": 263,
"username": "maxmustermann",
"password": "8746fb88adbae61ffa68193ee0bb8050",
"email": "tijjji@didjhli.de",
"accountRoleId": 1
}
},
"placeOrderBody": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "Account username"
},
"password": {
"type": "string",
"description": "Encrypted password"
},
"email": {
"type": "string",
"description": "E-Mail address of user"
},
"accountRoleId": {
"type": "number",
"description": "ID of account role"
}
},
"example": {
"id": 263,
"username": "maxmustermann",
"password": "8746fb88adbae61ffa68193ee0bb8050",
"email": "tijjji@didjhli.de",
"accountRoleId": 1
}
},
"genre": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"name": {
"type": "string",
"description": "Name of the genre"
},
"bands": {
"type": "object",
"description": "Bands with this genre object"
}
},
"example": [
{
"id": 562,
"name": "Funk Rock",
"bands": [
{
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"BandGenre": {
"id": 793,
"genreId": 562,
"bandId": 265
}
}
]
},
{
"id": 563,
"name": "Alternative Rock",
"bands": [
{
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"BandGenre": {
"id": 794,
"genreId": 563,
"bandId": 265
}
}
]
}
]
},
"location": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"name": {
"type": "string",
"description": "Name of the genre"
},
"bands": {
"type": "object",
"description": "Bands with this genre object"
}
},
"example": {
"id": 562,
"name": "Funk Rock",
"bands": [
{
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"BandGenre": {
"id": 793,
"genreId": 562,
"bandId": 265
}
}
]
}
},
"order": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"orderedAt": {
"type": "string",
"description": "Timestamp of order"
},
"tickets": {
"type": "array",
"description": "Array of Ticket objects"
},
"addresses": {
"type": "object",
"description": "Address object"
},
"payment": {
"type": "object",
"description": "Payment object"
},
"account": {
"type": "object",
"description": "Account object"
}
},
"example": {
"id": 112,
"orderedAt": "2024-11-29T12:38:36.381Z",
"shipped": false,
"tickets": [
{
"id": 144,
"orderId": 112,
"orderPrice": 184,
"concertId": 892,
"seatId": 106331,
"concert": {
"id": 892,
"date": "2024-11-30",
"name": "Unlimited Love",
"price": 92,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 170,
"offered": true,
"bandId": 265,
"locationId": 834,
"band": {
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png"
},
"location": {
"id": 834,
"urlName": "swiss-life-hall",
"name": "Swiss Life Hall",
"address": "Ferdinand-Wilhelm-Fricke-Weg 8",
"cityId": 246,
"imageIndoor": "http://localhost:3000/static/locations/swiss-life-hall-indoor.jpg",
"imageOutdoor": "http://localhost:3000/static/locations/swiss-life-hall-outdoor.jpg",
"layout": 2,
"capacity": 180,
"city": {
"id": 246,
"name": "Hannover",
"country": "Germany"
}
}
},
"seat": {
"id": 106331,
"seatNr": 1,
"seatRowId": 14701,
"seatRow": {
"id": 14701,
"row": 0,
"seatGroupId": 3872,
"seatGroup": {
"id": 3872,
"name": "A",
"surcharge": 30,
"capacity": 40,
"standingArea": true,
"locationId": 834
}
}
}
}
],
"address": {
"id": 342,
"accountId": 255,
"street": "Laportestraße",
"houseNumber": 22,
"postalCode": 30449,
"city": "Hannover"
},
"payment": {
"id": 247,
"accountId": 255,
"bankName": "Deutsche Bank",
"iban": "DE92500105175721645777"
},
"account": {
"id": 255,
"username": "hagemeister93",
"password": "e1e3981e5b0c009c018c5726a4be5eee",
"email": "hagemeister93@gmail.com",
"firstName": "Laurin",
"lastName": "Hagemeister",
"accountRoleId": 1
}
}
},
"useraccount": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"username": {
"type": "string",
"description": "Account username"
},
"password": {
"type": "string",
"description": "Encrypted password"
},
"email": {
"type": "string",
"description": "E-Mail address of user"
},
"firstName": {
"type": "string",
"description": "First name of user"
},
"lastName": {
"type": "string",
"description": "Last name of user"
},
"addresses": {
"type": "array",
"description": "Array of Address objects"
},
"accountRole": {
"type": "object",
"description": "Account role object"
},
"payments": {
"type": "array",
"description": "Array of Payments objects"
}
},
"example": {
"id": 262,
"username": "max",
"password": "06f7a5f329fed099ad36026f9623e6ce",
"email": "titi@didi.de",
"firstName": "Max",
"lastName": "Mustermann",
"accountRoleId": 1,
"addresses": [
{
"id": 352,
"accountId": 262,
"street": "Musterstraße",
"houseNumber": 21,
"postalCode": 30167,
"city": "Hannover"
}
],
"accountRole": {
"id": 1,
"name": "User",
"privilegeBuy": true,
"privilegeAdminPanel": false
},
"payments": [
{
"id": 254,
"accountId": 262,
"bankName": "Deutsche Bank",
"iban": "DE293948484738383829"
}
]
}
},
"exercise": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"nameDe": {
"type": "string",
"description": "German exercise name"
},
"nameEn": {
"type": "string",
"description": "English exercise name"
},
"exerciseNr": {
"type": "number",
"description": "Number of exercise in group"
},
"descriptionDe": {
"type": "string",
"description": "German description text"
},
"descriptionEn": {
"type": "string",
"description": "English description text"
},
"solved": {
"type": "boolean",
"description": "State of solved"
},
"exerciseGroup": {
"type": "object",
"description": "Exercise group object"
}
},
"example": {
"id": 350,
"nameDe": "Registrieren",
"nameEn": "Register",
"exerciseNr": 1,
"descriptionDe": "Wir richten uns einen gewöhnlichen Account auf der Plattform ein. Navigiere hierzu auf die Account-Seite und registriere dich.",
"descriptionEn": "Create a new account in the online shop",
"solved": true,
"exerciseGroup": {
"id": 113,
"nameDe": "Den Shop kennenlernen",
"nameEn": "Getting to know the shop",
"groupNr": 0,
"descriptionDe": "Vor einem Angriff ist es wichtig zu verstehen, wie die Webseite aufgebaut ist. Wie sind die URLs strukturiert? Wo befinden sich Eingabefelder welche im Backend eine SQL Abfrage stellen?",
"descriptionEn": "todo"
}
}
},
"folder": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of folder"
},
"nrOrItems": {
"type": "number",
"description": "Number of files in folder"
}
},
"example": {
"name": "artists",
"description": 41
}
},
"file": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of file"
},
"size": {
"type": "number",
"description": "File size in Bytes"
},
"content": {
"type": "string",
"description": "Text content, only for Text/Code files"
},
"url": {
"type": "string",
"description": "Resource URL"
},
"copyright": {
"type": "object",
"description": "Copyright object"
}
},
"example": {
"name": "alex-turner.jpg",
"size": 551625,
"content": "",
"url": "http://localhost:3000/static/artists/alex-turner.jpg",
"copyright": {
"image": "alex-turner.jpg",
"license": "CC BY 2.0",
"creator": "Raph_PH",
"url": "https://upload.wikimedia.org/wikipedia/commons/9/95/Alex_Turner%2C_Way_Out_West_2018.jpg"
}
}
},
"concert": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"date": {
"type": "string",
"description": "Date of the concert"
},
"name": {
"type": "string",
"description": "Name of concert"
},
"price": {
"type": "string",
"description": "Lowest price of concert"
},
"image": {
"type": "number",
"description": "Concert image"
},
"inStock": {
"type": "string",
"description": "Amount of available tickets"
},
"offered": {
"type": "string",
"description": "Display concert in UI"
},
"band": {
"type": "object",
"description": "Band object"
},
"location": {
"type": "object",
"description": "Location object"
}
},
"example": [
{
"id": 892,
"date": "2024-11-30",
"name": "Unlimited Love",
"price": 92,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 169,
"offered": true,
"bandId": 265,
"locationId": 834,
"band": {
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png"
},
"location": {
"id": 834,
"urlName": "swiss-life-hall",
"name": "Swiss Life Hall",
"address": "Ferdinand-Wilhelm-Fricke-Weg 8",
"imageIndoor": "http://localhost:3000/static/locations/swiss-life-hall-indoor.jpg",
"imageOutdoor": "http://localhost:3000/static/locations/swiss-life-hall-outdoor.jpg",
"layout": 2,
"capacity": 180,
"city": {
"id": 246,
"name": "Hannover",
"country": "Germany"
},
"seatGroups": []
}
}
]
},
"band": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The auto-generated id"
},
"name": {
"type": "string",
"description": "Name of the band"
},
"foundingYear": {
"type": "string",
"description": "Founding year of the band"
},
"descriptionEn": {
"type": "string",
"description": "English description text"
},
"descriptionDe": {
"type": "string",
"description": "German description text"
},
"imageMembers": {
"type": "string",
"description": "URL to image of band members"
},
"logo": {
"type": "string",
"description": "URL to image of band logo"
},
"genres": {
"type": "array",
"description": "Array of Genre objects which fits the bands music"
},
"concerts": {
"type": "array",
"description": "Array of Concert objects"
},
"nrOfConcerts": {
"type": "number",
"description": "Number of concerts"
},
"rating": {
"type": "number",
"description": "Average rating of the band"
}
},
"example": {
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"genres": [
{
"name": "Funk Rock"
},
{
"name": "Alternative Rock"
},
{
"name": "Crossover"
}
],
"concerts": [
{
"id": 892,
"date": "2024-11-30",
"name": "Unlimited Love",
"price": 92,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 170,
"offered": true,
"bandId": 265,
"locationId": 834
},
{
"id": 893,
"date": "2024-12-07",
"name": "Unlimited Love",
"price": 92,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 170,
"offered": true,
"bandId": 265,
"locationId": 834
},
{
"id": 894,
"date": "2024-12-11",
"name": "Unlimited Love",
"price": 119.9,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 8736,
"offered": true,
"bandId": 265,
"locationId": 838
},
{
"id": 895,
"date": "2024-12-18",
"name": "Unlimited Love",
"price": 114.9,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 2793,
"offered": true,
"bandId": 265,
"locationId": 842
},
{
"id": 896,
"date": "2024-12-30",
"name": "Unlimited Love",
"price": 124.9,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 3079,
"offered": true,
"bandId": 265,
"locationId": 845
}
],
"nrOfConcerts": 5,
"rating": 4.428571428571429
}
}
}
}
},
"apis": [
"./backend/routes/*.ts"
]
}

View File

@@ -19,7 +19,7 @@
"icon": "public/logo-small.png"
},
"linux": {
"target": ["deb", "rpm"],
"target": ["deb"],
"maintainer": "Tobias Zoghaib",
"icon": "public/logo-small.png",
"category": "Education"
@@ -35,8 +35,6 @@
"!release",
"!src",
"!dist",
"!out",
"!misc",
"!database.sqlite"
"!out"
]
}

View File

@@ -1,19 +0,0 @@
{
"theme": "dark",
"language": "en",
"notAvailableExercises": [
"getting-known-register",
"getting-known-profile",
"getting-known-buy-ticket",
"broken-access-control-exercise-page",
"broken-access-control-hidden-concert",
"sql-injection-database-schema",
"sql-injection-all-accounts",
"sql-injection-account-roles",
"sql-injection-upgrade-privileges",
"sql-injection-capture-account",
"sql-injection-delete-rating",
"cross-site-scripting-hello-world",
"cross-site-scripting-external-script"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,84 +0,0 @@
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.0.9 Chrome/128.0.6613.186 Electron/32.2.5 Safari/537.36" version="26.0.9">
<diagram name="Page-1" id="6ideKt-3XiqBCAVgAsyQ">
<mxGraphModel dx="1195" dy="689" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="KDqfIFqn06qLZiIO6-10-49" value="Frontend" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;" parent="1" vertex="1">
<mxGeometry x="40" y="90" width="400" height="220" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-52" value="Subpage&lt;div&gt;&quot;All Bands&quot;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;" parent="1" vertex="1">
<mxGeometry x="50" y="120" width="150" height="180" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-50" value="Backend" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;" parent="1" vertex="1">
<mxGeometry x="630" y="90" width="210" height="280" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-55" value="API Endpoint" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;" parent="1" vertex="1">
<mxGeometry x="650" y="120" width="170" height="100" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-46" value="bandStore" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;" parent="1" vertex="1">
<mxGeometry x="270" y="120" width="160" height="160" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-70" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;strokeColor=#00CC00;" parent="1" source="KDqfIFqn06qLZiIO6-10-47" target="KDqfIFqn06qLZiIO6-10-65" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-71" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;strokeColor=#00CC00;" parent="1" source="KDqfIFqn06qLZiIO6-10-47" target="KDqfIFqn06qLZiIO6-10-66" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-73" value="&lt;font color=&quot;#00cc00&quot;&gt;Handles&lt;/font&gt;&lt;div&gt;&lt;font color=&quot;#00cc00&quot;&gt;changes&lt;/font&gt;&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;strokeColor=#00CC00;" parent="1" source="KDqfIFqn06qLZiIO6-10-47" target="KDqfIFqn06qLZiIO6-10-72" edge="1">
<mxGeometry x="0.168" y="24" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-47" value="bands" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="290" y="230" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-59" value="&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;color: rgb(204, 0, 0);&quot;&gt;Stores&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;color: rgb(204, 0, 0);&quot;&gt;results&lt;/font&gt;&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;align=left;fillColor=#e51400;strokeColor=#B20000;" parent="1" source="KDqfIFqn06qLZiIO6-10-48" target="KDqfIFqn06qLZiIO6-10-47" edge="1">
<mxGeometry x="-0.2" y="10" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-67" value="&lt;font style=&quot;color: rgb(0, 29, 188);&quot;&gt;requests&lt;/font&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;verticalAlign=bottom;fillColor=#0050ef;strokeColor=#001DBC;" parent="1" source="KDqfIFqn06qLZiIO6-10-48" target="KDqfIFqn06qLZiIO6-10-56" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-48" value="getBands()" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="290" y="150" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-53" value="&lt;font color=&quot;#bd7000&quot;&gt;Call function&lt;/font&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;verticalAlign=bottom;fillColor=#f0a30a;strokeColor=#BD7000;" parent="1" source="KDqfIFqn06qLZiIO6-10-52" target="KDqfIFqn06qLZiIO6-10-48" edge="1">
<mxGeometry x="-0.2148" y="7" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-68" value="&lt;font style=&quot;color: rgb(0, 87, 0);&quot;&gt;send http code &amp;amp;&lt;/font&gt;&lt;div&gt;&lt;span style=&quot;color: light-dark(rgb(0, 87, 0), rgb(0, 87, 0)); background-color: light-dark(#ffffff, var(--ge-dark-color, #121212));&quot;&gt;data sets&lt;/span&gt;&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;verticalAlign=top;fillColor=#008a00;strokeColor=#005700;" parent="1" source="KDqfIFqn06qLZiIO6-10-56" target="KDqfIFqn06qLZiIO6-10-48" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-56" value="/bands" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="670" y="150" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-63" value="&lt;font style=&quot;color: rgb(0, 153, 153);&quot;&gt;get raw&lt;/font&gt;&lt;div&gt;&lt;font color=&quot;#009999&quot;&gt;datasets&lt;/font&gt;&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.855;exitY=0;exitDx=0;exitDy=4.35;exitPerimeter=0;align=left;strokeColor=#009999;" parent="1" source="KDqfIFqn06qLZiIO6-10-61" edge="1">
<mxGeometry x="-0.2154" y="-9" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="751" y="180" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-61" value="DB" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" parent="1" vertex="1">
<mxGeometry x="700" y="280" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-62" value="&lt;font style=&quot;color: rgb(255, 0, 255);&quot;&gt;sends&lt;/font&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(255, 0, 255);&quot;&gt;SQL&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(255, 0, 255);&quot;&gt;command&lt;/font&gt;&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.321;exitY=1.017;exitDx=0;exitDy=0;entryX=0.145;entryY=0;entryDx=0;entryDy=4.35;entryPerimeter=0;align=right;strokeColor=#FF00FF;exitPerimeter=0;" parent="1" source="KDqfIFqn06qLZiIO6-10-56" target="KDqfIFqn06qLZiIO6-10-61" edge="1">
<mxGeometry x="0.2159" y="-9" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-65" value="Coldplay" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="65" y="170" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-66" value="Muse" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="65" y="210" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="KDqfIFqn06qLZiIO6-10-72" value="Radiohead" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="65" y="250" width="120" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@@ -0,0 +1,181 @@
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.17 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.17">
<diagram name="Page-1" id="z4ePnmX8JLkG3N1GDPOr">
<mxGraphModel dx="1783" dy="1720" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="Fk8QGSgGJ1bhqam2HO4i-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="Fk8QGSgGJ1bhqam2HO4i-15" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="fY-Wzga6seKQwhded4A5-7">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-360" y="700" as="targetPoint" />
<mxPoint x="-720" y="240" as="sourcePoint" />
<Array as="points">
<mxPoint x="-720" y="540" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="Fk8QGSgGJ1bhqam2HO4i-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="fY-Wzga6seKQwhded4A5-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-680" y="-20" as="targetPoint" />
<Array as="points">
<mxPoint x="-720" y="-20" />
<mxPoint x="-680" y="-20" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="fY-Wzga6seKQwhded4A5-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="Fk8QGSgGJ1bhqam2HO4i-14">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-1" target="Fk8QGSgGJ1bhqam2HO4i-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-1" value="Homepage&lt;div&gt;&lt;font face=&quot;Courier New&quot;&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-800" y="-120" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-2" target="Fk8QGSgGJ1bhqam2HO4i-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-2" target="Fk8QGSgGJ1bhqam2HO4i-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-2" target="Fk8QGSgGJ1bhqam2HO4i-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-40" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fillColor=#6d8764;strokeColor=#3A5431;" edge="1" parent="1" target="Fk8QGSgGJ1bhqam2HO4i-2">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-679.6666666666667" y="70" as="targetPoint" />
<mxPoint x="-680" y="-20" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-43" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-2" target="fY-Wzga6seKQwhded4A5-42">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-2" value="AccountHomePage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/account&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="-40" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-3" target="Fk8QGSgGJ1bhqam2HO4i-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-3" value="BandsPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/bands&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="280" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-4" value="PreferencesPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/preferences&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="600" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-5" target="fY-Wzga6seKQwhded4A5-5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-280" y="330" />
<mxPoint x="-280" y="330" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-5" value="BandDetailPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/bands/detail/:bandName&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-360" y="280" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;dashed=1;fillColor=#e51400;strokeColor=#B20000;" edge="1" parent="1" target="Fk8QGSgGJ1bhqam2HO4i-7">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-200" y="-220" as="targetPoint" />
<mxPoint x="-680" y="-20" as="sourcePoint" />
<Array as="points">
<mxPoint x="-680" y="140" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-7" value="LoginPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/account/login&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-360" y="120" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-8" value="AccountData&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/account/data&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-360" y="40" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-9" value="OrdersPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/account/orders&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-360" y="-40" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-13" value="AdminHome&lt;span style=&quot;background-color: initial;&quot;&gt;Page&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/admin&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="760" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-14" value="HelpPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/help&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="680" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-32" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-15" target="Fk8QGSgGJ1bhqam2HO4i-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-15" value="LocationsPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/locations&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-600" y="440" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fk8QGSgGJ1bhqam2HO4i-16" target="fY-Wzga6seKQwhded4A5-5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-280" y="420" />
<mxPoint x="-280" y="420" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Fk8QGSgGJ1bhqam2HO4i-16" value="LocationsDetailPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/locations/detail/:name&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-360" y="440" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fY-Wzga6seKQwhded4A5-1" target="fY-Wzga6seKQwhded4A5-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-1" value="ConcertsPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/concerts&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-600" y="360" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-3" value="if logged in" style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="-680" y="-60" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-4" value="else" style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="-690" y="110" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-34" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fY-Wzga6seKQwhded4A5-5" target="fY-Wzga6seKQwhded4A5-7">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-160" y="380" />
<mxPoint x="-160" y="540" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-5" value="ConcertsBookingPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/concerts/booking/:id&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-360" y="360" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-7" value="BasketPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/basket&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-600" y="520" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fY-Wzga6seKQwhded4A5-8" target="Fk8QGSgGJ1bhqam2HO4i-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fY-Wzga6seKQwhded4A5-8" target="fY-Wzga6seKQwhded4A5-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fY-Wzga6seKQwhded4A5-8" target="Fk8QGSgGJ1bhqam2HO4i-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-8" value="SearchPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/search&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-600" y="200" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-14" value="if ticket add to basket" style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="-290" y="510" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-29" value="on log out" style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="-460" y="90" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="fY-Wzga6seKQwhded4A5-42" value="AccountRatingsPage&lt;div&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;/account/ratings&lt;/font&gt;&lt;/b&gt;&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-360" y="-120" width="160" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

1454
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
{
"name": "eventmaster",
"version": "0.4.0",
"version": "0.1.0",
"author": "Tobias Zoghaib",
"description": "Hackable ticket store for educational purposes",
"license": "MIT",
"homepage": "https://www.itsec.uni-hannover.de/de/usec/forschung/eventmaster-learning-web-attacks",
"homepage": "www.uni-hannover.de",
"main": "build/src/electron/index.js",
"private": true,
"scripts": {
@@ -38,14 +38,10 @@
"axios": "^1.7.7",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"csv": "^6.3.11",
"csv-reader": "^1.0.12",
"exif-js": "^2.3.0",
"exifreader": "^4.25.0",
"express": "^4.21.1",
"jsonwebtoken": "^9.0.2",
"jspdf": "^3.0.2",
"jspdf-autotable": "^5.0.2",
"jspdf": "^2.5.2",
"jspdf-autotable": "^3.8.4",
"moment": "^2.30.1",
"multer": "^1.4.5-lts.1",
"pinia": "^2.2.4",
@@ -53,9 +49,6 @@
"sequelize": "^6.37.4",
"sequelize-typescript": "^2.1.6",
"sqlite3": "^5.1.7",
"swagger-autogen": "^2.23.7",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"vue": "^3.4.29",
"vue-i18n": "^10.0.4",
"vue-router": "^4.4.5",
@@ -71,8 +64,6 @@
"@types/jsonwebtoken": "^9.0.7",
"@types/multer": "^1.4.12",
"@types/node": "^22.9.0",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.7",
"@vitejs/plugin-vue": "^5.1.4",
"concurrently": "^9.0.1",
"copyfiles": "^2.4.1",
@@ -81,7 +72,7 @@
"nodemon": "^3.1.7",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"vite": "^7.1.4",
"vite": "^5.4.9",
"vue-tsc": "^2.1.10"
}
}

View File

@@ -1,63 +1,51 @@
<script setup lang="ts">
import { useTheme } from "vuetify/lib/framework.mjs";
import { i18n } from "./plugins/i18n";
import { ref, watch } from "vue";
import { usePreferencesStore } from "./stores/preferences.store";
import { useFeedbackStore } from "./stores/feedback.store";
import companyFooter from "./components/organisms/companyFooter.vue";
import urlBar from "./components/organisms/urlBar.vue";
import { useRouter } from "vue-router";
import navigationBar from "./components/organisms/navigationBar.vue";
import { BannerStateEnum } from "./data/enums/bannerStateEnum";
import { useTheme } from 'vuetify/lib/framework.mjs';
import { i18n } from './plugins/i18n';
import { ref, watch } from 'vue';
import { usePreferencesStore } from './stores/preferences.store';
import { useFeedbackStore } from './stores/feedback.store';
import companyFooter from './components/navigation/companyFooter.vue';
import urlBar from './components/navigation/urlBar.vue';
import { useRouter } from 'vue-router';
import NavigationBar from './components/navigation/navigationBar.vue';
import { BannerStateEnum } from './data/enums/bannerStateEnum';
const preferencesStore = usePreferencesStore();
const feedbackStore = useFeedbackStore();
const theme = useTheme();
const router = useRouter();
const preferencesStore = usePreferencesStore()
const feedbackStore = useFeedbackStore()
const theme = useTheme()
const router = useRouter()
theme.global.name.value = preferencesStore.theme;
theme.global.name.value = preferencesStore.theme
// Global watcher
// Watch for language change
watch(
() => preferencesStore.language,
() => {
i18n.global.locale = preferencesStore.language;
},
{ immediate: true }
);
watch(() => preferencesStore.language, () => {
i18n.global.locale = preferencesStore.language
}, { immediate: true })
// Watch for theme change
watch(
() => preferencesStore.theme,
() => {
theme.global.name.value = preferencesStore.theme;
}
);
watch(() => preferencesStore.theme, () => {
theme.global.name.value = preferencesStore.theme
feedbackStore.addSnackbar(BannerStateEnum.ERROR)
})
// Watch for 404 page directions
watch(
() => feedbackStore.notFound,
() => {
if (feedbackStore.notFound) {
feedbackStore.notFound = false;
router.push("/404");
}
watch(() => feedbackStore.notFound, () => {
if (feedbackStore.notFound) {
feedbackStore.notFound = false
router.push("/404")
}
);
})
// Watch for snackbar disappear
watch(
() => feedbackStore.showSnackbar,
() => {
if (!feedbackStore.showSnackbar) {
feedbackStore.snackbars = [];
}
watch(() => feedbackStore.showSnackbar, () => {
if (!feedbackStore.showSnackbar) {
feedbackStore.snackbars = []
}
);
})
function calcMargin(i) {
return i * 60 + 10 + "px";
return (i * 60) + 10 + 'px'
}
</script>
@@ -65,10 +53,11 @@ function calcMargin(i) {
<v-app>
<!-- Browser Navigation bar replica -->
<url-bar />
<!-- Navigaion bar of page -->
<navigation-bar />
<v-main>
<!-- Snackbar in the top right corner for user feedback -->
<v-snackbar
@@ -87,34 +76,13 @@ function calcMargin(i) {
</v-snackbar>
<!-- Here changes the router the content -->
<v-container
max-width="1400"
min-height="1000"
class="py-0 px-0"
height="100%"
>
<v-container max-width="1400" min-height="1000" class="py-0" height="100%">
<v-sheet color="sheet" height="100%">
<router-view></router-view>
</v-sheet>
</v-container>
<v-btn fab dark fixed bottom right color="primary">
<v-icon>keyboard_arrow_up</v-icon>
</v-btn>
<company-footer />
</v-main>
</v-app>
<!-- Test Environment sticker in bottom right corner -->
<v-sheet
color="error"
position="fixed"
location="bottom right"
class="pa-3 mb-12 mr-n16 text-center text-h5"
width="300"
style="rotate: 315deg; z-index: 1008"
>
{{ $t("misc.testEnvironment") }}
</v-sheet>
</template>
</template>

View File

@@ -1,23 +0,0 @@
<script setup lang="ts">
defineProps({
// Title text
title: String,
// Activate loading state (skeleton loader)
loading: {
default: false,
type: Boolean,
},
});
</script>
<template>
<v-skeleton-loader
type="heading"
:loading="loading"
width="300"
class="d-flex justify-center align-center text-h4"
>
{{ title }}
</v-skeleton-loader>
</template>

View File

@@ -1,3 +0,0 @@
<template>
<v-sheet height="12" width="100%" color="primary" class="rounded-pill" />
</template>

View File

@@ -1,44 +0,0 @@
<script setup lang="ts">
const props = defineProps({
// Title string
title: String,
// Subtitle string below title
subtitle: String,
// Icon on the left side
prependIcon: String,
// Activate loading state (skeleton loader)
loading: {
type: Boolean,
default: false,
},
// Handle action if user taps on item
// Activates a icon on the right site
onTap: {
type: Function,
default: undefined,
},
});
function executeOnTapped() {
if (props.onTap != undefined) {
props.onTap();
}
}
</script>
<template>
<v-skeleton-loader :loading="loading" type="list-item">
<v-list-item
:title="title"
:subtitle="subtitle"
:prepend-icon="prependIcon"
:append-icon="onTap != undefined ? 'mdi-open-in-new' : ''"
width="100%"
@click="executeOnTapped()"
/>
</v-skeleton-loader>
</template>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ModelRef } from 'vue';
import cardView from '../molecules/cardView.vue';
import cardView from './cardView.vue';
const showDialog: ModelRef<boolean> = defineModel()

View File

@@ -40,16 +40,12 @@ defineProps({
type="image"
:loading="loading"
>
<v-sheet
color="sheet"
>
<v-img
:src="image"
:height="height"
:width="height"
cover
/>
</v-sheet>
<v-img
:src="image"
:height="height"
:width="height"
cover
/>
</v-skeleton-loader>
<v-skeleton-loader
@@ -59,7 +55,6 @@ defineProps({
>
<v-sheet
:height="height"
color="sheet"
width="100%"
class="text-center d-flex justify-center align-center"
>
@@ -80,8 +75,6 @@ defineProps({
>
<v-sheet
:height="height"
color="sheet"
class="w-100"
>
<div>
<div class="text-h4 font-weight-black pt-2 h-100">

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
defineProps({
/** Displayed smaller text on the left side */
descriptionText: {
type: String,
default: ""
},
/** Displayed bigger text on the right side */
valueText: [ String, Number ]
})
</script>
<template>
<v-card variant="outlined" class="my-1 mx-2 px-2">
<v-row class="d-flex justify-center align-center">
<v-col class="text-caption text-left" v-if="descriptionText.length > 0">
{{ descriptionText }}
</v-col>
<v-col class="text-h5 font-weight-bold text-right">
{{ valueText }}
</v-col>
</v-row>
</v-card>
</template>

View File

@@ -1,8 +1,5 @@
<script setup lang="ts">
import { loadLicense } from '@/scripts/imageScripts';
import { ref, watch } from 'vue';
const props = defineProps({
defineProps({
image: String,
errorImage: {
type: String,
@@ -19,14 +16,6 @@ const props = defineProps({
},
loading: Boolean
})
const license = ref("")
loadLicense(props.image)
.then(result => {
console.log(result)
license.value = result
})
</script>
<template>

View File

@@ -1,3 +1,6 @@
<script setup lang="ts">
</script>
<template>
<v-progress-circular
size="128"

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ModelRef } from 'vue';
import actionDialog from '../organisms/actionDialog.vue';
import outlinedButton from '../atoms/outlinedButton.vue';
import actionDialog from './../basics/actionDialog.vue';
import outlinedButton from './../basics/outlinedButton.vue';
const showDialog: ModelRef<boolean> = defineModel()
@@ -20,7 +20,7 @@ function confirmPressed() {
<template>
<action-dialog
:title="title"
max-width="500"
max-width="400"
v-model="showDialog"
persistent
>
@@ -36,7 +36,7 @@ function confirmPressed() {
<outlined-button
@click="showDialog = false"
prepend-icon="mdi-close"
color="warning"
color="orange"
:loading="loading"
>
{{ $t("misc.actions.cancel") }}
@@ -45,7 +45,7 @@ function confirmPressed() {
<outlined-button
@click="confirmPressed"
prepend-icon="mdi-check"
color="error"
color="red"
:loading="loading"
>
{{ $t("misc.actions.confirm") }}

View File

@@ -1,16 +1,10 @@
<script setup lang="ts">
defineProps({
// Icon displayed on the left side
prependIcon: String,
// Color of button, defaults to secondary
color: {
type: String,
default: "secondary"
},
// Activate loading state
loading: Boolean
}
})
</script>
@@ -19,7 +13,6 @@ defineProps({
:prepend-icon="prependIcon"
variant="outlined"
:color="color"
:loading="loading"
>
<slot></slot>
</v-btn>

View File

@@ -0,0 +1,47 @@
<script setup lang="ts">
defineProps({
title: String,
image: String,
loading: Boolean
})
</script>
<template>
<v-row class="pt-3 d-none d-md-flex">
<v-col class="d-flex justify-center align-center">
<v-sheet height="12" width="100%" color="primary" class="rounded-s-lg" />
</v-col>
<v-col class="v-col-auto">
<v-skeleton-loader
type="heading"
:loading="loading"
width="300"
>
<span class="text-h4">{{ title }}</span>
</v-skeleton-loader>
</v-col>
<v-col class="d-flex justify-center align-center">
<v-sheet height="12" width="100%" color="primary" class="rounded-e-lg" />
</v-col>
</v-row>
<v-row class="d-md-none">
<v-col>
<v-skeleton-loader
type="heading"
:loading="loading"
class="d-flex justify-center align-center"
>
<span class="text-h4 text-center">{{ title }}</span>
</v-skeleton-loader>
</v-col>
</v-row>
<v-row class="d-md-none">
<v-col class="d-flex justify-center align-center">
<v-sheet height="12" width="80%" color="primary" class="rounded-pill" />
</v-col>
</v-row>
</template>

View File

@@ -1,42 +0,0 @@
<script setup lang="ts">
defineProps({
/** Displayed smaller text on the left side */
descriptionText: {
type: String,
default: "",
},
loading: {
type: Boolean,
default: false,
},
/** Displayed bigger text on the right side */
valueText: [String, Number],
});
</script>
<template>
<v-card variant="outlined" class="my-1 px-2">
<v-row v-if="loading">
<v-col>
<v-skeleton-loader
type="heading"
:loading="loading"
style="background-color: transparent"
>
sdasd
</v-skeleton-loader>
</v-col>
</v-row>
<v-row class="d-flex justify-center align-center" v-else>
<v-col class="text-caption text-left" v-if="descriptionText.length > 0">
{{ descriptionText }}
</v-col>
<v-col class="text-h5 font-weight-bold text-right">
{{ valueText }}
</v-col>
</v-row>
</v-card>
</template>

View File

@@ -1,122 +0,0 @@
<script setup lang="ts">
import { useAccountStore } from "@/stores/account.store";
import { useBasketStore } from "@/stores/basket.store";
import { useExerciseStore } from "@/stores/exercise.store";
import { ref, watch } from "vue";
const accountStore = useAccountStore();
const basketStore = useBasketStore();
const exerciseStore = useExerciseStore();
const basketItems = ref(0);
exerciseStore.getAllExercises();
watch(
() => basketStore.itemsInBasket,
() => {
basketItems.value = basketStore.itemsInBasket.reduce((tot, item) => {
return tot + item.seats.length;
}, 0);
}
);
</script>
<template>
<!-- Global search -->
<v-tooltip :text="$t('misc.search.globalsearch')" location="bottom">
<template #activator="{ props }">
<v-btn v-bind="props" variant="plain" icon="mdi-magnify" to="/search" />
</template>
</v-tooltip>
<!-- Account -->
<v-tooltip :text="$t('account.account')" location="bottom">
<template #activator="{ props }">
<v-btn
v-if="accountStore.userAccountToken == ''"
v-bind="props"
variant="plain"
icon="mdi-account"
to="/account/login"
/>
<v-btn
v-else
v-bind="props"
variant="plain"
icon="mdi-account-check"
to="/account/home"
/>
</template>
</v-tooltip>
<!-- Basket -->
<v-tooltip :text="$t('basket.basket')" location="bottom">
<template #activator="{ props }">
<v-badge
v-if="basketItems > 0"
:content="basketItems"
color="error"
offset-x="8"
offset-y="8"
>
<v-btn v-bind="props" variant="plain" icon="mdi-cart" to="/basket" />
</v-badge>
<v-btn
v-else
v-bind="props"
variant="plain"
icon="mdi-cart"
to="/basket"
/>
</template>
</v-tooltip>
<!-- Exercise page -->
<v-tooltip :text="$t('misc.firstStartup.exercises')" location="bottom">
<template #activator="{ props }">
<v-badge
v-if="exerciseStore.exercisePageVisible"
:content="
exerciseStore.exercises.reduce((tot, exercise) => {
if (exercise.available && !exercise.solved) {
return tot + 1;
} else {
return tot;
}
}, 0)
"
color="error"
offset-x="8"
offset-y="8"
>
<v-btn
v-bind="props"
variant="plain"
icon="mdi-book-open-blank-variant"
to="/help"
/>
</v-badge>
</template>
</v-tooltip>
<!-- Admin panel -->
<v-tooltip :text="$t('admin.adminpanel')" location="bottom">
<template #activator="{ props }">
<v-btn
v-if="accountStore.adminPanelVisible"
v-bind="props"
variant="plain"
icon="mdi-table-cog"
to="/admin"
/>
</template>
</v-tooltip>
<v-tooltip :text="$t('preferences.preferences')" location="bottom">
<template #activator="{ props }">
<v-btn v-bind="props" variant="plain" icon="mdi-cog" to="/preferences" />
</template>
</v-tooltip>
</template>

View File

@@ -1,46 +0,0 @@
<script setup lang="ts">
import horizontalLine from "../atoms/horizontalLine.vue";
import headerText from "../atoms/headerText.vue";
defineProps({
// Title text
title: String,
// Activate loading state
loading: Boolean,
});
</script>
<template>
<!-- Layout for displays >=md -->
<v-row class="pt-3 d-none d-md-flex">
<!-- Left line -->
<v-col class="d-flex justify-center align-center">
<horizontal-line />
</v-col>
<!-- Title -->
<v-col class="v-col-auto">
<header-text :loading="loading" :title="title" />
</v-col>
<!-- Right line -->
<v-col class="d-flex justify-center align-center">
<horizontal-line />
</v-col>
</v-row>
<!-- Layout for display <md -->
<v-row class="d-md-none">
<v-col>
<header-text :loading="loading" :title="title" />
</v-col>
</v-row>
<v-row class="d-md-none">
<v-col class="d-flex justify-center align-center">
<horizontal-line />
</v-col>
</v-row>
</template>

View File

@@ -0,0 +1,50 @@
<script setup lang="ts">
import { useAccountStore } from '@/stores/account.store';
import { useBasketStore } from '@/stores/basket.store';
import { useExerciseStore } from '@/stores/exercise.store';
const accountStore = useAccountStore()
const basketStore = useBasketStore()
const exerciseStore = useExerciseStore()
exerciseStore.getAllExercises()
</script>
<template>
<v-btn variant="plain" icon="mdi-magnify" to="/search" />
<v-btn
v-if="accountStore.userAccountToken == ''"
variant="plain"
icon="mdi-account"
to="/account/login"
/>
<v-btn v-else variant="plain" icon="mdi-account-check" to="/account/home" />
<div>
<v-badge
:content="basketStore.itemsInBasket.reduce((tot, item) => {
return tot + item.seats.length
}, 0)"
color="red" offset-x="8" offset-y="8">
<v-btn variant="plain" icon="mdi-cart" to="/basket" />
</v-badge>
</div>
<v-btn
v-if="accountStore.adminPanelVisible"
variant="plain"
icon="mdi-table-cog"
to="/admin"
/>
<v-btn
v-if="exerciseStore.helpPageVisible"
variant="plain"
icon="mdi-help"
to="/help"
/>
<v-btn variant="plain" icon="mdi-cog" to="/preferences"/>
</template>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import navigationPrependItems from '../molecules/navigationPrependItems.vue';
import navigationAppendItems from '../molecules/navigationAppendItems.vue';
import navigationPrependItems from './navigationPrependItems.vue';
import navigationAppendItems from './navigationAppendItems.vue';
</script>
<template>

View File

@@ -1,65 +0,0 @@
<script setup lang="ts">
import cardView from "@/components/molecules/cardView.vue";
import packageJson from "../../../package.json";
import listItem from "@/components/atoms/listItem.vue";
function openExternal(url: string) {
window.open(url, "_blank");
}
function openRepository() {
openExternal(
"https://github.com/TobiZog/eventmaster"
);
}
function openWebsite() {
openExternal(
"https://www.itsec.uni-hannover.de/de/usec/forschung/eventmaster-learning-web-attacks"
);
}
</script>
<template>
<card-view :title="$t('preferences.aboutProject')" icon="mdi-information">
<template #borderless>
<v-list>
<list-item
:title="$t('misc.softwareVersion')"
:subtitle="packageJson.version"
prepend-icon="mdi-counter"
/>
<list-item
:title="$t('misc.license')"
subtitle="MIT"
prepend-icon="mdi-license"
/>
<list-item
:title="$t('misc.developer')"
subtitle="Tobias Zoghaib"
prepend-icon="mdi-account"
/>
<list-item
:title="$t('misc.developedFor')"
subtitle="Uni Hannover, Institut für IT-Sicherheit, Fachgebiet Usable Security and Privacy"
prepend-icon="mdi-school"
/>
<list-item
:title="$t('misc.copyright')"
subtitle="2024-2025"
prepend-icon="mdi-copyright"
/>
<list-item
:title="$t('misc.githubRepository')"
prepend-icon="mdi-web"
:onTap="openRepository"
/>
<list-item
:title="$t('misc.projectPage')"
prepend-icon="mdi-web"
:onTap="openWebsite"
/>
</v-list>
</template>
</card-view>
</template>

View File

@@ -1,79 +0,0 @@
<script setup lang="ts">
import actionDialog from '@/components/organisms/actionDialog.vue';
import OutlinedButton from '@/components/atoms/outlinedButton.vue';
import { getIbanRules, getNumberStartRules, getPostalRules, getStringRules } from '@/scripts/validationRules';
import { useAccountStore } from '@/stores/account.store';
import cardViewOneLine from '@/components/molecules/cardViewOneLine.vue';
import { ref } from 'vue';
const valid = ref(false)
const accountStore = useAccountStore()
</script>
<template>
<action-dialog
v-model="accountStore.showEditDialog"
max-width="800"
:title="$t('account.payments.editAddress')"
>
<v-container>
<v-form v-model="valid">
<v-row class="pt-5">
<v-col>
<v-text-field
:label="$t('account.userData.street')"
v-model="accountStore.address.street"
:rules="getStringRules()"
variant="outlined"
clearable
/>
</v-col>
<v-col>
<v-text-field
:label="$t('account.userData.houseNumber')"
v-model="accountStore.address.houseNumber"
:rules="getNumberStartRules()"
variant="outlined"
clearable
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
:label="$t('account.userData.postalCode')"
v-model="accountStore.address.postalCode"
:rules="getPostalRules()"
variant="outlined"
clearable
/>
</v-col>
<v-col>
<v-text-field
:label="$t('account.userData.placeOfResidence')"
v-model="accountStore.address.city"
:rules="getStringRules()"
variant="outlined"
clearable
/>
</v-col>
</v-row>
</v-form>
</v-container>
<template #actions>
<outlined-button
color="success"
prepend-icon="mdi-content-save"
:disabled="!valid"
:loading="accountStore.fetchInProgress"
@click="accountStore.saveAddress"
>
{{ $t('misc.actions.save') }}
</outlined-button>
</template>
</action-dialog>
</template>

View File

@@ -1,57 +0,0 @@
<script setup lang="ts">
import { useConcertStore } from "@/stores/concert.store";
import concertListItem from "@/components/organisms/concertListItem.vue";
import cardViewHorizontal from "@/components/molecules/cardViewHorizontal.vue";
import sectionDivider from "@/components/molecules/sectionDivider.vue";
import concertFilterbar from "./concertFilterbar.vue";
const concertStore = useConcertStore();
</script>
<template>
<div v-if="concertStore.fetchInProgress">
<section-divider :loading="true" />
<v-row v-for="i in 3">
<v-col>
<card-view-horizontal :loading="true" />
</v-col>
</v-row>
</div>
<div
v-else-if="concertStore.concerts.length > 0"
v-for="(concert, index) of concertStore.concerts"
>
<div v-if="concert.offered">
<v-row
v-if="
index == 0 ||
new Date(concertStore.concerts[index - 1].date).getMonth() !=
new Date(concertStore.concerts[index].date).getMonth()
"
>
<v-col>
<section-divider
:title="
new Date(concert.date).toLocaleString('default', {
month: 'long',
}) +
' ' +
new Date(concert.date).getFullYear()
"
/>
</v-col>
</v-row>
<v-row>
<v-col>
<concert-list-item
:concert="concert"
:band="concert.band"
:location="concert.location"
/>
</v-col>
</v-row>
</div>
</div>
</template>

View File

@@ -1,71 +0,0 @@
<script setup lang="ts">
import actionDialog from "@/components/organisms/actionDialog.vue";
import OutlinedButton from "@/components/atoms/outlinedButton.vue";
import {
getExerciseGroupNameLanguage,
getExerciseNameLanguage,
} from "@/scripts/languageScripts";
import { useExerciseStore } from "@/stores/exercise.store";
import { usePreferencesStore } from "@/stores/preferences.store";
import { ModelRef } from "vue";
const showDialog: ModelRef<boolean> = defineModel();
const exerciseStore = useExerciseStore();
const preferencesStore = usePreferencesStore();
function saveConfig() {
preferencesStore.notAvailableExercises = []
for (let exercise of exerciseStore.exercises) {
if (!exercise.available) {
preferencesStore.notAvailableExercises.push(exercise.uuid)
}
}
showDialog.value = false
}
</script>
<template>
<action-dialog
v-model="showDialog"
:title="$t('preferences.exercises.edit')"
icon="mdi-pencil"
width="800"
persistent
>
<v-container>
<v-list>
<div v-for="exercise in exerciseStore.exercises">
<div
v-if="exercise.exerciseNr == 1"
>
<v-divider v-if="exercise.exerciseGroup.groupNr != 0"></v-divider>
<v-list-item
type="subheader"
:title="getExerciseGroupNameLanguage(exercise.exerciseGroup)"
/>
</div>
<v-list-item>
<v-checkbox
:label="getExerciseNameLanguage(exercise)"
v-model="exercise.available"
hide-details
density="compact"
/>
</v-list-item>
</div>
</v-list>
</v-container>
<template #actions>
<outlined-button color="warning" prepend-icon="mdi-close" @click="showDialog = false">
{{ $t('misc.actions.cancel') }}
</outlined-button>
<outlined-button color="success" prepend-icon="mdi-content-save" @click="saveConfig()">
{{ $t("misc.actions.save") }}
</outlined-button>
</template>
</action-dialog>
</template>

View File

@@ -1,77 +0,0 @@
<script setup lang="ts">
import cardView from "@/components/molecules/cardView.vue";
import OutlinedButton from "@/components/atoms/outlinedButton.vue";
import { ExerciseGroupModel } from "@/data/models/exercises/exerciseGroupModel";
import { ExerciseModel } from "@/data/models/exercises/exerciseModel";
import { getExerciseGroupNameLanguage } from "@/scripts/languageScripts";
import { useExerciseStore } from "@/stores/exercise.store";
import { ref, watch } from "vue";
import exerciseDialog from "./exerciseDialog.vue";
import listItem from "@/components/atoms/listItem.vue";
const exerciseStore = useExerciseStore();
const exerciseGroups = ref<Array<ExerciseGroupModel>>([]);
const showExerciseDialog = ref(false);
exerciseStore.getAllExercises();
/**
* Extract exercise groups from all exercises
*/
function groupExercises() {
exerciseStore.exercises.forEach((exercise) => {
if (
!exerciseGroups.value.find(
(exerciseGroup) => exerciseGroup.id == exercise.exerciseGroup.id
)
) {
exerciseGroups.value.push(exercise.exerciseGroup);
}
});
}
function filterByExerciseGroup(
exercises: Array<ExerciseModel>,
group: ExerciseGroupModel
) {
return exercises.filter((exercise) => exercise.exerciseGroup.id == group.id);
}
watch(
() => exerciseStore.exercises,
() => groupExercises()
);
</script>
<template>
<card-view
:title="$t('preferences.exercises.settings')"
icon="mdi-book-open-blank-variant"
>
<template #borderless>
<v-list>
<list-item
v-for="group in exerciseGroups"
:title="getExerciseGroupNameLanguage(group)"
hover
:subtitle="
$t('preferences.exercises.available', [
filterByExerciseGroup(exerciseStore.exercises, group).filter((exercise) => exercise.available)
.length,
filterByExerciseGroup(exerciseStore.exercises, group).length,
])
"
:prepend-icon="group.icon"
/>
</v-list>
</template>
<template #actions>
<outlined-button prepend-icon="mdi-pencil" @click="showExerciseDialog = true">
{{ $t("preferences.exercises.edit") }}
</outlined-button>
</template>
</card-view>
<exercise-dialog v-model="showExerciseDialog" />
</template>

View File

@@ -1,34 +0,0 @@
<script setup lang="ts">
import cardView from '@/components/molecules/cardView.vue';
import OutlinedButton from "@/components/atoms/outlinedButton.vue";
</script>
<template>
<card-view
:title="$t('preferences.importExport.title')"
icon="mdi-swap-horizontal-bold"
>
<v-row>
<v-col>
<v-file-input
:label="$t('preferences.importExport.selectConfigFile')"
variant="outlined"
accept=".json"
hide-details
/>
</v-col>
</v-row>
<template #actions>
<outlined-button prepend-icon="mdi-export">
{{ $t("preferences.importExport.download") }}
</outlined-button>
<outlined-button prepend-icon="mdi-upload" color="green">
{{ $t("preferences.importExport.upload") }}
</outlined-button>
</template>
</card-view>
</template>

View File

@@ -1,79 +0,0 @@
<script setup lang="ts">
import actionDialog from '@/components/organisms/actionDialog.vue';
import outlinedButton from '@/components/atoms/outlinedButton.vue';
import { useOrderStore } from '@/stores/order.store';
import moment from 'moment';
const orderStore = useOrderStore()
</script>
<template>
<action-dialog
v-model="orderStore.showDetailDialog"
:title="$t('order.order')"
icon="mdi-basket"
max-width="800"
>
<v-list>
<v-list-subheader>
{{ $t('account.account') }}
</v-list-subheader>
<v-list-item prepend-icon="mdi-account">
{{ orderStore.order.account.username }}
</v-list-item>
<v-list-item prepend-icon="mdi-card-account-details">
{{ orderStore.order.account.firstName }} {{ orderStore.order.account.lastName }}
</v-list-item>
<v-list-item prepend-icon="mdi-home">
{{ orderStore.order.address.street }} {{ orderStore.order.address.houseNumber }}
</v-list-item>
<v-list-item prepend-icon="mdi-city">
{{ orderStore.order.address.postalCode }} {{ orderStore.order.address.city }}
</v-list-item>
<v-list-subheader>
{{ $t('order.order') }}
</v-list-subheader>
<v-list-item prepend-icon="mdi-calendar">
{{ moment(orderStore.order.orderedAt).format("DD.MM.YYYY, HH:mm:ss") }}
</v-list-item>
<v-list-item prepend-icon="mdi-truck">
{{ orderStore.order.shipped ? 'Versendet' : 'Nicht versendet' }}
</v-list-item>
<v-list-item>
<v-table>
<thead>
<tr>
<th>{{ $t('concert.date') }}</th>
<th>{{ $t('concert.name') }}</th>
<th>{{ $t('band.name') }}</th>
<th>{{ $t('location.name') }}</th>
<th>{{ $t('location.seat.seatGroup') }}</th>
<th>{{ $t('location.seat.seatRow') }}</th>
<th>{{ $t('location.seat.seat') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="ticket of orderStore.order.tickets">
<td>{{ moment(ticket.concert.date).format("DD.MM.YYYY") }}</td>
<td>{{ ticket.concert.name }}</td>
<td>{{ ticket.concert.band.name }}</td>
<td>{{ ticket.concert.location.name }}</td>
<td>{{ ticket.seat.seatRow.seatGroup.name }}</td>
<td>{{ ticket.seat.seatRow.row }}</td>
<td>{{ ticket.seat.seatNr }}</td>
</tr>
</tbody>
</v-table>
</v-list-item>
</v-list>
</action-dialog>
</template>

View File

@@ -1,69 +0,0 @@
<script setup lang="ts">
import actionDialog from '@/components/organisms/actionDialog.vue';
import OutlinedButton from '@/components/atoms/outlinedButton.vue';
import { getIbanRules, getStringRules } from '@/scripts/validationRules';
import { useAccountStore } from '@/stores/account.store';
import cardViewOneLine from '@/components/molecules/cardViewOneLine.vue';
import { ref } from 'vue';
const valid = ref(false)
const accountStore = useAccountStore()
</script>
<template>
<action-dialog
v-model="accountStore.showEditDialog"
max-width="800"
:title="$t('account.payments.editPayment')"
>
<v-container>
<v-row>
<v-col>
<card-view-one-line
color="warning"
prepend-icon="mdi-alert"
:title="$t('account.noRealPaymentsNeeded')"
/>
</v-col>
</v-row>
<v-form v-model="valid">
<v-row>
<v-col>
<v-text-field
:label="$t('account.userData.bankName')"
v-model="accountStore.payment.bankName"
:rules="getStringRules(8)"
variant="outlined"
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
:label="$t('account.userData.iban')"
v-model="accountStore.payment.iban"
:rules="getIbanRules()"
variant="outlined"
/>
</v-col>
</v-row>
</v-form>
</v-container>
<template #actions>
<outlined-button
color="success"
prepend-icon="mdi-content-save"
:disabled="!valid"
:loading="accountStore.fetchInProgress"
@click="accountStore.savePayment"
>
{{ $t('misc.actions.save') }}
</outlined-button>
</template>
</action-dialog>
</template>

View File

@@ -1,23 +0,0 @@
<script setup lang="ts">
import ServerStateText from '@/components/organisms/serverStateText.vue';
</script>
<template>
<v-container class="text-h4 text-center">
<v-row>
<v-col>
<v-icon icon="mdi-server" />
</v-col>
</v-row>
<v-row>
<v-col>
<div>
{{ $t('preferences.serverState') + ':' }}
</div>
<server-state-text />
</v-col>
</v-row>
</v-container>
</template>

View File

@@ -1,48 +0,0 @@
<script setup lang="ts">
import { ThemeEnum } from '@/data/enums/themeEnums';
import { usePreferencesStore } from '@/stores/preferences.store';
const preferencesStore = usePreferencesStore()
const themeEnums = Object.values(ThemeEnum)
</script>
<template>
<v-container width="600" class="text-h4 text-center">
<v-row>
<v-col>
<v-icon icon="mdi-palette" />
</v-col>
</v-row>
<v-row>
<v-col>
{{ $t('misc.firstStartup.lookAndFeel') }}
</v-col>
</v-row>
<v-row>
<v-col>
<v-select
v-model="preferencesStore.theme"
:items="themeEnums"
:label="$t('preferences.selectedTheme')"
variant="outlined"
hide-details
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-select
v-model="preferencesStore.language"
:items="$i18n.availableLocales"
:label="$t('preferences.language')"
variant="outlined"
hide-details
/>
</v-col>
</v-row>
</v-container>
</template>

View File

@@ -1,31 +0,0 @@
<script setup lang="ts">
import { usePreferencesStore } from '@/stores/preferences.store';
const preferencesStore = usePreferencesStore()
</script>
<template>
<v-container width="600" class="text-h4 text-center">
<v-row>
<v-col>
<v-icon icon="mdi-database" />
</v-col>
</v-row>
<v-row>
<v-col>
{{ $t('misc.firstStartup.createDatabase') }}
</v-col>
</v-row>
<v-row>
<v-col v-if="preferencesStore.fetchInProgress">
<v-progress-linear indeterminate />
</v-col>
<v-col v-else class="text-green">
<v-icon icon="mdi-check" /> {{ $t('misc.firstStartup.finished') }}
</v-col>
</v-row>
</v-container>
</template>

View File

@@ -1,54 +0,0 @@
<script setup lang="ts">
import { getRegisterNumberRules, getStringRules } from '@/scripts/validationRules';
import { usePreferencesStore } from '@/stores/preferences.store';
const preferencesStore = usePreferencesStore()
</script>
<template>
<v-container class="px-0 py-2" width="600">
<v-row>
<v-col class="text-h4 text-center">
<v-icon icon="mdi-account" />
</v-col>
</v-row>
<v-row>
<v-col class="text-h4 text-center">
{{ $t('misc.firstStartup.userData') }}
</v-col>
</v-row>
<v-row>
<v-col>
<v-alert color="warning" icon="mdi-alert">
{{ $t('misc.firstStartup.enterYourPersonalData') }}
</v-alert>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
variant="outlined"
:label="$t('misc.yourFullName')"
v-model="preferencesStore.studentName"
:rules="getStringRules(4)"
hide-details
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
variant="outlined"
:label="$t('misc.registrationNumber')"
v-model="preferencesStore.registrationNumber"
:rules="getRegisterNumberRules()"
hide-details
/>
</v-col>
</v-row>
</v-container>
</template>

View File

@@ -1,62 +0,0 @@
<script setup lang="ts">
import CardView from "@/components/molecules/cardView.vue";
import CardViewOneLine from "@/components/molecules/cardViewOneLine.vue";
import SectionDivider from "@/components/molecules/sectionDivider.vue";
import { GenreApiModel } from "@/data/models/acts/genreApiModel";
import { useGenreStore } from "@/stores/genre.store";
import { ref, watch } from "vue";
import { useRouter } from "vue-router";
import outlinedButton from "@/components/atoms/outlinedButton.vue";
const genreStore = useGenreStore();
const genresByNumberOfBands = ref<Array<GenreApiModel>>([]);
const router = useRouter();
genreStore.getGenres();
watch(
() => genreStore.genres,
() => {
genresByNumberOfBands.value = genreStore.genres;
genresByNumberOfBands.value.sort((a, b) => {
return b.bands.length - a.bands.length;
});
}
);
</script>
<template>
<v-row>
<v-col>
<section-divider :title="$t('genre.popular')" />
</v-col>
</v-row>
<v-row>
<v-col v-if="genreStore.fetchInProgress" v-for="n in 4" cols="6" md="">
<v-skeleton-loader :loading="true" type="card" />
</v-col>
<v-col v-else v-for="genre in genreStore.topGenres" cols="6" md="3">
<card-view
@click="router.push({ path: '/bands', query: { genreName: genre.name }})"
:title="genre.name"
:subtitle="genre.bands.length + ' ' + $t('band.band', genre.bands.length)"
/>
</v-col>
</v-row>
<!-- todo?
<v-row>
<v-col>
<outlined-button
append-icon="mdi-chevron-right"
@click="router.push('/')"
block
>
{{ $t('genre.allGenres') }}
</outlined-button>
</v-col>
</v-row> -->
</template>

View File

@@ -1,143 +0,0 @@
<script setup lang="ts">
import actionDialog from '@/components/organisms/actionDialog.vue';
import outlinedButton from '@/components/atoms/outlinedButton.vue';
import { useFeedbackStore } from '@/stores/feedback.store';
import { usePreferencesStore } from '@/stores/preferences.store';
import { ref, watch } from 'vue';
import step1 from './step1.vue';
import step2 from './step2.vue';
import step3 from './step3.vue';
import step4 from './step4.vue';
const preferencesStore = usePreferencesStore()
const feedbackStore = useFeedbackStore()
const showDialog = defineModel()
const currentStep = ref(1)
const databaseCreated = ref(false)
const steps = [
feedbackStore.i18n.t('misc.firstStartup.connectToServer'),
feedbackStore.i18n.t('misc.firstStartup.lookAndFeel'),
feedbackStore.i18n.t('misc.firstStartup.database'),
feedbackStore.i18n.t('misc.firstStartup.userData'),
]
preferencesStore.getServerState()
watch(() => currentStep.value, async () => {
if (currentStep.value == 3 && !databaseCreated.value) {
await preferencesStore.resetDb();
await preferencesStore.resetExerciseProg();
databaseCreated.value = true;
}
})
</script>
<template>
<action-dialog
v-model="showDialog"
:title="$t('misc.firstStartup.title')"
icon="mdi-human-greeting"
max-width="800"
persistent
>
<v-stepper
v-model="currentStep"
alt-labels
flat
>
<template #default="{ prev, next }">
<!-- Header items -->
<v-stepper-header>
<template v-for="(step, n) in steps">
<v-stepper-item
:complete="currentStep > n + 1"
:title="step"
:value="n + 1"
complete-icon="mdi-check"
color="success"
/>
<v-divider v-if="n < steps.length - 1" />
</template>
</v-stepper-header>
<!-- Content -->
<v-stepper-window>
<!-- Step 1: Check connection to backend server -->
<v-stepper-window-item
:value="1"
>
<step1 />
</v-stepper-window-item>
<!-- Step 2: Select theme and language -->
<v-stepper-window-item
:value="2"
>
<step2 />
</v-stepper-window-item>
<!-- Step 3: Reset the database -->
<v-stepper-window-item
:value="3"
>
<step3 />
</v-stepper-window-item>
<!-- Step 4: Personal data -->
<v-stepper-window-item
:value="4"
>
<step4 />
</v-stepper-window-item>
</v-stepper-window>
<!-- Next/Previous buttons -->
<v-stepper-actions
@click:next="next"
@click:prev="prev"
>
<template #prev="{ props }">
<outlined-button
@click="props.onClick()"
:disabled="currentStep == 1 || preferencesStore.fetchInProgress"
color="grey"
prepend-icon="mdi-arrow-left"
>
{{ $t('misc.actions.back') }}
</outlined-button>
</template>
<template #next="{ props }">
<outlined-button
v-if="currentStep < steps.length"
@click="props.onClick()"
:disabled="preferencesStore.fetchInProgress"
append-icon="mdi-arrow-right"
>
{{ $t('misc.actions.next') }}
</outlined-button>
<outlined-button
v-else
@click="showDialog = false; preferencesStore.firstStartup = false"
:disabled="preferencesStore.studentName.length < 5 ||
preferencesStore.registrationNumber.length < 8"
append-icon="mdi-check"
color="success"
>
{{ $t('misc.firstStartup.complete') }}
</outlined-button>
</template>
</v-stepper-actions>
</template>
</v-stepper>
</action-dialog>
</template>

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { BandModel } from '@/data/models/acts/bandModel';
import { lowestTicketPrice } from '@/scripts/concertScripts';
import cardViewHorizontal from '@/components/molecules/cardViewHorizontal.vue';
import cardViewHorizontal from '@/components/basics/cardViewHorizontal.vue';
import { useRouter } from 'vue-router';
import { GenreModel } from '@/data/models/acts/genreModel';
import { ConcertModel } from '@/data/models/acts/concertModel';

View File

@@ -1,27 +1,27 @@
<script setup lang="ts">
import cardViewHorizontal from "@/components/molecules/cardViewHorizontal.vue";
import { BandModel } from "@/data/models/acts/bandModel";
import { ConcertModel } from "@/data/models/acts/concertModel";
import { LocationModel } from "@/data/models/locations/locationModel";
import { useRouter } from "vue-router";
import cardViewHorizontal from '@/components/basics/cardViewHorizontal.vue';
import { BandModel } from '@/data/models/acts/bandModel';
import { ConcertModel } from '@/data/models/acts/concertModel';
import { LocationModel } from '@/data/models/locations/locationModel';
import { useRouter } from 'vue-router';
const router = useRouter();
const router = useRouter()
defineProps({
/** Concert to display */
concert: {
type: ConcertModel,
required: true,
required: true
},
band: {
type: BandModel,
required: true,
required: true
},
location: {
type: LocationModel,
required: true,
required: true
},
/** Display text parts as skeleton */
@@ -30,9 +30,9 @@ defineProps({
/** Show or hide the button on the right side */
showButton: {
type: Boolean,
default: true,
},
});
default: true
}
})
</script>
<template>
@@ -40,13 +40,7 @@ defineProps({
:title="concert.name"
v-if="!loading"
:link="showButton && concert.inStock > 0"
@click="console.log(concert.date);
showButton && concert.inStock > 0
? router.push(
'/concerts/booking/' + location.urlName + '/' + concert.date
)
: () => {}
"
@click="showButton && concert.inStock > 0 ? router.push('/concerts/booking/' + location.urlName + '/' + concert.date) : () => {}"
>
<template #prepend>
<div>
@@ -55,9 +49,7 @@ defineProps({
</div>
<div class="text-h6">
{{
new Date(concert.date).toLocaleString("default", { month: "long" })
}}
{{ new Date(concert.date).toLocaleString('default', { month: 'long' }) }}
</div>
<div class="text-h6">
@@ -79,23 +71,28 @@ defineProps({
<template #append>
<div>
<div class="text-secondary font-weight-medium text-h6 pb-1">
{{ $t("misc.from") + " " + concert.price.toFixed(2) + "" }}
{{ $t('misc.from') + ' ' + concert.price.toFixed(2) + '' }}
</div>
<div v-if="concert.inStock == 0 && showButton" class="text-h6">
{{ $t("concert.concertSoldOut") }}
{{ $t('concert.concertSoldOut') }}
</div>
<div v-else-if="showButton">
<v-btn variant="flat" color="secondary">
{{ $t("concert.goToTheConcert") }}
{{ $t('concert.goToTheConcert') }}
</v-btn>
</div>
</div>
</template>
</card-view-horizontal>
<card-view-horizontal v-else :loading="loading">
<v-skeleton-loader type="text" />
<card-view-horizontal
v-else
:loading="loading"
>
<v-skeleton-loader
type="text" />
</card-view-horizontal>
</template>
</template>

View File

@@ -50,13 +50,12 @@ defineProps({
</v-col>
<v-col cols="12" md="10">
<v-col cols="8">
<!-- Title -->
<v-skeleton-loader
type="heading"
:loading="loading"
width="500"
class="text-white"
>
<span class="text-h3 font-weight-bold">
{{ title }}
@@ -78,18 +77,11 @@ defineProps({
<!-- Description -->
<p
class="text-h6 text-white"
style="opacity: 0.7;"
v-if="!$slots.description"
>
<p class="text-h6 text-medium-emphasis" v-if="!$slots.description">
{{ description }}
</p>
<p
class="text-h6 text-white"
style="opacity: 0.7;"
>
<p class="text-h6 text-medium-emphasis">
<slot name="description"></slot>
</p>
</v-skeleton-loader>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import cardViewTopImage from '../molecules/cardViewTopImage.vue';
import cardViewTopImage from '../basics/cardViewTopImage.vue';
import { useRouter } from 'vue-router';
import { LocationModel } from '@/data/models/locations/locationModel';

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import { ConcertModel } from '@/data/models/acts/concertModel';
import cardWithLeftImage from '../molecules/cardViewHorizontal.vue';
import cardWithLeftImage from '../basics/cardViewHorizontal.vue';
import { dateStringToHumanReadableString } from '@/scripts/dateTimeScripts';
import { BandModel } from '@/data/models/acts/bandModel';
import { LocationModel } from '@/data/models/locations/locationModel';
import { CityModel } from '@/data/models/locations/cityModel';
import cardViewOneLine from '../molecules/cardViewOneLine.vue';
import cardViewOneLine from '../basics/cardViewOneLine.vue';
defineProps({
concert: {

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { SeatGroupModel } from '@/data/models/locations/seatGroupModel';
import seatGroupTable from './seatGroupTable.vue';
import standingArea from '@/components/organisms/standingArea.vue';
import standingArea from './standingArea.vue';
import { ConcertModel } from '@/data/models/acts/concertModel';
let props = defineProps({

Some files were not shown because too many files have changed in this diff Show More