Skip to main content

Development Guide

Panduan best practices untuk development di MStore Dashboard.

Development Workflow

Starting Development

Code Generation

Saat membuat perubahan pada types atau schema:

Project Structure Best Practices

Feature Module Structure

Setiap feature module harus mengikuti struktur ini:

Barrel Exports

Selalu gunakan barrel exports untuk clean imports:
Usage:

Naming Conventions

Files

Code

TypeScript Best Practices

Always Type Everything

Use Strict Mode

Prefer Interfaces Over Types

Vue 3 Best Practices

Composition API

Always use Composition API with <script setup>:

Props & Emits Typing

Use v-model Properly

State Management Best Practices

Store Organization

Composable vs Store

API Best Practices

Error Handling

Component Best Practices

Single Responsibility

Props Down, Events Up

Performance Tips

Lazy Loading

Virtual Scrolling

Untuk list besar, gunakan virtual scrolling:

Computed Caching

Debugging

Vue DevTools

  • Install Vue DevTools browser extension
  • Inspect component hierarchy
  • Debug Pinia stores
  • Track events

Vue Inspector

Click the inspector button to jump to component source code.

Console Logging

Common Patterns

Loading State Pattern

Form Pattern

Checklist for New Features

  • Create feature folder structure
  • Define types in types/
  • Create API functions in api/
  • Create Pinia store in store/
  • Create composables in composables/
  • Create components in components/
  • Create barrel exports in index.ts
  • Create page in app/pages/
  • Add translations in locales/
  • Write tests (if applicable)
  • Update documentation

Next Steps

Testing Strategy

Testing best practices

Architecture

DDD architecture guide