AgentSkillsCN

crm-portal-development

运行并开发 Wemotoo CRM 门户(Nuxt 3 / Vue 3)。适用于本地启动前端、链接 wemotoo-common、执行构建,或利用 Docker 进行本地开发时使用。涵盖 npm/bun 脚本、环境变量文件,以及项目整体布局。

SKILL.md
--- frontmatter
name: crm-portal-development
description: Run and develop the Wemotoo CRM Portal (Nuxt 3 / Vue 3). Use when starting the frontend locally, linking wemotoo-common, running builds, or using Docker for local dev. Covers npm/bun scripts, env files, and project layout.

Wemotoo CRM Portal Development

Quick Start

Local dev (per environment):

bash
bun run start:local   # .env.local
bun run start:dev     # .env.dev
bun run start:prod    # .env.prod

Build:

bash
bun run build:dev     # --dotenv .env.dev
bun run build:prod    # --dotenv .env.prod

Preview production build:

bash
bun run preview

Linking wemotoo-common

The portal depends on local wemotoo-common. Link it before developing:

bash
npm link /Users/szejinggo/Documents/Projects/wemotoo-common

(Adjust the path if your wemotoo-common repo lives elsewhere.)

NPM Scripts Reference

ScriptPurpose
start:local / start:dev / start:prodnuxt dev with .env.local / .env.dev / .env.prod
build:dev / build:prodnuxt build with corresponding dotenv
generatenuxt generate (static)
previewnuxt preview
typechecknuxt typecheck
lint / lint:fixESLint
docker:devdocker-compose -f docker-compose.dev.yml up --build
docker:proddocker-compose -f docker-compose.prod.yml up --build
docker:build:devdocker buildx linux/arm64, tag wemotoo-crm:dev
docker:build:proddocker buildx linux/amd64, tag wemotoo-crm:prod
cleanRemove node_modules, dist, .nuxt, bun.lockb
rebuildclean then bun install

Conventions and Rules

When editing the portal, follow the Cursor rules in .cursorrules/:

  • general.mdc – Structure, naming, TypeScript, security
  • vue-pages-components.mdc – Pages, file-based routing, components, layouts
  • repository.mdc – API client, routes.client.ts, request/response
  • server-routes.mdc – Nitro routes under server/routes/merchant/, generateHeaders
  • schema.mdc – Zod schemas in app/utils/schema/
  • types.mdc – Types in app/utils/types/, repository models
  • composables.mdc – Composables in app/composables/
  • middleware.mdc – Nuxt and Nitro middleware
  • utility.mdc – Utils, table-columns, constants

See .cursorrules/README.md for the layer-to-rule mapping.