This document tracks how the main DTI Rails app still depends on the separate Impress 2020 service, and what would need to be migrated to fully consolidate into a single Rails app.
## Background
In 2020, we started a NextJS rewrite called "Impress 2020" to modernize the frontend. We've since decided to consolidate back into the Rails app, but migration is ongoing. The Rails app now embeds the Impress 2020 React frontend (in `app/javascript/wardrobe-2020/`) for the outfit editor, but some functionality still calls back to the Impress 2020 GraphQL API.
## Current State
### What's Migrated to Rails
The following have been migrated to Rails REST API endpoints (in `app/javascript/wardrobe-2020/loaders/`):
- **Item search** (`/items.json`) - Searching for items with filters
- **Item appearances** (`/items/:id/appearances.json`) - Getting item layers for different bodies
- **Outfit save/load** (`/outfits.json`, `/outfits/:id.json`) - CRUD operations on outfits
- **Alt styles** (`/species/:id/alt-styles.json`) - Loading alternative pet appearances
### What Still Uses Impress 2020 GraphQL
The following GraphQL queries and mutations are still hitting the Impress 2020 service:
#### Core Wardrobe Functionality
- **`OutfitPetAppearance`** - Load pet appearance (biology layers) by species/color/pose
- **`OutfitPetAppearanceById`** - Load pet appearance by ID
**Cons**: Maintains complexity of React app + dual API surface
### Option B: Wardrobe Rewrite (Rails + Turbo)
Rewrite the outfit editor as a Rails view with Turbo/Stimulus, similar to the item show page.
**Pros**: Massive simplification—remove React, GraphQL, and complex data fetching entirely
**Cons**: High risk (rewrites are dangerous), significant effort, potential UI regressions
**Note**: Simplicity has been DTI's most valuable architectural principle long-term. The complexity of maintaining the React wardrobe + its APIs is significant. But rewrites carry inherent risk.
---
### Option A: Priority 1 - Core Data Loading
The most important migrations to enable turning off Impress 2020 would be:
- **Databases**: Two MySQL databases on main Rails server, **both accessed directly by Impress 2020**:
-`openneo_impress` - Main application data (items, pets, outfits, etc.)
-`openneo_id` - Authentication data (user accounts, passwords, OAuth)
**CRITICAL**: Impress 2020 directly queries both databases via SQL. Any database consolidation must wait until Impress 2020 is retired, or both services must be updated in a coordinated deployment.
- **Single MySQL database**: Can merge `openneo_id` into `openneo_impress` once Impress 2020 is retired
- See `feature/consolidate-auth-database` branch for implementation
- Migration is ready but BLOCKED on Impress 2020 retirement
## Database Consolidation Blocker
**IMPORTANT**: A database consolidation migration exists on the `feature/consolidate-auth-database` branch that would merge the `openneo_id` database into `openneo_impress`. However, **this migration is blocked** because:
1.**Impress 2020 uses both databases directly** for authentication and user queries
2. Consolidating now would break Impress 2020's login functionality
3. The migration can only proceed after Impress 2020 is fully retired