diff --git a/software/backend/data/cities.json b/software/backend/data/cities.json index 4977687..be2eb6d 100644 --- a/software/backend/data/cities.json +++ b/software/backend/data/cities.json @@ -3,7 +3,153 @@ { "id": 0, "name": "Hannover", - "country": "Germany" + "country": "Germany", + "image": "hannover.jpg", + "locations": [ + { + "id": 0, + "name": "Swiss Life Hall", + "address": "Ferdinand-Wilhelm-Fricke-Weg 8", + "cityId": 0, + "image": "swiss-life-hall.jpg" + }, + { + "id": 1, + "name": "Capitol", + "address": "Schwarzer Bär 2", + "cityId": 0, + "image": "capitol.jpg" + }, + { + "id": 2, + "name": "ZAG Arena", + "address": "EXPO-Plaza 7", + "cityId": 0, + "image": "zag-arena.jpg" + }, + { + "id": 3, + "name": "Kulturzentrum Faust", + "address": "Zur Bettfedernfabrik 3", + "cityId": 0, + "image": "faust-hannover.jpg" + } + ] + }, + { + "id": 1, + "name": "München", + "country": "Germany", + "image": "munich.jpg", + "locations": [ + { + "id": 4, + "name": "Olympiahalle München", + "address": "Spiridon-Louis-Ring 21", + "cityId": 1, + "image": "olympiahalle-munich.jpg" + }, + { + "id": 5, + "name": "Schlachthof München", + "address": "Zenettistraße 9", + "cityId": 1, + "image": "schlachthof-munich.jpg" + }, + { + "id": 6, + "name": "Muffatwerk", + "address": "Zellstraße 4", + "cityId": 1, + "image": "muffatwerk.jpg" + } + ] + }, + { + "id": 2, + "name": "Hamburg", + "country": "Germany", + "image": "hamburg.jpg", + "locations": [ + { + "id": 7, + "name": "Elbphilharmonie Hamburg", + "address": "Platz der deutschen Einheit", + "cityId": 2, + "image": "elbphilharmonie-hamburg.jpg" + }, + { + "id": 8, + "name": "Volksparkstadion", + "address": "Sylvesterallee 7", + "cityId": 2, + "image": "volksparkstadion-hamburg.jpg" + }, + { + "id": 9, + "name": "Barclays Arena", + "address": "Sylvesterallee 10", + "cityId": 2, + "image": "barclays-arena.jpg" + }, + { + "id": 10, + "name": "Stage Theater im Hafen Hamburg", + "address": "Norderelbestraße 6", + "cityId": 2, + "image": "stage-theater-hamburg.jpg" + } + ] + }, + { + "id": 3, + "name": "Berlin", + "country": "Germany", + "image": "berlin.jpg", + "locations": [ + { + "id": 11, + "name": "Waldbühne Berlin", + "address": "Am Glockenturm", + "cityId": 3, + "image": "waldbuehne-berlin.jpg" + }, + { + "id": 12, + "name": "Olympiastadion Berlin", + "address": "Olympischer Platz 3", + "cityId": 3, + "image": "olympiastadion-berlin.jpg" + }, + { + "id": 13, + "name": "Uber Arena Berlin", + "address": "Uber-Platz 1", + "cityId": 3, + "image": "uber-arena-berlin.jpg" + }, + { + "id": 14, + "name": "Columbiahalle", + "address": "Columbiadamm 13-21", + "cityId": 3, + "image": "columbiahalle.jpg" + }, + { + "id": 15, + "name": "Astra Kulturhaus", + "address": "Revaler Straße 99", + "cityId": 3, + "image": "astra-kulturhaus.jpg" + }, + { + "id": 16, + "name": "Deutsche Oper Berlin", + "address": "Bismarckstraße 35", + "cityId": 3, + "image": "deutsche-oper-berlin.jpg" + } + ] } ] } \ No newline at end of file diff --git a/software/backend/data/genres.json b/software/backend/data/genres.json index 0547837..39d2765 100644 --- a/software/backend/data/genres.json +++ b/software/backend/data/genres.json @@ -10,7 +10,7 @@ }, { "id": 2, - "name": "Alternatve Rock" + "name": "Alternative Rock" } ] } \ No newline at end of file diff --git a/software/backend/data/locations.json b/software/backend/data/locations.json deleted file mode 100644 index d58106e..0000000 --- a/software/backend/data/locations.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": [ - { - "id": 0, - "name": "Swiss Life Hall", - "address": "Ferdinand-Wilhlem-Fricke-Weg 8", - "cityId": 0, - "image": "swiss-life-hall.jpg" - }, - { - "id": 1, - "name": "Capitol", - "address": "Schwarzer Bär 2", - "cityId": 0, - "image": "capitol.jpg" - }, - { - "id": 2, - "name": "ZAG Arena", - "address": "EXPO-Plaza 7", - "cityId": 0, - "image": "zag-arena.jpg" - }, - { - "id": 3, - "name": "Kulturzentrum Faust", - "address": "Zur Bettfedernfabrik 3", - "cityId": 0, - "image": "faust-hannover.jpg" - } - ] -} \ No newline at end of file diff --git a/software/backend/images/cities/berlin.jpg b/software/backend/images/cities/berlin.jpg new file mode 100644 index 0000000..4637812 Binary files /dev/null and b/software/backend/images/cities/berlin.jpg differ diff --git a/software/backend/images/cities/hamburg.jpg b/software/backend/images/cities/hamburg.jpg new file mode 100644 index 0000000..13982ca Binary files /dev/null and b/software/backend/images/cities/hamburg.jpg differ diff --git a/software/backend/images/cities/hannover.jpg b/software/backend/images/cities/hannover.jpg new file mode 100644 index 0000000..7a0bc93 Binary files /dev/null and b/software/backend/images/cities/hannover.jpg differ diff --git a/software/backend/images/cities/munich.jpg b/software/backend/images/cities/munich.jpg new file mode 100644 index 0000000..85f398a Binary files /dev/null and b/software/backend/images/cities/munich.jpg differ diff --git a/software/backend/images/locations/astra-kulturhaus.jpg b/software/backend/images/locations/astra-kulturhaus.jpg new file mode 100644 index 0000000..d58b10b Binary files /dev/null and b/software/backend/images/locations/astra-kulturhaus.jpg differ diff --git a/software/backend/images/locations/barclays-arena.jpg b/software/backend/images/locations/barclays-arena.jpg new file mode 100644 index 0000000..9c81cad Binary files /dev/null and b/software/backend/images/locations/barclays-arena.jpg differ diff --git a/software/backend/images/locations/columbiahalle.jpg b/software/backend/images/locations/columbiahalle.jpg new file mode 100644 index 0000000..7a3f475 Binary files /dev/null and b/software/backend/images/locations/columbiahalle.jpg differ diff --git a/software/backend/images/locations/deutsche-oper-berlin.jpg b/software/backend/images/locations/deutsche-oper-berlin.jpg new file mode 100644 index 0000000..a0ae5b5 Binary files /dev/null and b/software/backend/images/locations/deutsche-oper-berlin.jpg differ diff --git a/software/backend/images/locations/elbphilharmonie-hamburg.jpg b/software/backend/images/locations/elbphilharmonie-hamburg.jpg new file mode 100644 index 0000000..8d8d1f9 Binary files /dev/null and b/software/backend/images/locations/elbphilharmonie-hamburg.jpg differ diff --git a/software/backend/images/locations/muffatwerk.jpg b/software/backend/images/locations/muffatwerk.jpg new file mode 100644 index 0000000..435b0db Binary files /dev/null and b/software/backend/images/locations/muffatwerk.jpg differ diff --git a/software/backend/images/locations/olympiahalle-munich.jpg b/software/backend/images/locations/olympiahalle-munich.jpg new file mode 100644 index 0000000..6b3613a Binary files /dev/null and b/software/backend/images/locations/olympiahalle-munich.jpg differ diff --git a/software/backend/images/locations/olympiastadion-berlin.jpg b/software/backend/images/locations/olympiastadion-berlin.jpg new file mode 100644 index 0000000..b9846c9 Binary files /dev/null and b/software/backend/images/locations/olympiastadion-berlin.jpg differ diff --git a/software/backend/images/locations/schlachthof-munich.jpg b/software/backend/images/locations/schlachthof-munich.jpg new file mode 100644 index 0000000..8680228 Binary files /dev/null and b/software/backend/images/locations/schlachthof-munich.jpg differ diff --git a/software/backend/images/locations/stage-theater-hamburg.jpg b/software/backend/images/locations/stage-theater-hamburg.jpg new file mode 100644 index 0000000..929d5de Binary files /dev/null and b/software/backend/images/locations/stage-theater-hamburg.jpg differ diff --git a/software/backend/images/locations/uber-arena-berlin.jpg b/software/backend/images/locations/uber-arena-berlin.jpg new file mode 100644 index 0000000..0a7176e Binary files /dev/null and b/software/backend/images/locations/uber-arena-berlin.jpg differ diff --git a/software/backend/images/locations/volksparkstadion-hamburg.jpg b/software/backend/images/locations/volksparkstadion-hamburg.jpg new file mode 100644 index 0000000..427505e Binary files /dev/null and b/software/backend/images/locations/volksparkstadion-hamburg.jpg differ diff --git a/software/backend/images/locations/waldbuehne-berlin.jpg b/software/backend/images/locations/waldbuehne-berlin.jpg new file mode 100644 index 0000000..0a7fa22 Binary files /dev/null and b/software/backend/images/locations/waldbuehne-berlin.jpg differ diff --git a/software/backend/models/acts/city.model.ts b/software/backend/models/acts/city.model.ts index fe574d8..c4a71bc 100644 --- a/software/backend/models/acts/city.model.ts +++ b/software/backend/models/acts/city.model.ts @@ -9,6 +9,9 @@ export class City extends Model { @Column country: String + @Column + image: String + // Relations diff --git a/software/backend/routes/city.routes.ts b/software/backend/routes/city.routes.ts new file mode 100644 index 0000000..2cf3400 --- /dev/null +++ b/software/backend/routes/city.routes.ts @@ -0,0 +1,14 @@ +import { Location } from "../models/acts/location.model"; +import { City } from "../models/acts/city.model"; +import { Request, Response, Router } from "express"; + +export const city = Router() + +city.get("/", (req: Request, res: Response) => { + City.findAll({ + include: [ Location ] + }) + .then(cities => { + res.status(200).json(cities) + }) +}) \ No newline at end of file diff --git a/software/backend/scripts/databaseHelper.ts b/software/backend/scripts/databaseHelper.ts index f72519d..4938621 100644 --- a/software/backend/scripts/databaseHelper.ts +++ b/software/backend/scripts/databaseHelper.ts @@ -19,7 +19,6 @@ import orderItems from "./../data/orderItems.json" import accountRoles from "./../data/accountRoles.json" import bands from "./../data/bands.json" import genres from "./../data/genres.json" -import locations from "./../data/locations.json" import tours from "./../data/tours.json" import cities from "./../data/cities.json" @@ -50,8 +49,14 @@ export function deleteAllTables() { export async function prepopulateDatabase() { AccountRole.bulkCreate(accountRoles.data) Genre.bulkCreate(genres.data) - City.bulkCreate(cities.data) - Location.bulkCreate(locations.data) + + for (let city of cities.data) { + await City.create(city) + .then(dataset => { + Location.bulkCreate(city.locations) + }) + } + // Account & Sub tables for (let account of accounts.data) { diff --git a/software/backend/server.ts b/software/backend/server.ts index 7397229..2726d55 100644 --- a/software/backend/server.ts +++ b/software/backend/server.ts @@ -10,6 +10,7 @@ import { band } from './routes/band.routes' import { genre } from './routes/genre.routes' import { location } from './routes/location.routes' import { tour } from './routes/tour.routes' +import { city } from './routes/city.routes' const app = express() const port = 3000 @@ -41,6 +42,7 @@ app.use("/locations", location) app.use("/orders", order) app.use("/accounts", account) app.use("/tours", tour) +app.use("/cities", city) // Start server diff --git a/software/src/components/cardWithTopImage.vue b/software/src/components/cardWithTopImage.vue index 61a88cc..550146e 100644 --- a/software/src/components/cardWithTopImage.vue +++ b/software/src/components/cardWithTopImage.vue @@ -6,7 +6,10 @@ defineProps({