Location page displays city groups with all available concert locations

This commit is contained in:
2024-09-27 20:40:59 +02:00
parent 2977c73a10
commit 848e7abf92
36 changed files with 301 additions and 61 deletions

View File

@@ -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"
}
]
}
]
}

View File

@@ -10,7 +10,7 @@
},
{
"id": 2,
"name": "Alternatve Rock"
"name": "Alternative Rock"
}
]
}

View File

@@ -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"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

View File

@@ -9,6 +9,9 @@ export class City extends Model {
@Column
country: String
@Column
image: String
// Relations

View File

@@ -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)
})
})

View File

@@ -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) {

View File

@@ -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