How esgi-doctodoc/docto-doc-web-app works
Project Type and Purpose
• This is a Nuxt (Vue 3) front-end application.
• It delivers pages via Nuxt’s SSR/SSG or client-side hydration, uses MSW for local API mocking, and interacts with a set of REST endpoints (appointments, doctors, auth, etc.).
• Purpose: Admin/user portal for managing doctors, appointments, patients, care-tracking, messaging, subscriptions, etc.
File Structure
• Top-level:
• nuxt.config.ts – overall framework config (SSR, modules, plugins)
• src/ – application code
• public/ – static assets & mock worker
• Within src:
• pages/ – route definitions (Nuxt file‐based routing)
• components/ – UI building blocks (modals, inputs, tables, slideover, etc.)
• layouts/ – AuthLayout, MainLayout
• composables/ – reusable logic hooks (auth, calendar, modal, messaging)
• services/ – HTTP wrapper “API layer” organized by domain (appointments, auth, doctors, etc.)
• stores/ – state management (Pinia or Vuex – here appears Pinia)
• plugins/ – i18n and MSW integration
• mocks/ – MSW handlers for offline development
• api/ – low-level api‐client, request builder, schemas, types
• middleware/ – global auth guard, role guard
• assets & public/images – static images
• locales/ – translation files
README
• Confirms standard Nuxt scaffolding, npm scripts for dev, build, preview, deployment pointers.
a. Main Components
• Browser/Client (Nuxt SSR + client‐side SPA)
• Nuxt Server/SSR or CDN-delivered static site
• MSW (Mock Service Worker) for local API mocking
• API Layer (api-client.ts + request-builder)
• Domain Services (services/*: appointments.api.ts, auth.api.ts, etc.)
• External RESTful Backend APIs (Auth, Appointments, Doctors, Patients, Messaging, etc.)
• State Store (Pinia stores in src/stores)
• Composables (logic layer between components and services)
• UI Layer (Layouts, Pages, Components)
• Plugins (i18n, MSW client)
• Middleware (auth.global, role)
b. Relationships & Data Flow
1. User → Browser loads page → Nuxt SSR (if SSR) or static assets → Vue application boots
2. Client initializes plugins (i18n, MSW)
3. Page components call composables → composables call domain services
4. Domain services use api-client → issue HTTP requests (or MSW intercepts) → Backend APIs
5. Responses flow back → services parse DTOs → composables update Pinia store
6. UI components reactively render based on store state
7. Middleware guards protect routes before rendering pages
c. Architectural Patterns & Principles
• Layers: Presentation (components/pages/layouts) → Composition (composables) → Service/Repository (services) → HTTP Client (api) → External API
• Separation of Concerns: validation in src/components/inputs/validators, localization in plugins & locales, state in stores
• Modularization: Domain-based directories under services, mocks, components
• Dependency Injection via composables & plugins
• Mocking Strategy: MSW for offline development, registered as a client plugin
d. Key Technologies & Frameworks
• Nuxt 3 (SSR/SSG, file‐based routing, modules)
• Vue 3 Composition API (composables)
• Pinia (stores)
• TypeScript (types in src/types, DTOs)
• MSW (mocking layer)
• i18n (vue-i18n plugin)
• REST API (axios/fetch via request-builder)