Planned Changes and Features for the 17.10.x release 'Characters'
We have a very far developed prototype for a character builder, which is a microfrontend that allows users to create characters for tabletop roleplaying games. The builder will be released in a later phase - but the current state already allows us to create a rudimentary support for creating character sheets, and saving the characters with these sheets to the DB.
This release will focus on the sheets functionality, and compose of
- Models and schemas for:
- Character Entry (a subtype of an entry)
- Characters Sheet, a model used to store the character sheet data, included in the character entry
- A new (backported from the builder prototype) microfrontend for creating and editing character data mmodels (the character sheets) - for mods and admins (later this might be available to a site owner etc.)
- A SSR Library index for a players character entries (with a create button)
- A Microfrontend for displaying a character sheet, with online changes visible to all users viewing the sheet
- The sheet will be editable by the owner of the character, later this will be available to site owners for characters attached to a site
At this point the characters will be rudimentary, and our goal is to understand what kind of features we need to implement in the future. And how complex the character sheets need to be.
Project Plan
Here is a suggested breakdown of the project into stages to ensure a smooth development process, building from the foundational data structures up to the user-facing features.
Stage 1: Foundational Data Models & Schemas
- Objective: Back-port and create the core data structures for characters and character sheets.
- Tasks:
- Create
CharacterSheetSchema.ts
: Define the Zod schema for character sheet templates. This will be backported from the character builder prototype and will include the necessary sub-schemas like stats, features, etc. - Create
CharacterSchema.ts
: Define the Zod schema for a character instance. This will be a subtype of the genericEntry
schema and will include a reference to theCharacterSheet
it uses, along with the actual character data. - Define corresponding TypeScript types from these schemas.
- Implement a basic test suite using Vitest to ensure the schemas validate correctly and handle edge cases.
- Create
Note: that the way we define the schemas should follow the existing patterns in the codebase, ensuring consistency with how other entries and schemas are structured. Noting that the “entryFrom” type data handlers are not needed, and we should use zod’s built-in validation and transformation capabilities directly in the schemas.
Stage 2: Backend Setup (Firestore)
- Objective: Prepare the database to store character and sheet data.
- Tasks:
- Update Firestore security rules to allow appropriate read/write access for characters and character sheets.
- Create initial character sheet templates in Firestore for testing purposes (e.g., a simple D&D 5e or a generic system sheet).
Stage 3: Character Sheet Template Editor (Admin Microfrontend)
- Objective: Build the tool for administrators and moderators to create and manage character sheet templates.
- Tasks:
- Create a new route, e.g.,
/admin/sheets
, protected for admin/mod roles. - Develop the Svelte or Lit microfrontend for listing existing character sheet templates and providing options to create/delete them.
- Develop the Svelte or Lit microfrontend for creating/editing the JSON structure of a
CharacterSheet
. - Backport the logic to save these sheet templates to Firestore.
- Create a new route, e.g.,
Stage 4: Character Management (Player-Facing)
- Objective: Allow players to see their characters and create new ones.
- Tasks:
- Create the SSR Astro page at
/library/characters
to display a list of the authenticated user’s characters. Page will use thePageWithTray.astro
layout. - Add a link to the character library, in the library tray.
- Implement a “Create New Character” button on this page.
- The creation process should allow the user to select an available
CharacterSheet
template and fill in the initial details. - Save the new
Character
entry to Firestore, linked to the user’s profile.
- Create the SSR Astro page at
Stage 5: Interactive Character Sheet Viewer
- Objective: Build the real-time, interactive character sheet view.
- Tasks:
- Create a dynamic Astro route
/characters/[characterId]
using thePageWithTray.astro
layout. - Develop the Svelte microfrontend that fetches and displays the character’s data based on its sheet template in a read-only format.
- Implement real-time updates using Firestore listeners so any changes (from the edit view) are reflected live.
- Create a dynamic Astro route
Stage 6: Interactive Character Sheet Editor
- Objective: Build the interface for editing a character sheet.
- Tasks:
- Create a dynamic Astro route
/characters/[characterId]/edit
using theEditorPage.astro
layout to maximize space. - Develop the Svelte microfrontend that renders the character sheet with editable fields.
- Ensure the page is only accessible to the character’s owner.
- Enable editing capabilities within the sheet. Changes should be saved back to Firestore instantly.
- Create a dynamic Astro route
Stage 7: Testing, Integration & Deployment
- Objective: Ensure all components work together, are tested, and are ready for release.
- Tasks:
- Write Playwright E2E tests for the entire user flow: creating a sheet template, creating a character, viewing and editing the sheet.
- Write Vitest unit tests for schemas and utility functions.
- Review and refactor code, ensuring logging and error handling are in place.
- Deploy to Vercel and perform final testing on production.