Skip to content

Last updated:

Frontend Documentation

Welcome to the CPR (Computerized Patient Record) frontend documentation. This guide covers everything a developer needs to work on the frontend codebase.

Tech Stack

TechnologyVersionPurpose
Nuxt4.xFull-stack Vue framework (SPA mode)
Vue3.5+Reactive UI framework
TypeScript5.xType-safe JavaScript
Pinia3.xState management
Tailwind CSSvia @nuxtjs/tailwindcssUtility-first CSS
Heroicons@heroicons/vueIcon library
Sentry@sentry/nuxtError tracking
Vitest4.xUnit & component testing
ESLint + PrettierLatestCode linting & formatting

Quick Start

bash
# Install dependencies
npm install

# Start dev server
npm run dev

# Build for production
npm run build

# Run linting
npm run lint

# Format code
npm run format:fix

Project Structure Overview

app/
├── assets/css/         # Global styles (Tailwind entry)
├── components/         # Vue components (auto-imported)
│   ├── ui/             # Reusable base components (UiButton, UiInput, UiModal...)
│   ├── auth/           # Authentication components
│   ├── patient/        # Patient module components
│   ├── queue/          # Queue module components
│   ├── pharmacy/       # Pharmacy module components
│   ├── configuration/  # Configuration module components
│   ├── surgery/        # Surgery schedule components
│   ├── profile/        # User profile components
│   ├── report/         # Report layout components
│   └── utils/          # Shared utility components
├── composables/        # Reusable composition functions
├── constants/          # Static data and constants
├── data/               # Static datasets (e.g., address data)
├── layouts/            # Page layouts (default, auth, pharmacy, queue, print)
├── middleware/         # Route middleware (auth, reset-password)
├── pages/              # File-based routing
├── plugins/            # Nuxt plugins (permissions)
├── sevices/            # API service classes
├── stores/             # Pinia stores
├── types/              # TypeScript type definitions
└── utils/              # Utility functions

Application Modules

The CPR system is organized into these main modules:

  • Dashboard — Overview and statistics
  • Patient — Patient records, visits, medical history, certificates
  • Queue — Patient queue management, billing, medicine purchases
  • Surgery Schedule — Surgery scheduling and tracking
  • Pharmacy — Inventory, items, purchase orders, deliveries, stock movement, suppliers, transactions
  • Configuration — System settings (doctors, procedures, insurances, billing items, surgery locations)
  • Profile — User profile and password management

Key Architecture Patterns

  1. Service Layer — API calls go through service classes in sevices/
  2. Composables — Business logic is encapsulated in composables per domain
  3. Pinia Stores — Global state management for each module
  4. Permission-based Access — UI elements guarded by $can() / useCanAccess()
  5. Multi-branch Support — Users can switch between clinic branches

Documentation Sections

How-To Guides ⭐

Task-oriented recipes for the Nuxt frontend. (For Inertia admin-panel screens, see backend admin guides.)

Guidelines

Workflow

Standards

Components

  • Overview — Component organization and auto-import
  • Base ComponentsUi* component library reference
  • Layouts — Layout system and available layouts
  • Forms — Form patterns, validation, and composables

State Management

Styling

Testing

Performance

Accessibility

Security

Tooling

CPR - Clinical Patient Records