How boluski2/karken- works
Purpose and Runtime
Baltic Harvest Hub is a bilingual (Lithuanian/English), SEO-focused B2B marketing site for Karken Company, an African-food distributor serving Lithuania/Baltic markets. It is a client-side React/TypeScript application built and served by Vite; there is no backend API or database in this repository. Primary bootstrapping is src/main.tsx, which mounts the application defined in src/App.tsx.
Application Shell and Navigation
src/App.tsx composes global providers and React Router routes for the marketing pages. src/components/Layout.tsx provides the shared page frame, with navigation and site-level chrome supplied by src/components/Header.tsx and src/components/Footer.tsx. Route targets are independently authored content pages such as src/pages/Index.tsx, src/pages/Products.tsx, and src/pages/Contact.tsx; unmatched paths terminate in src/pages/NotFound.tsx.
Language State Boundary
Bilingual content is controlled centrally through src/contexts/LanguageContext.tsx. Components/pages consume language state rather than calling an external translation service, making locale selection an in-browser UI state boundary. The provider is established at application level in src/App.tsx, allowing shared header navigation and route content to stay synchronized.
Marketing Content and Media Delivery
The route pages render static distributor/service/product/compliance content and locally bundled imagery. src/components/OptimizedImage.tsx is the media delivery boundary: it uses IntersectionObserver-based lazy loading while permitting priority hero loads. Responsive AVIF variants live alongside originals under src/assets/, for example src/assets/hero-nigerian-food-w320.avif, src/assets/hero-nigerian-food-w1024.avif, and src/assets/hero-nigerian-food-w1600.avif. Asset metadata is generated into src/assets/optimized-manifest.json.
SEO and Public Discoverability
Each route can declare title, metadata, social cards, and structured JSON-LD through src/components/SEO.tsx. This isolates document-head mutation from page rendering and relies on the React Helmet runtime described by the project. Crawl behavior is exposed at public/robots.txt; Vercel deployment behavior is defined in vercel.json.
Lead Capture Integration
Contact UI is hosted by src/pages/Contact.tsx; EmailJS configuration is isolated in src/config/emailjs.ts. The browser submits lead-form data to EmailJS rather than an application-owned server, so EmailJS is the material external service and configuration/secrets boundary. UI feedback uses the local toast infrastructure, including src/components/ui/toaster.tsx.
Build, Styling, and Asset Pipeline
Vite provides development and production bundling via vite.config.ts; package scripts and dependency runtime definitions are in package.json. Tailwind drives the responsive design system through tailwind.config.ts, with global CSS at src/index.css and application styling at src/App.css. Source-image transformations and responsive manifest generation are handled before runtime by scripts/optimize-images.js and scripts/generate-manifest.js.
Main entry points: App.tsx App and routes · Contact.tsx Contact and lead form · Index.tsx Marketing pages · Layout.tsx Shared layout
Components 21
Client Runtime
Vite-served React application.
- Vite · Builds and serves the client application.
vite.config.ts - Application bootstrap
src/main.tsx - App and routes · Establishes providers and page routes.
src/App.tsx - Language state · Synchronizes Lithuanian and English UI state.
src/contexts/LanguageContext.tsx - EmailJS configuration · Browser-side EmailJS configuration boundary.
src/config/emailjs.ts
UI and Content
Shared shell and route-driven marketing content.
- Shared layout
src/components/Layout.tsx - Header navigation
src/components/Header.tsx - Footer
src/components/Footer.tsx - Marketing pages · Distributor, product, service, and compliance content.
src/pages/Index.tsx - Products page
src/pages/Products.tsx - Contact and lead form
src/pages/Contact.tsx - Not found page
src/pages/NotFound.tsx - SEO head manager · Sets metadata, social cards, and JSON-LD.
src/components/SEO.tsx - Optimized image loader · Lazy loads responsive images, with priority hero support.
src/components/OptimizedImage.tsx - Toast feedback
src/components/ui/toaster.tsx
Delivery and Build
Static assets, discovery files, and build tooling.
- Responsive image assets · AVIF variants and generated asset manifest.
src/assets/optimized-manifest.json - Image optimization pipeline · Generates responsive image variants and manifest metadata.
scripts/optimize-images.js - Tailwind design system · Drives responsive site styling.
tailwind.config.ts - Crawl policy
public/robots.txt - Vercel deployment
vercel.json
Other components
- EmailJS · Receives browser-submitted lead forms.
Connections 24
- Vite → Application bootstrap: builds and serves
- Application bootstrap → App and routes: mounts
- App and routes → Language state: provides
- App and routes → Shared layout: wraps routes
- Shared layout → Header navigation: includes
- Shared layout → Footer: includes
- App and routes → Marketing pages: routes to
- App and routes → Products page: routes to
- App and routes → Contact and lead form: routes to
- App and routes → Not found page: falls back to
- Header navigation → Language state: consumes
- Marketing pages → Language state: consumes
- Marketing pages → SEO head manager: declares metadata
- Products page → SEO head manager: declares metadata
- Contact and lead form → SEO head manager: declares metadata
- Marketing pages → Optimized image loader: renders media
- Optimized image loader → Responsive image assets: loads variants
- Image optimization pipeline → Responsive image assets: generates
- Contact and lead form → EmailJS configuration: uses
- Contact and lead form → EmailJS: submits leads
- Contact and lead form → Toast feedback: shows feedback
- Tailwind design system → App and routes: styles
- Crawl policy → Vite: published with site
- Vercel deployment → Vite: deploys build