Files
dss/server/src/models/Component.js
Digital Production Factory 276ed71f31 Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
2025-12-09 18:45:48 -03:00

76 lines
1.4 KiB
JavaScript

import { DataTypes } from 'sequelize';
import sequelize from '../config/database.js';
const Component = sequelize.define('Component', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
projectId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'Projects',
key: 'id'
}
},
name: {
type: DataTypes.STRING,
allowNull: false
},
description: {
type: DataTypes.TEXT,
allowNull: true
},
category: {
type: DataTypes.STRING,
allowNull: true
},
figmaId: {
type: DataTypes.STRING,
allowNull: true,
unique: true
},
storybookPath: {
type: DataTypes.STRING,
allowNull: true
},
status: {
type: DataTypes.ENUM('draft', 'wip', 'ready', 'deprecated'),
defaultValue: 'draft'
},
adoptionScore: {
type: DataTypes.FLOAT,
defaultValue: 0
},
usageCount: {
type: DataTypes.INTEGER,
defaultValue: 0
},
variants: {
type: DataTypes.JSON,
defaultValue: []
},
metadata: {
type: DataTypes.JSON,
allowNull: true
},
createdAt: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
updatedAt: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
}
}, {
timestamps: true,
indexes: [
{ fields: ['projectId'] },
{ fields: ['status'] }
]
});
export default Component;