Project updates from Template #1

Merged
javier merged 123 commits from project/update-from-template into main 2026-09-04 13:40:36 +00:00
123 Commits
Author SHA1 Message Date
javierandClaude Opus 5 c24846c058 Merged the template branch into main to pick up the 7 upstream changes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 15:17:26 +02:00
javier b2bfb734c6 Documented the alternate locales of the Social Card in the Infrastructure package. 2026-09-04 15:13:29 +02:00
javier 779bdd542a Updated the READMEs to cover site languages and event tagging. 2026-09-04 15:01:21 +02:00
javier a71edd37ab Updated the event tagging for the AnalyticsEvent+Tagging extension in the Infrastructure package to support attribute-capable tags. 2026-09-04 14:57:29 +02:00
javier a9a62e10df Added the site languages to the Structured Data in the Infrastructure package. 2026-09-04 14:43:06 +02:00
javier 0b3ef2890e Updated the Localized HTML Collection response in the Infrastructure package to make Vary: Accept-Language opt-in for localized responses. 2026-09-04 14:39:43 +02:00
javier f0086ee461 Added the alternate locales to the Social Card in the Infrastructure package. 2026-09-04 14:36:22 +02:00
javier c8100fd93c Pinned git to HTTP/1.1 for the Dockerfile in the Website service target to keep the packages on a transport Github handles correctly. 2026-09-04 14:32:48 +02:00
javier 277045c1a1 Set the canonical site origin in the Website library target.
The template's new `site.origin` key arrived empty, as bootstrap fills it in.
Pointing it at the origin robots.txt and sitemap.xml already carry turns on the
canonical and hreflang links, and the HTTPS redirect the production compose
already trusts the forwarded proto for.
2026-08-30 23:01:48 +02:00
javier 85e1047a9c Merged the template branch into main to pick up the 33 upstream changes.
Reconciled the bootstrap-customised files: kept the CCN naming, canonical
origin, database slug and analytics comments, dropped the template-only
Makefile, README.md and Scripts/bootstrap that bootstrap removes, and took
the template's ordering for the security headers in the production compose.
2026-08-30 22:57:45 +02:00
javier daf764f10f Fixed the sitemap for the Website service target. 2026-08-30 22:01:47 +02:00
javier a3d9655766 Added language support to the Website service target. 2026-08-30 21:47:08 +02:00
javier 9b16ce3339 Updated the Negotiate method in the Localization package to add explicit language requests. 2026-08-30 19:05:52 +02:00
javier 79cfb42fbb Updated the LocalizationMiddleware middleware in the Infrastructure package to read explicit language requests. 2026-08-30 19:03:52 +02:00
javier 6c75d5e743 Improved the bootstrap script to write the canonical site origin and also, fixed some nasty bugs. 2026-08-30 09:53:39 +02:00
javier a3d0bc75fd Implemented the validation for the name and slug inputs in the bootstrap script. 2026-08-30 09:39:28 +02:00
javier 1cae261dff Improved the .dockerignore definitions in the Website service target. 2026-08-30 09:22:10 +02:00
javier 8bf6e86ffb Implemented the "tagging()" method for the the AnalyticsEvent+Tagging extension in the Infrastructure package. 2026-08-30 09:15:59 +02:00
javier cf58b97de1 Updated the ConfigReader+Properties extension in the Website service target to fail to the boot in case of unknown database tokens. 2026-08-30 09:03:50 +02:00
javier 5a833be33d Updated the documentations in the Website service target. 2026-08-30 08:37:19 +02:00
javier 8a9402e8f1 Improved the documentation of the README file in the Utility package. 2026-08-30 08:35:44 +02:00
javier c1ca6609e4 Improved the documentation of the README file in the Persistence package. 2026-08-30 08:35:35 +02:00
javier d40f988877 Improved the documentation of the README file in the Localization package. 2026-08-30 08:35:21 +02:00
javier 4ee1abbd67 Improved the documentation of the README file in the Infrastructure package. 2026-08-30 08:35:06 +02:00
javier 3358946e3d Added the ImageWidth enumeration to the Website library target. 2026-08-25 17:23:29 +02:00
javier c09ac657ab Added font preload links to the Page+Defaults extension in the Website library target. 2026-08-25 17:05:08 +02:00
javier 7aee1cd949 Added immutable caching to the fingerprinted media types for the ConfigReader+Properties extension in the Website service target. 2026-08-25 16:59:07 +02:00
javier 988090a511 Added a configurable site origin to the ConfigReader+Properties extension in the Website library target. 2026-08-25 16:24:03 +02:00
javier 5b2da4eb16 Added the MP4 and WOFF2 cases to the AssetExtension enumeration. 2026-08-25 16:06:05 +02:00
javier 1033cab2af Added an optional founder reference to the Organization node in the Infrastructure package. 2026-08-24 22:37:45 +02:00
javier 74e81e1517 Refactored the StaticFile enumeration in the Website library target into a structure. 2026-08-24 22:37:13 +02:00
javier d8cf1abf6a Changed the default Open Graph locale in the Website library target from en_US to en_NL. 2026-08-24 22:33:13 +02:00
javier eb0a2127f6 Reworded the documentation of the organization identifier helper in the Infrastructure package target. 2026-08-24 22:31:44 +02:00
javier 0ee8368e1a Added the organization identifier helper to the StructuredData type in the Infrastructure package target. 2026-08-24 22:29:00 +02:00
javier ecafb14608 Reworded the README documentation in the Infrastructure package target. 2026-08-24 17:49:06 +02:00
javier c64c8b726d Added the email property to the organization structured data in the Infrastructure package target. 2026-08-24 17:48:31 +02:00
javier fec52b7942 Added the noindex robots tag to the responses on the Health controller in the Website library target. 2026-08-24 17:47:57 +02:00
javier 88bcae9dc9 Added the WebP case to the Asset extensions in the Infrastructure package. 2026-08-24 17:44:43 +02:00
javier c0f56a4897 Wired the trailing-slash redirect into the App router in the Website service target. 2026-08-24 17:37:46 +02:00
javier 5996a78ff3 Documented and enabled the HTTPS redirect in the Website service. 2026-08-24 17:37:33 +02:00
javier f6a77305ac Trailing slash middleware for the Infrastructure package (#53) 2026-08-24 17:33:52 +02:00
javier 1520c44b16 HTTPS redirect middleware for the Infrastructure package (#52) 2026-08-24 17:32:02 +02:00
javier fcfb3f21d5 Added the organization descriptors and a number value to the structured data types in the Infrastructure package. 2026-08-23 10:13:37 +02:00
javier 6c014525bf Updated the analytics origin documentation for the Website service target. 2026-08-20 01:14:49 +02:00
javier 6ecc20987f Updated the README file in the repository root. 2026-08-20 01:10:37 +02:00
javier b6ad9ff497 Fixed the analytics and security headers for the Website service target. 2026-08-20 00:55:09 +02:00
javier 5422c8466d Merge branch 'setup' into template 2026-08-16 09:09:55 +02:00
javier 091c0f0686 Added an optional per-asset folder to the Asset protocol and the AssetExtension extension in the Infrastructure package. 2026-08-15 23:44:06 +02:00
javier 459002544b Merge branch 'setup' into template 2026-08-15 11:39:26 +02:00
javier 7d53be539e Bundled the static files into the App test target. 2026-08-15 11:32:56 +02:00
javier 844a85f88c Added the Event type to the Analytics type in the Infrastructure package. 2026-08-15 11:31:59 +02:00
javier a5305c6044 Improved the Docker image and build context for the Website service target. 2026-08-13 15:57:11 +02:00
javier c075adad84 Hardened the Docker build of the Website service target. 2026-08-13 03:19:10 +02:00
javier 2206d71997 Turned the analytics tracker off by default in the template. 2026-08-13 02:57:47 +02:00
javier b68eac4375 Merge branch 'setup' into template 2026-08-13 02:37:43 +02:00
javier 397ad6b896 Added the "analytics.recorder" flag to the Website service. 2026-08-13 01:29:44 +02:00
javier 4bb3e9098c Added the session recorder script to the Page protocol in the Infrastructure package. 2026-08-13 01:19:19 +02:00
javier 3bcae4d789 Added the "recorder" flag to the Analytics type in the Infrastructure package. 2026-08-13 01:19:12 +02:00
javier 964e7fa707 Update the documentation of the README files in the packages and in the Website service target. 2026-08-13 00:55:34 +02:00
javier 70c0cc5303 Added a connection pool timeout to the Configuration type in the Persistence package. 2026-08-13 00:14:51 +02:00
javier d7465d03cc Updated the Probe method in the Persistence package with a query deadline. 2026-08-13 00:11:59 +02:00
javier 8303598244 Documented the database connection pooling in the Website service. 2026-08-11 01:35:43 +02:00
javier 19fa9d8d8c Hardened the database configuration in the Website service target. 2026-08-10 23:42:22 +02:00
javier a88569ad4c Improved the verbosity of the documentation for the README file in the packages. 2026-08-10 16:35:13 +02:00
javier 98cfbdd105 Updated the "db-reset" task in the Makefile in the Website service to actually delete the local data. 2026-08-10 16:25:05 +02:00
javier 0796aa314e Moved the PostgreSQL TLS context building to the Service initialiser in the Persistence package. 2026-08-05 01:36:19 +02:00
javier e51f09c66f Added PostgresNIO and NIOSSL to the Persistence library target. 2026-08-05 01:30:59 +02:00
javier 52f092a4d7 Refactored the startup reply in the fake PostgreSQL server in the Persistence tests target. 2026-08-05 01:30:52 +02:00
javier f8a263168e Updated the documentation for the Website service target to name/reference PostgreSQL instead. 2026-08-05 01:30:32 +02:00
javier 6156cf5b0d Migrated the Website service tooling to use PostgreSQL instead. 2026-08-05 01:26:54 +02:00
javier 9b4a780ea3 Migrated the Website service and library targets to use Persistence package with PostgreSQL instead. 2026-08-05 01:26:26 +02:00
javier 3d27a27cb1 Migrated the documentations and test cases in the Persistence package to use/name PostgreSQL instead. 2026-08-04 17:46:04 +02:00
javier 8ca31e415c Migrated the fake plaintext server in the Persistence tests target to use PostgreSQL instead. 2026-08-04 17:44:12 +02:00
javier 1fe7ef2049 Migrated the Service method in the Persistence package to use PostgreSQL instead. 2026-08-04 17:44:02 +02:00
javier d7d2709f88 Migrated the Driver and TLS enumerations in the Persistence package to use PostgreSQL instead. 2026-08-04 17:43:44 +02:00
javier 02ab9671b1 Swapped the MySQL package dependencies for PostgreSQL in Persistence package. 2026-08-04 17:43:34 +02:00
javier 3463556c13 Updated the documentation of the README file in the Infrastructure package. 2026-08-04 12:19:27 +02:00
javier 16acdf0f3d Implemented the analytics preconnect hint on the Page protocol in the Infrastructure package. 2026-08-04 12:19:20 +02:00
javier c603421c28 Implemented the scripts' deferral on the Page protocol in the Infrastructure package. 2026-08-04 12:19:12 +02:00
javier 5c070c2b1a Integrated Analytics into the Infrastructure package (#40)
This PR contains the work done to define the `Analytics` type into the _Infrastructure_ package and also, to integrate this type into its `Page` protocol.

Reviewed-on: rock-n-code/loud-amsterdam#40
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-04 11:23:25 +02:00
javier fd5aa84924 Improved the PNG assets optimization on the Dockerfile in the Website service target to do it recursively. 2026-08-02 03:06:17 +02:00
javier a4db1fe29c Updated the documentation for the README file of the template. 2026-08-02 03:04:50 +02:00
javier d10ced84a8 Fixed an issue in the bootstrap script when project name left as placeholder. 2026-08-02 02:59:53 +02:00
javier 422560ec10 Prompt the canonical site URL during bootstrap script to rewrite website crawlers. 2026-08-02 02:57:43 +02:00
javier a5ee02bb0b Improved the PNG assets optimization on the Dockerfile in the Website service target to do it recursively. 2026-08-02 02:41:46 +02:00
javier 59ce633499 Merge branch 'setup' 2026-08-02 02:34:42 +02:00
javier 64d2d5943a Updated the documentation of the README file in the Website service target. 2026-08-02 00:58:11 +02:00
javier a056f7f69a Renamed the "error" static assets at the Resources folder in the Website service target as "not-found". 2026-08-01 23:07:04 +02:00
javier 2c571233bc Renamed the Error page in the Website library target as NotFound. 2026-08-01 23:06:22 +02:00
javier b680ae0689 Structured Data support for the Page protocol in the Infrastructure package (#32)
This PR contains the work done to introduce a `StructuredData` type that pages use to describe themselves to search engines as schema.org JSON-LD, and wires it into the Page protocol so the payload renders automatically in the document head.

Reviewed-on: rock-n-code/loud-amsterdam#32
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-01 17:21:16 +00:00
javier 1d1f0a9dc9 Utility package docker fix in the Website service target (#31)
This PR contains the work done to included the Utility package into the Docker deployment process in the Website service target.

Reviewed-on: rock-n-code/loud-amsterdam#31
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-01 11:53:36 +00:00
javier 5c9fde9d41 Social Card tweaks in the Infrastructure package. (#30)
This PR contains the work done to address certain tweaks in the newly-introduced _Social Card_ types in the **Infrastructure** package.

Reviewed-on: rock-n-code/loud-amsterdam#30
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-01 11:25:36 +00:00
javier 5f4316b85b Added the Utility package (#29)
This PR contains the work done to create the new **Utility** package within the project, and also included in it the `NormalizeEmail` method, as it's not something that belongs to the **Infrastructure** package.

Reviewed-on: rock-n-code/loud-amsterdam#29
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-01 11:15:27 +00:00
javier efc933d5d0 Extra tags and Social Card integration in the Infrastructure package (#28)
This PR contains the work done to extends the `Page` protocol with the head tags that control search snippets and link previews: a meta description, a canonical URL, and a social card rendered as _Open Graph_ and _Twitter_ meta tags. All three are optional with nil defaults, so existing conformers compile and render unchanged.

Reviewed-on: rock-n-code/loud-amsterdam#28
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
2026-08-01 10:57:29 +00:00
javier ea00b94841 Tweaks and fixes throughout the project (#27)
This PR contains the work done to do a little bit of housekeeping pass across all packages and the Website service.

To provide further details about the work:
* Refreshed the READMEs and source documentation to match the current code;
* Tagged every test case consistently across the Infrastructure, Localization, Persistence, and Website test targets;
* Removed Website middleware tests now covered by Infrastructure's own suite;
* Conformed the `PrepareDB` method to Sendable;
* Relaxes the production Compose DATABASE_TLS default from require to prefer;
* Added Persistence test verifying the prefer posture falls back to plaintext connections.

Reviewed-on: rock-n-code/loud-amsterdam#27
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-30 06:33:57 +00:00
javier 0887135328 Fixes for the Localization package (#26)
This PR contains the work done to

Reviewed-on: rock-n-code/loud-amsterdam#26
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-28 23:37:33 +00:00
javier cdded06ba3 Renamed the Web package as Infrastructure (#25)
This PR contains the work done to rename the _Web_ package as _Infrastructure_, to provide a clear naming and purpose to this particular package within the project.

To provide further details about the work:

* Infrastructure
  * Asset fingerprinting: an FNV-1a token derived from the static files directory, appended as ?v= to asset URLs so deploys bust caches; pre-rendered pages also revalidate via weak ETags.
  * New middlewares: fixed-window RateLimitMiddleware (per-client budgets keyed by trusted X-Forwarded-For or remote address) and VaryMiddleware (Accept-Encoding on every response); SecurityHeadersMiddleware now also stamps error responses.
  * Auto-generated HEAD endpoints, cache max-age configuration, and Docker build/Compose refinements.
  * Protocols and scaffolding: Asset/AssetExtension, the Page protocol (viewport, stylesheets, scripts, versioned URLs), and LocalizedRequestContext.
  * Rate limiter's counter store swapped from an actor to a Mutex (no executor hop per request) with amortized batch eviction instead of O(n²) scans under client floods.
  * FingerprintAssets reports unreadable files to a logger instead of silently producing a token that never busts their cache.

Reviewed-on: rock-n-code/loud-amsterdam#25
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-23 01:04:37 +00:00
javier a868275347 Renamed the Web package as Infrastructure (#24)
Reviewed-on: rock-n-code/loud-amsterdam#24
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-22 21:26:55 +00:00
javier 242cb92bc5 Few small fixes for the Website service (#23)
This PR contains the work done to address small fixes.

To provide further details:

* HTML template
  * Removed the duplicate charset <meta> tag from the Page protocol's head property.

* Router
  * Enabled auto-generated HEAD endpoints so every GET route gets a HEAD sibling. Uptime monitors and crawlers probing with HEAD now receive the page's status and headers instead of a 404.

* Docker
  * Pinned the asset optimizer versionsvia build args so minified output is reproducible for a given Dockerfile commit.
  * Narrowed the build context copied into the release stage, only package manifests and Swift sources are copied. Static assets come from the separate assets stage after the binary is built.
  * svgo now minifies all SVGs recursively rather than just icon.svg, and the staging step creates Resources/Static explicitly instead of conditionally moving the unminified sources.
  * Added curl to the runtime image (needed for the container healthcheck) and .claude to .dockerignore.

* Docker-compose
  * Added a `healthcheck` to the website service hitting GET /health (liveness only), so Compose reports process health without coupling container health to database reachability.

Reviewed-on: rock-n-code/loud-amsterdam#23
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 18:23:46 +00:00
javier d0058dc636 Shared HTML template for the Website service (#22)
This PR contains the work done to define a `Page` protocol that extracts the HTML scaffolding that `IndexPage` and `ErrorPage` pages duplicated, so every page of the website declares only what makes it unique — its content, title, and assets — while the document structure lives in one place. Also cleans up imports across the workspace.

Reviewed-on: rock-n-code/loud-amsterdam#22
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 08:56:35 +00:00
javier 6bdc127057 Improvements to Icons for the Website service (#21)
Reviewed-on: rock-n-code/loud-amsterdam#21
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 03:35:50 +00:00
javier 698cd60521 Static asset magnification for the Website service (#20)
This PR contains the work done for build-time optimization of the static assets served by the Website service. The production Docker image now ships minified JS/CSS and losslessly recompressed images, while the sources in the repository stay readable and un-minified.

Reviewed-on: rock-n-code/loud-amsterdam#20
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 03:02:17 +00:00
javier 79ecf311f4 Local environment configuration support for the Website service (#19)
This PR contains the work done to amend the `.env.local` handling for the Website service, plus other small fixes.

Reviewed-on: rock-n-code/loud-amsterdam#19
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 02:28:05 +00:00
javier daf275b121 Improved the static assets definitions in the Website service (#18)
This PR contains the work done to overhaul the static asset definitions for the Website service.

To provide further details about the work:

* Website library
  * Overhauled the `StateFile` enumeration to reduce the number of cases to one case per logical file name, each exposing a `fileExtensions` list.
  * Wired everything into the pages with a consistent ordering convention: stylesheets load shared-first so the page sheet wins the CSS cascade; scripts load page-first with shared.js last. The error page also gained the shared stylesheet and its scripts; the index page gained its page CSS/JS and the new touch icon link.
  * Used the `StaticFile` enumeration as a single source of truth for every _href_/_src_ in the `IndexPage` and the `ErrorPage` pages, eliminating hardcoded asset paths.

* Website service
  * Added new assets to the Resources folder:
    * `apple-touch-icon.png`
    * `css/index.css`
    * `js/index.js`
    * `js/error.js`
    * `sitemap.xml`
  * Renamed existing assets within the Resources folder:
    * `css/style.css` → `css/shared.css`
    * `js/app.js` → `js/shared.js`
  * Fixed the working-directory location for the scheme in the Xcode project.

Reviewed-on: rock-n-code/loud-amsterdam#18
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 02:08:59 +00:00
javier a045a23519 Web support for the Website service (#17)
This PR contains the work done to introduce a new Web Swift package that provides a reusable, declarative way to register route controllers on a Hummingbird router, then adopt it in the Website service.

To provide further details about the work:

* Web package
  * The `RouterController` protocol — a Sendable protocol to group controllers behind one `routes` property.
  * The `RouteCollectionBuilder`  — a result builder that collects controllers' route collections into a stack, with full support for optionals, conditionals, and arrays.
  * The `addController(_:)` method — a `RouterMethods` extension letting controllers be listed declaratively and adding each one's routes at the router root.

* Website service
  * Added Web as a dependency of the _WebsiteLibrary_ target.
  * Conformed the `RootController` and `HealthController`controllers to the `RouterController` protocol.
  * Updated the `App+Build` extension to to use the cleaner `router.addController { … }` instead.

Reviewed-on: rock-n-code/loud-amsterdam#17
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 00:47:49 +00:00
javier 4a8413359f Converted the website service project into a reusable template. 2026-07-11 16:20:33 +02:00
javier a4906f8f26 Fixed container paths for the Packages test targets in the Website test plan. (#16)
Reviewed-on: rock-n-code/loud-amsterdam#16
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-11 10:43:27 +00:00
javier 4c57e15991 Fixed test case for the Persistence package. (#15)
This PR contains the work done to amend a test case within the Persistence tests target that was failing.

Reviewed-on: rock-n-code/loud-amsterdam#15
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-11 10:34:59 +00:00
javier a0f5c79434 Renamed the WebsiteCore target in the Website service package as WebsiteLibrary. (#14)
This PR contains the work done to rename the _Website_ service's library SwiftPM target from `WebsiteCore` to `WebsiteLibrary`, updating every reference across the manifest, source, tests, Xcode schemes, and documentations.

Reviewed-on: rock-n-code/loud-amsterdam#14
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-11 09:41:21 +00:00
javier dc6b22e648 Database setup for the Website service (#13)
This PR contains the work done to introduce a _Fluent_-based persistence layer for the Website service, selectable at runtime alongside the existing in-memory default, plus the local dev tooling and docs to support it.

To provide further details about the work:

* Persistence package
  * The `Driver` and `TLS` enumerations
  * The `Configuration` type
  * The `Service` factory that builds the  service
  * `PrepareDB` for migrations registration
  * The `Probe` for readiness checks.

* App integration
  *  Builds the driver, registers migrations, and attaches `Fluent` to the service lifecycle so it starts/stops with the HTTP server.
  * Migrate-on-boot is gated to the in-memory backend; MySQL/MariaDB is migrated out of band via --database-migrate so shared databases never race on startup.
  * The `ConfigReader+Properties` extension maps database.* config keys onto the driver.

* Library
  * Added database configuration constants.
  * The `HealthController` controller gains a readiness probe: `GET /health/ready` checks whether the database is reachable, separate from the existing liveness check.

* Others
  * Updated the `docker-compose` files to support a database service behind a database profile, and hardened for local development
  * New database targets on the `Makefile` file and overall documentation updated
  * Updated the `.env.local`, `Dockerfile`, and `README` files to document the persistence workflow, config keys, and local DB commands

Reviewed-on: rock-n-code/loud-amsterdam#13
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-11 09:15:58 +00:00
javier 9774454bba Website service Makefile and Localization package fixes (#12)
This PR contains the work done to get the Website service building and running correctly in its Linux container. The service depends on the local _Localization_ package, whose String-Catalog localization was Darwin-only and broke the Docker build. Thus the localization internals have been reworked to be platform-agnostic and fixes the container build context so the local package is actually available during the build.

* Localization package
  * Replaced the Darwin-only `String.LocalizationValue` / `String(localized:)` path with a StringCatalog type that reads raw JSON from a given `.xcstrings` file, so lookups resolve identically on macOS and Linux.
  * The `LanguageList` now derives available languages from the catalog instead of `Bundle.localizations`
  * The `Negotiate` does explicit _Accept-Language_ matching (exact tag, then primary subtag) instead of the Linux-broken `Bundle.preferredLocalizations`.
  * Switched the catalog resource rule from `.process` to `.copy` (in both Localization and Website manifests) so the raw `.xcstrings` ships verbatim on every platform.
  * Introduced a `CatalogResolving` protocol as a seam between the localizers and the storage backend, enabling test injection and a future native-Apple backend without changing callers.

* Website Docker build
  * Build context moved to the repository root so the relative-path `Localization` package is inside the context; `Dockerfile`, `docker-compose.override.yml`, and the _img-release_ make target updated to the new context/paths.
  *  Added a root `.dockerignore` to keep the context lean.

Reviewed-on: rock-n-code/loud-amsterdam#12
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-09 23:00:55 +00:00
javier b6f9633420 Adjustments to the Localization package dependency (#11)
This PR contains the work done to refactor the _Localization_ package and tidy the project a little bit.

To provider further details about the work:

* The `Negotiate` function was moved to the _Localization_ package.
* The `WebsiteRequestContext` context no longer resolves a default language at creation; it starts empty and relies on the `LocalizationMiddleware` middleware to fill it in.
* Fixed the local dependency path to Packages/Localization for the **Website** package as it only resolved inside the Xcode workspace before, breaking swift build, the Makefile, and the Docker build).
* Updated the `README` file to document language negotiation, the GET /health route, and the full middleware chain; doc comments across the moved/renamed types were brought back in sync with the code.

Reviewed-on: rock-n-code/loud-amsterdam#11
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-03 03:48:25 +00:00
javier 6c66ea74cc Localization support for the Website service (#10)
This PR contains the work done to introduce server-side localization support to the **Website** service so the landing and error pages are served in the visitor's negotiated language, backed by a new reusable Localization package.

To provide further details about the work:

* Created the _Localization_ package — a bundle-bound `Localize` method and a `LanguageList` type.
* Language negotiation — `NegotiateLanguage` method picks the best supported language from the request's _Accept-Language_ header (falling back to the default); the `LocalizationMiddleware` middleware resolves it per request and stores it on a new `LocalizedRequestContext` / `WebsiteRequestContext` context.
* Localized responses — `LocalizedHTMLCollectionResponse` pre-renders each page once per language and caches the bytes (with `Content-Language` + `Vary: Accept-Language`), reused by the  `RootController` controller and `NotFoundMiddleware` middleware.
* The `CachedHTMLResponse` response gained custom-header support.
* Localized pages — the `IndexPage` and `ErrorPage` pages now resolve their strings via `Localize` method;
* Added `Localizable.xcstrings` catalogs.
* Wired the `LocalizationMiddleware` middlewaer into the router.

Reviewed-on: rock-n-code/loud-amsterdam#10
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-29 23:08:36 +00:00
javier 847058d642 Optimizations for the Website service (#9)
This PR contains the work done to provide optimizations to the current service, such as a health-check endpoint, pre-renders static HTML pages, and hardens the error page's CSP.

To provide further details about the work:

* Added the `HealthController` controller serving GET `/health` with a static JSON payload.
* Added the `CachedHTMLResponse` response, which renders a static HTMLDocument to bytes once and reuses them per request (no Content-Length, so responses stay compressible).
* Integrated the response into the `RootController` and the  `NotFoundMiddleware` middleware to avoid re-rendering on hot paths.
* Added a `RouterMethods.addRoutes(_:)` extension and switched the router in App+build to use it.
* Moved the inline style from the `ErrorPage` page into a dedicated style file so the CSP needs no inline-style escape hatch.
* Fixed the `IndexPage` page path inconsistencies.
* Written the `README` file.

Reviewed-on: rock-n-code/loud-amsterdam#9
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-28 14:18:04 +00:00
javier 6b6389cb0f Security header setup for the Website service (#8)
This PR contains the work done to add a `SecurityHeadersMiddleware` middleware that stamps hardened security-related HTTP headers onto every response.

To provide further details about the work:

* Implemented the `SecurityHeadersMiddleware` middleware, which precomputes headers once from a `Configuration` object and applies them to every response:
  * _Content-Security-Policy_,
  * _X-Content-Type-Options_,
  * _X-Frame-Options_,
  * _Referrer-Policy_,
  * _Permissions-Policy_,
  * _Strict-Transport-Security_ (optional).
* Integrated this middleware into the router (near the top of the chain), reading each value from configuration with hardened defaults.
* The _Strict-Transport-Security_ has no default value — omitted unless explicitly set, so it stays off in plain-HTTP during development and on only behind TLS.
* Added security-header constants keys and values.

Reviewed-on: rock-n-code/loud-amsterdam#8
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-28 11:35:54 +00:00
javier 7c18cd9ec0 Response compression for the Website service (#7)
This PR contains the work done to add response compression to the Website service by registering the `ResponseCompressionMiddleware` middleware so responses are compressed when the client advertises support and the body exceeds a minimum size.

To provide further details about the work done:

* Added the **HummingbirdCompression** package dependency.
* Integrated the `ResponseCompressionMiddleware` middleware into the router, ahead of the not-found and static file middleware.
* Made the `minimum-response-size-to-compress` threshold configurable, with a default.

Reviewed-on: rock-n-code/loud-amsterdam#7
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-28 06:15:05 +00:00
javier 6c1a0f713b Static file caching for the Website service (#6)
This PR contains the work done to add cache-control headers to static file responses by configuring the `FileMiddleware` middleware to tag served static files with *Cache-Control* directives, tuned per media type.

To provide further details about the work done:

* Added a cache control that sets per-type policies: text assets (CSS/JS) get public, max-age, must-revalidate; images get public, max-age; everything else gets a default public, max-age.
* Files stay validated via `ETag/Last-Modified` header.
* Made the max-age values configurable, with defaults, via new cache constants.

Reviewed-on: rock-n-code/loud-amsterdam#6
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-28 05:49:32 +00:00
javier a621ada0bf HTML rendering support for the Website service (#5)
This PR contains the work done to replace the use of static _HTML_ files with type-safe HTML rendered server-side via **Elementary** through **Hummingbird**.

To provide further details about the work done:

* Added the **Elementary** dependencies.
* Added the `IndexPage` and `ErrorPage` pages, ported from the old HTML boilerplate; removed the static files.
* Added the `RootController` controller serving GET / using the `IndexPage` page, wired into the router.
* Reworked the `NotFoundMiddleware` middleare to render `ErrorPage` page directly; non-notFound errors still propagate.
* the `FileMiddleware` middleware no longer searches for any static `index.html` file.
* Simplified the `StaticFile` enumeration, dropped unused constants and now-unnecessary throws.

Reviewed-on: rock-n-code/loud-amsterdam#5
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-28 05:07:19 +00:00
javier f5f14eb97c File not found middleware for the Website service (#4)
This PR contains the work done to add a `NotFoundMiddleware` middleware to the Website service so requests matching neither a route nor a static file return a custom 404.html page with a 404 Not Found status. Also enables index.html fallback so the landing page is served at the site root.

To provider further details about the work done:
* NotFoundMiddleware — intercepts the `.notFound` error from the  `FileMiddleware` middleware and serves the preloaded error page with the correct content type; all other errors propagate. Falls back to a minimal body if the file is missing.
* Router — wires the `NotFoundMiddleware` middleware ahead of the `FileMiddleware` and enables searchForIndexHtml.
* Package — adds the **Hummingbird** product to the Library target.
* Tooling — sets a custom working directory in the Xcode scheme; removes the unused `pkg-deps` target from the `Makefile` file.

Reviewed-on: rock-n-code/loud-amsterdam#4
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-27 12:16:50 +00:00
javier 7542bc595f Static file serving support for the Website service (#3)
This PR contains the work done to support the static files serving for the **Website** service, and also included the essential boilerplate assets from the **HTML5 boilerplate** project.

To provide further details about the work done:

* Serving: Added the `FileMiddleware` middlewqare to the router; `path`, `server name`, and `log level` now read from config with defaults.
* Library: Added the `StaticFile` enumeration with a `contentType` property, plus typed config-key/value constants and the `Configuration` dependency on WebsiteCore.
* Assets: Added the **HTML5 boilerplate** (HTML, CSS, JS, icons, manifest, robots) to the *Resources/Static* folder.
* Docker: Stage the Resources directory as read-only.
* Tests: Added a test plan, and a shared Xcode scheme.

Reviewed-on: rock-n-code/loud-amsterdam#3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-27 10:59:32 +00:00
javier 08b210e7c6 Website service target setup (#2)
This PR contains the work done to add and setup the *Website* service target, a **Hummingbird** server app, into the Xcode project as a SwiftPM package with full support for containerization and driven by a `Makefile` file.

To provide further details about the work done:

* Swift package — SwiftPM manifest with a Website executable, related library, and test targets; depends on **hummingbird** and **swift-configuration**.
* Containerization — Multi-stage `Dockerfile` producing a static-linked release build with jemalloc, running as a non-root user on port 8080. Production and local-dev `docker-compose` files included.
* Configuration — `.env.local` template (with `.env` git-ignored) and `.dockerignore`/`.gitignore` entries.
* Makefile — Self-documenting operational commands:
  * pkg — SwiftPM: _build, release, test, clean, reset, deps, outdated, update_
  * img — Docker lifecycle: _build, mount, unmount, release_

Notes

* New service only — no changes to existing code; nothing else in the repo is affected.
* App logic is currently scaffolding; this PR establishes the service structure, build, and deployment tooling.

Reviewed-on: rock-n-code/loud-amsterdam#2
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-27 02:26:33 +00:00
javier a15271772e Xcode project setup (#1)
This PR contains the work done to setup the *Xcode* project, with its `.gitignore` and `.swift-format` files.

Reviewed-on: rock-n-code/loud-amsterdam#1
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-06-26 21:08:28 +00:00
javier e3e278dacb Initial Commit 2026-06-26 15:44:05 +02:00