How steef-o/hvilken-baat-er-det-i-dag works
Project type and purpose
• This is a single-page front-end application built with React + TypeScript, bundled by Vite, styled with Tailwind CSS, and deployed as a static site (demo on Vercel).
• Purpose: At runtime it displays which cruise ship(s) are currently visiting Eidfjord.
High-level file-structure analysis
• Top‐level config & build files:
• package.json / package-lock.json – NPM dependencies & scripts
• vite.config.ts – Vite bundler config
• tailwind.config.js & postcss.config.js – Tailwind CSS setup
• tsconfig*.json – TypeScript settings
• vitest.config.ts – unit-test runner config
• biome.json – code-formatting rules
• Static asset & entry point:
• index.html – SPA container
• src/index.css – global styles
• src/main.tsx – React entry & Vite client hookup
• Application code:
• src/components – all UI components
• src/state/Atoms.tsx – atom-based state management
• src/assets/img – illustrations & ship imagery
Key architectural patterns & tech
• Single-page app (SPA) using the component-composition pattern.
• Global, fine-grained state via “Atoms” (e.g., Jotai/Recoil style).
• Build pipeline: Vite dev server → bundle → Tailwind CSS post-processing → static files.
• Deployment: Continuous build to Vercel (serves via CDN).
• (Optionally) runtime data source: external Cruise‐Data API for “currently visiting” info.
Main components
A. User & Client Environment
• Browser (User)
• React SPA
• Components: Toolbar, DailyMessage, Illustration, ShipList (Field, ShipListItem)
• State Layer: Atoms.tsx
• Assets: Images (src/assets/img)
B. Build/CI Pipeline
• Vite Dev Server (local)
• Vite + Tailwind + PostCSS → Bundled JS/CSS
• Biome (formatter) & Vitest (tests)
• Continuous Integration (Git → Vercel)
C. Hosting & Runtime Services
• Static Hosting (Vercel/CDN)
• (Optional) External Cruise Data API
Relationships & data flows
1. Developer runs npm run dev → Vite serves index.html → React SPA loads in browser.
2. On mount, SPA (via Atoms) fetches “current ships” from external API → stores in state.
3. UI components subscribe to state atoms → render list & messages.
4. CI pipeline triggers build → artifacts published to Vercel → CDN serves static files to end users.