The 2018 stack (Angular 5.2 / CLI 1.7, PHP, MySQL) had not been touched since
July 2018. Rebuilt rather than upgraded in place: the frontend was 17 major
versions behind, and of ~16,700 lines of PHP only ~150 were application logic —
the rest was four near-identical vendored copies of php-crud-api plus
class.upload.php.
Backend — ASP.NET Core 10, EF Core, SQLite
* ASP.NET Core Identity (PBKDF2) + JWT bearer auth
* Clean REST API replacing php-crud-api's filter[]/transform query syntax
* Box art uploads re-encoded to WebP via SkiaSharp
* Imports the 105 games recovered from the 2018 dump on first run
Frontend — Angular 22, zoneless, signals, Material 22
* Standalone components, lazy routes, functional guards and interceptor
* Vitest replaces Karma/Jasmine; fonts and icons bundled, no CDN calls
* No provideAnimations: @angular/animations is deprecated in v22 and
Material no longer depends on it (pinned by a test)
Docker
* Multi-stage builds for both services, non-root at runtime
* nginx serves the SPA and reverse-proxies the API, so everything is
same-origin; one volume holds the database, uploads and DP keys
Security issues in the old code, not carried across:
* Two endpoints exposed unauthenticated CRUD over every table
* The client chose whose rows to read (filter[]=userId,eq,N); ownership now
comes from the JWT subject server-side
* Login was hardcoded to a single username
* crypt() with one global salt, silently truncating passwords to 8 chars
* JWT secret was the literal string "testing", tokens never expired
* Token travelled in the query string rather than a header
* Uploads were anonymous with the path built from the client filename
* Access-Control-Allow-Origin: *
The live MySQL password committed in 2018 remains in git history and must be
rotated independently of this change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
43 lines
1.1 KiB
JSON
43 lines
1.1 KiB
JSON
{
|
|
"name": "ludos-web",
|
|
"version": "0.0.0",
|
|
"scripts": {
|
|
"ng": "ng",
|
|
"start": "ng serve",
|
|
"build": "ng build",
|
|
"watch": "ng build --watch --configuration development",
|
|
"test": "ng test",
|
|
"build:prod": "ng build --configuration production",
|
|
"lint": "ng lint",
|
|
"format": "prettier --write \"src/**/*.{ts,html,scss}\""
|
|
},
|
|
"private": true,
|
|
"packageManager": "npm@11.16.0",
|
|
"dependencies": {
|
|
"@angular/cdk": "^22.1.0",
|
|
"@angular/common": "^22.1.0",
|
|
"@angular/compiler": "^22.1.0",
|
|
"@angular/core": "^22.1.0",
|
|
"@angular/forms": "^22.1.0",
|
|
"@angular/material": "^22.1.0",
|
|
"@angular/platform-browser": "^22.1.0",
|
|
"@angular/router": "^22.1.0",
|
|
"@fontsource/roboto": "^5.3.0",
|
|
"material-icons": "^1.13.14",
|
|
"rxjs": "~7.8.0",
|
|
"tslib": "^2.3.0"
|
|
},
|
|
"devDependencies": {
|
|
"@angular/build": "^22.1.2",
|
|
"@angular/cli": "^22.1.2",
|
|
"@angular/compiler-cli": "^22.1.0",
|
|
"jsdom": "^28.0.0",
|
|
"prettier": "^3.8.1",
|
|
"typescript": "~6.0.2",
|
|
"vitest": "^4.0.8"
|
|
},
|
|
"engines": {
|
|
"node": ">=24 <25"
|
|
}
|
|
}
|