How mitskiyu/medalzai works
Project Type and Purpose
• This is a containerized, full-stack web application named “Medalzai.”
• Frontend: a SvelteKit-based single-page app under client/.
• Backend: a Rust web service (using Cargo, likely with warp or actix) under server/.
• Purpose (inferred): present video-related functionality (VideoPanel, LinkArea, medal services) via a browser UI and interact with metadata/proxy/medal endpoints.
File Structure Analysis
• Top level
• docker-compose.yml orchestrates client and server containers.
• .dockerignore, .gitignore for builds and VCS.
• client/
• Standard SvelteKit layout: src/routes (page components), src/lib (reusable UI components, state, types, video client).
• Dockerfile, package.json, pnpm lock, tsconfig, lint/prettier configs.
• server/
• Rust project managed by Cargo (Cargo.toml, Cargo.lock).
• src/main.rs and src/app.rs bootstrap the HTTP server.
• src/routes/ defines endpoint handlers (metadata.rs, proxy.rs, mod.rs).
• src/services/ contains business logic (medal.rs, metadata, etc.).
README Insights
• Minimal, but project name implies a “medal” feature around videos, likely awarding or extracting highlights.
• Absence of a database directory suggests no persistent store; service modules handle ephemeral or proxied data.
a. Main Components
• Client UI Service (SvelteKit container)
• API Gateway / Backend Service (Rust container)
• Internal Modules: Route Handlers, Business Services (medal, metadata, proxy)
• External Services: upstream video sources or 3rd-party APIs
• (Optional) Docker-Compose network fabric
b. Relationships & Interactions
• Browser ↔ Client UI (HTTP/WS)
• Client UI → Backend API (REST or JSON over HTTP)
• Backend Routes → Service Modules (in-process calls)
• Service Modules → External Video APIs (HTTP calls)
c. Architectural Patterns & Principles
• Layered architecture: presentation, API gateway, domain services
• Separation of concerns: routing vs business logic
• Containerization for environment parity
• Client–server decoupling via clear API contracts
d. Key Technologies
• Frontend: SvelteKit, TypeScript, pnpm, Vite
• Backend: Rust, Cargo, web framework (warp/actix), modules under routes/ and services/
• DevOps: Docker, Docker-Compose