Skip to content

Stores Overview

PIP AI uses Pinia for global state management. Stores are defined in app/stores/ and auto-imported by Nuxt.

Available Stores

StoreFilePurpose
useAppStoreapp/stores/app.tsGlobal UI state, theme management
useProjectsStoreapp/stores/projects.tsProject list, current project
usePipItemsStoreapp/stores/pipItems.tsPIP items for active project

Pinia Conventions

  • Stores use the Setup Store syntax (Composition API style)
  • Store IDs match the file name (e.g., app, projects, pipItems)
  • Stores are auto-imported — use useAppStore() directly in components
  • Stores are reactive — use storeToRefs() for template bindings

Usage Example

typescript
// In a component
const appStore = useAppStore()
const { currentTheme, sidebarOpen } = storeToRefs(appStore)

// Actions
appStore.setTheme('dark')
appStore.toggleSidebar()

Built with VitePress