How twin-te/twinte-front works
Project Type and Purpose
• This is a front-end single-page application (SPA) built in Vue 3/TypeScript following Clean/Hexagonal Architecture (layers: adapter, application/use-cases, domain, infrastructure, presentation, UI).
• It’s packaged with Vite and deployed as a Docker container (Nginx) to Kubernetes (using Kustomize). It consumes a remote OpenAPI-defined backend (via aspida), plus Firebase for auth and localStorage for caching, and integrates with external donation/payment services.
Key Architectural Layers & Components
A. UI Layer (Vue components & pages)
• src/ui: Vue SFCs (views, components, hooks, store).
• storybook for component dev.
B. Presentation Layer
• src/presentation: presenters & viewmodels translate domain models into UI-friendly forms and vice versa.
C. Application Layer (Usecases)
• src/application/usecases: orchestrate business operations (e.g., getCourses, sendFeedback).
• ports define repository interfaces (ICourseRepository, IUserRepository, etc.).
D. Domain Layer
• src/domain: core entities and value objects (Course, User, Schedule).
• domain-level errors, types, invariants.
E. Infrastructure Layer
• src/infrastructure/api (aspida): HTTP clients generated from OpenAPI spec to call remote backend.
• converters: map raw JSON to domain primitives.
• firebase: auth/session management.
• localstorage: caching layer implementing ports for offline state.
F. Adapter/Repository Layer
• src/repositories: concrete implementations of I*Repository (inMemory for dev, HTTP/Firebase for production).
G. Deployment & DevOps
• Dockerfiles (.devcontainer, production, staging).
• Kustomize manifests for Kubernetes (deployment/service).
• GitHub Actions workflows (CI, Docker build, deploy to staging/production).