Add PHP Media API scaffold and Docker configs

Initial project scaffold for a PHP Media API including routing, controllers, models and services under api/ (Router, Media/Cast/Image/Settings controllers, models, database/bootstrap files and automatic docs service). Adds Docker support (Dockerfile, docker-compose.yml, DOCKER_README.md, php-custom.ini), .htaccess for pretty URLs, API documentation and example payloads (API_EXAMPLES.md, api/README.md, api_examples/*.json), image handling service and logging, plus a comprehensive .gitignore. This commit provides a runnable development environment and example requests to get the API up and tested quickly.
This commit is contained in:
Lars Behrends
2026-04-12 00:46:30 +02:00
commit 66f69bc90d
54 changed files with 6035 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
{
"name": "Jane Smith",
"photo": "https://example.com/jane-smith.jpg",
"bio": "Adult film actress and model",
"birthDate": "1998-03-20",
"birthPlace": "Miami, Florida",
"occupations": ["Actress", "Model"],
"adult_specifics": {
"bust_size": "36",
"cup_size": "DD",
"waist_size": "26",
"hip_size": "38",
"height": "170",
"weight": "58",
"hair_color": "Brunette",
"eye_color": "Green",
"ethnicity": "Latina",
"tattoos": "Lower back",
"piercings": "None",
"measurements": "36-26-38",
"shoe_size": "8"
}
}

View File

@@ -0,0 +1,28 @@
{
"title": "Thriller",
"year": 1982,
"poster": "https://example.com/thriller-cover.jpg",
"description": "Sixth studio album by Michael Jackson",
"rating": 9.0,
"category": "Music",
"type": "Album",
"status": "Released",
"genres": ["Pop", "Funk", "Rock"],
"tags": ["Classic", "Best-selling"],
"studios": ["Epic Records"],
"staff": [],
"tracks": [
{
"track_number": 1,
"title": "Wanna Be Startin' Somethin'",
"duration": "6:03",
"artist": "Michael Jackson"
},
{
"track_number": 2,
"title": "Baby Be Mine",
"duration": "4:20",
"artist": "Michael Jackson"
}
]
}

View File

@@ -0,0 +1,8 @@
{
"name": "Tom Hardy",
"photo": "https://example.com/tom.jpg",
"bio": "English actor known for versatile roles",
"birthDate": "1977-09-15",
"birthPlace": "Hammersmith, London, England",
"occupations": ["Actor", "Producer", "Writer"]
}

View File

@@ -0,0 +1,9 @@
{
"season": 1,
"episode_number": 3,
"title": "...And the Bag's in the River",
"description": "Walter and Jesse deal with the aftermath.",
"air_date": "2008-02-03",
"duration": 47,
"thumbnail": "https://example.com/ep3.jpg"
}

View File

@@ -0,0 +1,69 @@
{
"type": "Game",
"title": "1-2-Switch",
"sortingName": "1-02-Switch",
"description": "1-2-Switch is a party game for everyone! Throw an impromptu party anywhere with anyone thanks to a new play style in which players look at each other—not the screen!",
"notes": null,
"genres": ["Arcade"],
"categories": ["1-2-Switch"],
"tags": [],
"features": ["Multiplayer"],
"platforms": ["Nintendo Switch"],
"developers": ["Nintendo", "Nintendo Entertainment Planning & Development", "Nintendo EPD Production Group No. 4"],
"publishers": ["Nintendo"],
"series": ["1-2-Switch"],
"ageRatings": ["PEGI 7"],
"regions": [],
"source": "RomM",
"gameId": "!0ChIJR6bm+qTMQUsRjxmwJLs2yzQSUmh0dHA6Ly8xOTIuMTY4LjEuMTAyOjY2NTUvYXBpL3JvbXMvNDEzL2NvbnRlbnQvMS0yLVN3aXRjaFswMTAwMDMyMDAwMENDMDAwXVswXS5uc3AaIzEtMi1Td2l0Y2hbMDEwMDAzMjAwMDBDQzAwMF1bMF0ubnNw",
"pluginId": "9700aa21-447d-41b4-a989-acd38f407d9f",
"completionStatus": "Not Played",
"releaseDate": "2017-03-03",
"isInstalled": false,
"installDirectory": "E:\\Programme\\Emulators\\Games\\1-2-Switch[01000320000CC000][0]",
"installSize": 1481371442,
"hidden": false,
"favorite": false,
"playtime": 0,
"playCount": 0,
"lastActivity": null,
"added": "2026-04-09T17:05:10.9260000+02:00",
"modified": "2026-04-09T17:10:23.1760000+02:00",
"communityScore": 51,
"criticScore": 54,
"userScore": null,
"hasIcon": true,
"hasCover": true,
"hasBackground": true,
"version": null,
"links": [
{
"name": "Official Website",
"url": "http://1-2-switch.nintendo.com/"
},
{
"name": "Wikipedia",
"url": "https://en.wikipedia.org/wiki/1-2-Switch"
},
{
"name": "Community Wiki",
"url": "http://nintendo.wikia.com/wiki/1-2-Switch"
}
],
"achievements": [
{
"name": "First Victory",
"description": "Win your first game",
"icon": "https://example.com/achievement-icon.png",
"unlocked": true,
"unlocked_date": "2026-04-09T18:00:00"
},
{
"name": "Master Player",
"description": "Win 100 games",
"icon": "https://example.com/master-icon.png",
"unlocked": false,
"unlocked_date": null
}
]
}

View File

@@ -0,0 +1,32 @@
{
"title": "The Matrix",
"year": 1999,
"poster": "https://example.com/matrix-poster.jpg",
"banner": "https://example.com/matrix-banner.jpg",
"description": "A computer hacker learns about the true nature of reality.",
"rating": 8.7,
"category": "Movie",
"type": "Movie",
"status": "Released",
"aspectRatio": "2.39:1",
"runtime": 136,
"director": "The Wachowskis",
"writer": "The Wachowskis",
"releaseDate": "1999-03-31",
"genres": ["Sci-Fi", "Action"],
"tags": ["Cyberpunk", "AI", "Simulation"],
"studios": ["Warner Bros."],
"staff": [
{
"name": "Keanu Reeves",
"photo": "https://example.com/keanu.jpg",
"bio": "Canadian actor",
"birthDate": "1964-09-02",
"birthPlace": "Beirut, Lebanon",
"role": "Actor",
"characterName": "Neo",
"characterImage": null,
"occupations": ["Actor"]
}
]
}

View File

@@ -0,0 +1,6 @@
{
"track_number": 3,
"title": "On the Run",
"duration": "3:35",
"artist": "Pink Floyd"
}

View File

@@ -0,0 +1,29 @@
{
"title": "Stranger Things",
"year": 2016,
"poster": "https://example.com/st-poster.jpg",
"description": "When a young boy disappears, his mother uncovers a mystery.",
"rating": 8.7,
"category": "TV",
"type": "TV",
"status": "Ongoing",
"runtime": 50,
"director": "The Duffer Brothers",
"writer": "The Duffer Brothers",
"releaseDate": "2016-07-15",
"genres": ["Sci-Fi", "Horror", "Drama"],
"tags": ["80s", "Supernatural", "Government Conspiracy"],
"studios": ["Netflix"],
"staff": [],
"episodes": [
{
"season": 1,
"episode_number": 1,
"title": "Chapter One: The Vanishing of Will Byers",
"description": "On his way home from a friend's house, young Will sees something terrifying.",
"air_date": "2016-07-15",
"duration": 47,
"thumbnail": "https://example.com/st-ep1.jpg"
}
]
}

View File

@@ -0,0 +1,30 @@
{
"success": true,
"data": {
"items": [
{
"id": 10,
"name": "Jane Doe",
"photo": "https://example.com/jane.jpg",
"bio": "Adult film actress",
"birthDate": "1995-05-15",
"birthPlace": "Los Angeles, California",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00",
"occupations": ["Actress"],
"bust_size": "34",
"cup_size": "D",
"waist_size": "24",
"hip_size": "34",
"height": "165",
"weight": "52",
"hair_color": "Blonde",
"eye_color": "Blue",
"ethnicity": "Caucasian"
}
],
"total": 25,
"page": 1,
"limit": 10
}
}

View File

@@ -0,0 +1,32 @@
{
"success": true,
"data": {
"id": 10,
"name": "Jane Doe",
"photo": "https://example.com/jane.jpg",
"bio": "Adult film actress",
"birthDate": "1995-05-15",
"birthPlace": "Los Angeles, California",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00",
"occupations": ["Actress"],
"filmography": [],
"adult_specifics": {
"id": 5,
"cast_id": 10,
"bust_size": "34",
"cup_size": "D",
"waist_size": "24",
"hip_size": "34",
"height": "165",
"weight": "52",
"hair_color": "Blonde",
"eye_color": "Blue",
"ethnicity": "Caucasian",
"tattoos": "None",
"piercings": "Ears",
"measurements": "34-24-34",
"shoe_size": "7"
}
}
}

View File

@@ -0,0 +1,20 @@
{
"success": true,
"data": {
"items": [
{
"id": 1,
"name": "Leonardo DiCaprio",
"photo": "https://example.com/leo.jpg",
"bio": "American actor and film producer",
"birthDate": "1974-11-11",
"birthPlace": "Los Angeles, California",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00"
}
],
"total": 5,
"page": 1,
"limit": 10
}
}

View File

@@ -0,0 +1,27 @@
{
"success": true,
"data": {
"items": [
{
"id": 1,
"title": "Inception",
"year": 2010,
"poster": "https://example.com/poster.jpg",
"category": "Movie",
"type": "Movie",
"role": "Actor",
"characterName": "Dom Cobb"
},
{
"id": 2,
"title": "The Revenant",
"year": 2015,
"poster": "https://example.com/revenant.jpg",
"category": "Movie",
"type": "Movie",
"role": "Actor",
"characterName": "Hugh Glass"
}
]
}
}

View File

@@ -0,0 +1,36 @@
{
"success": true,
"data": {
"id": 1,
"name": "Leonardo DiCaprio",
"photo": "https://example.com/leo.jpg",
"bio": "American actor and film producer",
"birthDate": "1974-11-11",
"birthPlace": "Los Angeles, California",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00",
"occupations": ["Actor", "Producer"],
"filmography": [
{
"id": 1,
"title": "Inception",
"year": 2010,
"poster": "https://example.com/poster.jpg",
"category": "Movie",
"type": "Movie",
"role": "Actor",
"characterName": "Dom Cobb"
},
{
"id": 2,
"title": "The Revenant",
"year": 2015,
"poster": "https://example.com/revenant.jpg",
"category": "Movie",
"type": "Movie",
"role": "Actor",
"characterName": "Hugh Glass"
}
]
}
}

View File

@@ -0,0 +1,29 @@
{
"success": true,
"data": {
"items": [
{
"id": 1,
"media_id": 2,
"season": 1,
"episode_number": 1,
"title": "Pilot",
"description": "Walter White is diagnosed with lung cancer.",
"air_date": "2008-01-20",
"duration": 49,
"thumbnail": "https://example.com/ep1.jpg"
},
{
"id": 2,
"media_id": 2,
"season": 1,
"episode_number": 2,
"title": "Cat's in the Bag...",
"description": "Walter and Jesse attempt to dispose of the body.",
"air_date": "2008-01-27",
"duration": 48,
"thumbnail": "https://example.com/ep2.jpg"
}
]
}
}

View File

@@ -0,0 +1,30 @@
{
"success": true,
"data": {
"items": [
{
"id": 1,
"title": "Inception",
"year": 2010,
"poster": "https://example.com/poster.jpg",
"banner": null,
"description": "A thief who steals corporate secrets through dream-sharing technology.",
"rating": 8.8,
"category": "Movie",
"type": "Movie",
"status": "Released",
"aspectRatio": "2.39:1",
"runtime": 148,
"director": "Christopher Nolan",
"writer": "Christopher Nolan",
"releaseDate": "2010-07-16",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00"
}
],
"total": 150,
"page": 1,
"limit": 10,
"totalPages": 15
}
}

View File

@@ -0,0 +1,39 @@
{
"success": true,
"data": {
"id": 1,
"title": "Inception",
"year": 2010,
"poster": "https://example.com/poster.jpg",
"banner": null,
"description": "A thief who steals corporate secrets through dream-sharing technology.",
"rating": 8.8,
"category": "Movie",
"type": "Movie",
"status": "Released",
"aspectRatio": "2.39:1",
"runtime": 148,
"director": "Christopher Nolan",
"writer": "Christopher Nolan",
"releaseDate": "2010-07-16",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 10:30:00",
"genres": ["Sci-Fi", "Action", "Thriller"],
"tags": ["Mind-bending", "Dream", "Heist"],
"studios": ["Warner Bros.", "Legendary Pictures"],
"staff": [
{
"id": 1,
"name": "Leonardo DiCaprio",
"photo": "https://example.com/leo.jpg",
"bio": "American actor and film producer",
"birthDate": "1974-11-11",
"birthPlace": "Los Angeles, California",
"role": "Actor",
"characterName": "Dom Cobb",
"characterImage": null,
"occupations": ["Actor", "Producer"]
}
]
}
}

View File

@@ -0,0 +1,23 @@
{
"success": true,
"data": {
"items": [
{
"id": 1,
"media_id": 3,
"track_number": 1,
"title": "Speak to Me",
"duration": "1:30",
"artist": "Pink Floyd"
},
{
"id": 2,
"media_id": 3,
"track_number": 2,
"title": "Breathe",
"duration": "2:43",
"artist": "Pink Floyd"
}
]
}
}

View File

@@ -0,0 +1,8 @@
{
"name": "Jane Smith (Updated)",
"bio": "Updated bio",
"adult_specifics": {
"hair_color": "Red",
"weight": "56"
}
}

View File

@@ -0,0 +1,4 @@
{
"name": "Tom Hardy (Updated)",
"bio": "Updated bio description"
}

View File

@@ -0,0 +1,4 @@
{
"title": "Updated Episode Title",
"description": "Updated description"
}

View File

@@ -0,0 +1,32 @@
{
"type": "Game",
"title": "1-2-Switch",
"playtime": 120,
"completionStatus": "Completed",
"favorite": true,
"communityScore": 55,
"userScore": 80,
"achievements": [
{
"name": "First Victory",
"description": "Win your first game",
"icon": "https://example.com/achievement-icon.png",
"unlocked": true,
"unlocked_date": "2026-04-09T18:00:00"
},
{
"name": "Master Player",
"description": "Win 100 games",
"icon": "https://example.com/master-icon.png",
"unlocked": true,
"unlocked_date": "2026-04-09T20:30:00"
},
{
"name": "Champion",
"description": "Win 1000 games",
"icon": "https://example.com/champion-icon.png",
"unlocked": false,
"unlocked_date": null
}
]
}

View File

@@ -0,0 +1,5 @@
{
"title": "The Matrix (Updated)",
"rating": 8.8,
"status": "Released"
}

View File

@@ -0,0 +1,4 @@
{
"title": "Updated Track Title",
"duration": "4:00"
}