Skip to content

Development

This guide covers the development workflow, conventions, and best practices for IONFLOW Frontend.

Terminal window
# Start development server
pnpm dev
# Start with specific port
pnpm dev --port 3000
# Start with host access (for mobile testing)
pnpm dev --host

Vite provides instant HMR for:

  • Vue single-file components
  • CSS/Tailwind changes
  • TypeScript files
// ❌ NEVER use any
const data: any = response.data;
// ✅ Always use proper types
const data: UserResponse = response.data;
// ❌ NEVER use interface
interface User {
id: string;
}
// ✅ Always use type
type User = {
id: string;
};
<script setup lang="ts">
// 1. Imports
import { ref, computed } from 'vue';
import type { User } from '@/models/user';
// 2. Props with types
type Props = {
title: string;
items: User[];
};
const props = defineProps<Props>();
// 3. Emits with types
type Emits = {
select: [item: User];
update: [value: string];
};
const emit = defineEmits<Emits>();
// 4. Composables and refs
const isLoading = ref(false);
// 5. Computed
const filteredItems = computed(() => props.items.filter(/* ... */));
// 6. Methods
const handleSelect = (item: User) => {
emit('select', item);
};
</script>
<template>
<!-- Template with Tailwind CSS -->
</template>
  • All code must be in English: comments, variables, functions
  • Only exception: Translation files in src/lang/
Terminal window
# Run all unit tests
pnpm test:unit
# Run tests in watch mode
pnpm test:unit --watch
# Run tests with coverage
pnpm test:unit --coverage
# Run specific test file
pnpm test:unit src/components/common/TruncateText.spec.ts
Terminal window
# Run E2E tests
pnpm test:e2e
# Run E2E tests with UI
pnpm test:e2e --ui
# Run specific test
pnpm test:e2e e2e/login.spec.ts
  • Unit tests: Next to the component (Component.spec.ts)
  • E2E tests: In e2e/ directory
Terminal window
# Type checking
pnpm type-check
# Lint
pnpm lint
# Format
pnpm format
Terminal window
# Build for production
pnpm build
# Preview production build
pnpm preview

Install Vue DevTools browser extension for:

  • Component inspection
  • State debugging
  • Performance profiling

Add to .vscode/launch.json:

{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug IONFLOW",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}/src"
}
]
}
feature/ION-123-add-flow-builder
bugfix/ION-456-fix-login-redirect
hotfix/ION-789-critical-security-fix

Follow Conventional Commits:

feat(flows): add drag-and-drop support
fix(auth): resolve token refresh issue
docs(readme): update installation steps
refactor(components): simplify form validation
test(flows): add unit tests for FlowCard

The project uses pre-commit hooks for:

  • ESLint
  • Prettier
  • Type checking
  1. Create component file in appropriate directory
  2. Add unit tests if in src/components/
  3. Add to exports if needed
  1. Add route in src/router/[context].ts
  2. Create view component in src/views/[context]/
  3. Add navigation guard if needed
  1. Create service in src/services/[context]/
  2. Define types in src/models/
  3. Create abstract class in src/interfaces/ if reusable
  1. Add keys to src/lang/en/message.ts
  2. Add translations to src/lang/es/message.ts
  3. Use t('key') in components
  • Use lazy loading for routes
  • Implement virtual scrolling for large lists
  • Optimize images and assets
  • Use TanStack Query for caching