Commits

Auto Magazine: From the Skeleton to the First Paginated Issue in a Single Day

Second day: skeleton deployed to magazine.escandell.cat, hotfolder ingestion, layer-based extraction, first layout prototype, and automatic pagination to a multiple of 4.

The second day of Auto Magazine has been the most intense so far: we went from having nothing at all to having the application running in production, with the incoming material, the Word documents converted into articles, and the first issue paginated like a real magazine.

The skeleton and the deployment

We started with phase 1: the application skeleton, reusing the Contenidos_PX_v4 pattern, as the spec stated. Authentication with scrypt, an initial setup that prompts the administrator only once, session middleware with CSRF, and the configuration saved in a SQLite table.

The AI providers panel was built from the same mold, with Anthropic and a local Ollama added to the catalog. Since the local team does not have Docker, the deployment went directly to the server, and the application now runs at magazine.escandell.cat with Nginx Proxy Manager in front. Three adjustments were needed, which we will remember for future deployments: the trusted hosts and HTTPS mode are now configured via .env, the container has the stable name auto-magazine and lives on the external edge network, which is where the proxy is located.

The material now arrives and is converted

The ingestion phase arrived immediately: the watcher monitors the hotfolder and synchronizes the database with its physical contents—if a subfolder appears, it is registered, and if it disappears, it is deleted. Uploading via drag&drop through the web creates exactly the same result as manually placing a subfolder there: a single intake path.

Each .docx is converted into tagged blocks in two layers: first, the Word styles, which require no API calls, and only when the document does not have a title through styles does the AI step in to tag it by index without altering the text. The day also produced three fixes prompted by testing in production:

  • The panel looked too cramped because of cached CSS. It is now served with the modification date in the URL, and every deployment automatically invalidates the cache.
  • The provider catalog added Groq and stopped returning an error 500 when Ollama Cloud responded with something that was not JSON.
  • The MiniMax models did not remain selected because parse_qs grouped all the select elements with the same name and the code only kept the first value.

The first paginated issue

By the end of the day, the layout prototype was ready: a synthetic issue zero of an automotive magazine with a full-bleed cover, an editorial, a live table of contents—where the page numbers are calculated automatically with target-counter—, two articles, and a back cover. The theme is defined in YAML as CSS variables, and the print capabilities are active: 3-millimeter bleed, crop marks, and sheets.

The reaction to the prototype led to an important decision: the user did not like the visual direction, and that is precisely why it was a prototype. The templates will be plain HTML and CSS, manually editable, with a single contract: receive the variables from the extraction process and place them wherever desired. Moving the prototype into the application was almost a matter of copying and pasting, and the «Lay out issue» button already starts the render in the background.

Finally, automatic pagination: the articles flow without forced breaks, and the total is adjusted to a multiple of 4 for the signature using the agreed cascade—the render is measured, the gap is calculated, and it is filled first with a colophon and then with blank pages. The first attempt calculated the filler before counting the advertisement pages, and the multiple test caught it immediately: nine pages do not fit into any fold.

Now comes the export phase to print, with CMYK and preflight.