← All activity records

FACTUAL ACTIVITY RECORD · An activity record based on work that took place

Moving the Public Web to the standard create-next-app structure

Aligning root App Router, localized URLs, Zod boundaries, and shared UI state with the current scaffold

Activity period:

Purpose

The initial Public Web used a manually assembled target components layout, while its chosen Next.js structure, internationalization, linting, Tailwind setup, and shared state did not match create-next-app defaults.

The goal was to use a freshly generated standard scaffold as the comparison baseline, move existing features into a root app/ layout, and make localized URLs, input validation, and Cloudflare-compatible locale selection explicit.

Implementation

Web application package was aligned with a create-next-app scaffold generated without optional flags. The target components directory was removed, and app/, components/, i18n/, stores/, lib/, and server/ moved to the root. Standard ESLint and Tailwind configuration was added while existing 3D presentation and public-data access moved into the new structure.

Language selection resolves the initial language from a saved locale, Accept-Language, then Japanese by default. The locale-storage endpoint accepts only Japanese or English through Zod validation and stores manual choice in an HTTP-only, SameSite=Lax cookie.

Public routes now require /ja or /en, including localized news list, detail, and RSS paths. Redirects and locale resolution use Server Components and Route Handlers rather than Node.js Middleware unsupported by the Cloudflare OpenNext target.

The Zustand store contains only shared UI state such as camera, Agent selection, drawer, Room transition, and Demo mode, without duplicating public data. The public-API validation layer validates locale, Room slug, query, cursor, and public responses with Zod, rejecting incomplete cursors or combinations with search.

The cutoff flow for selecting a locale and entering a localized route

Rendering diagram…

What was confirmed

Verification results

The Web app's module layout, test glob, linting, Tailwind configuration, and dependency versions were aligned with the new standard scaffold.

Required localized prefixes, saved-locale and browser-language priority, and cookie persistence for manual selection were defined in code and routing tests.

Strict schemas were added for public API queries and responses, including rejection of invalid search-and-cursor combinations.

At the cutoff, the structural migration was applied to the target. Synchronization finishing work and final runtime verification belong to later activities.

Basis for completion

The work was complete when existing Public Web behavior moved to the root App Router structure and localized routing, cookie boundaries, Zod validation, Zustand state, linting, and test placement were applied in line with the standard scaffold.