d77fa4b8172853d5b473ffed8e612ae41a6c3c43
Job Info - Mode-Based Architecture
This project uses a mode-switching architecture to allow seamless switching between different application configurations.
Architecture Overview
Job-Info-Test/
├── ModeSwitch/ (Orchestrator hub - controls which mode runs)
├── Mode1Test/ (Mode1Test - original application)
├── Mode2Test/ (Mode2Test - alternative configuration)
├── Monica.txt (Development persona and standards)
└── README.md (This file)
Modes
Mode1Test
The original application configuration. Runs on port 3005 when active.
- Backend:
Mode1Test/backend/server.ts - Frontend:
Mode1Test/frontend/ - Standalone project with its own
package.json
Mode2Test
Alternative configuration (under development).
- Backend:
Mode2Test/backend/server.ts - Frontend:
Mode2Test/frontend/ - Standalone project with its own
package.json
ModeSwitch Orchestrator
The orchestrator manages mode switching and ensures only one mode runs on port 3005 at a time.
Starting the Application
cd ModeSwitch
bun install
bun run backend/orchestrator.ts
The orchestrator will:
- Read the active mode from
ModeSwitch/activeMode.txt - Kill any existing process on port 3005
- Start the active mode on port 3005
Orchestrator runs on port 3006 (for control/monitoring) Shared mode port: 3005 (public, user-facing)
Switching Modes at Runtime
curl -X POST http://localhost:3006/api/mode/switch/Mode2Test
Or programmatically:
const response = await fetch('http://localhost:3006/api/mode/switch/Mode1Test', {
method: 'POST',
});
Checking Current Mode
curl http://localhost:3006/api/mode
Development Standards
See Monica.txt for complete development persona, standards, and guidelines.
Key standards:
- Runtime: Bun (exclusive)
- Backend: Hono + TypeScript
- Frontend: Vite + TailwindCSS + TypeScript
- Architecture: Modules as standalone reusable components
- Environment: Variables from
process.env(no sample .env files) - Code: Original rewrites, no delta markers, permanent/temporary comments
File Structure Rules
- Root: Only mode folders, orchestrator folder, Monica.txt, README.md
- Each Mode: Self-contained with
package.json,backend/,frontend/ - ModeSwitch: All mode-switching logic and orchestration
- Modules: Standalone folders with related code (when needed)
Next Steps
- Verify Test1Mode runs correctly from
oldTest/ - Implement Mode2Test as a new application variant
- Test mode switching via the orchestrator API
Description
Languages
HTML
41.8%
TypeScript
38.2%
Svelte
16%
JavaScript
3.8%
CSS
0.2%