Location page displays city groups with all available concert locations
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Alternatve Rock"
|
||||
"name": "Alternative Rock"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
software/backend/images/cities/berlin.jpg
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
software/backend/images/cities/hamburg.jpg
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
software/backend/images/cities/hannover.jpg
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
software/backend/images/cities/munich.jpg
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
software/backend/images/locations/astra-kulturhaus.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
software/backend/images/locations/barclays-arena.jpg
Normal file
|
After Width: | Height: | Size: 383 KiB |
BIN
software/backend/images/locations/columbiahalle.jpg
Normal file
|
After Width: | Height: | Size: 624 KiB |
BIN
software/backend/images/locations/deutsche-oper-berlin.jpg
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
software/backend/images/locations/elbphilharmonie-hamburg.jpg
Normal file
|
After Width: | Height: | Size: 386 KiB |
BIN
software/backend/images/locations/muffatwerk.jpg
Normal file
|
After Width: | Height: | Size: 329 KiB |
BIN
software/backend/images/locations/olympiahalle-munich.jpg
Normal file
|
After Width: | Height: | Size: 951 KiB |
BIN
software/backend/images/locations/olympiastadion-berlin.jpg
Normal file
|
After Width: | Height: | Size: 600 KiB |
BIN
software/backend/images/locations/schlachthof-munich.jpg
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
software/backend/images/locations/stage-theater-hamburg.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
software/backend/images/locations/uber-arena-berlin.jpg
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
software/backend/images/locations/volksparkstadion-hamburg.jpg
Normal file
|
After Width: | Height: | Size: 423 KiB |
BIN
software/backend/images/locations/waldbuehne-berlin.jpg
Normal file
|
After Width: | Height: | Size: 321 KiB |
@@ -9,6 +9,9 @@ export class City extends Model {
|
||||
@Column
|
||||
country: String
|
||||
|
||||
@Column
|
||||
image: String
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
|
||||
14
software/backend/routes/city.routes.ts
Normal 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)
|
||||
})
|
||||
})
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||