alles andere
This commit is contained in:
14
packages/shared/package.json
Normal file
14
packages/shared/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@srb/shared",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared types and utilities",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.6.0"
|
||||
}
|
||||
}
|
||||
3
packages/shared/src/index.ts
Normal file
3
packages/shared/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './types/business';
|
||||
export * from './types/workflow';
|
||||
export * from './types/metrics';
|
||||
61
packages/shared/src/types/business.ts
Normal file
61
packages/shared/src/types/business.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
export enum BusinessStatus {
|
||||
VALIDATING = 'VALIDATING',
|
||||
VALIDATION_FAILED = 'VALIDATION_FAILED',
|
||||
DEVELOPING_MVP = 'DEVELOPING_MVP',
|
||||
LAUNCHING = 'LAUNCHING',
|
||||
RUNNING_ADS = 'RUNNING_ADS',
|
||||
OPTIMIZING = 'OPTIMIZING',
|
||||
SCALING = 'SCALING',
|
||||
SELLING = 'SELLING',
|
||||
SHUTDOWN = 'SHUTDOWN',
|
||||
PAUSED = 'PAUSED'
|
||||
}
|
||||
|
||||
export interface Business {
|
||||
id: string;
|
||||
name: string;
|
||||
idea: string;
|
||||
status: BusinessStatus;
|
||||
viable: boolean | null;
|
||||
mvpUrl: string | null;
|
||||
landingPageUrl: string | null;
|
||||
seoOptimized: boolean;
|
||||
adsActive: boolean;
|
||||
emailAutomation: boolean;
|
||||
monthlyRevenue: number;
|
||||
totalRevenue: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface BusinessInput {
|
||||
name: string;
|
||||
idea: string;
|
||||
targetAudience?: string;
|
||||
budget?: number;
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
viable: boolean;
|
||||
score: number;
|
||||
competitors: CompetitorInfo[];
|
||||
demandData: DemandData;
|
||||
analysis: string;
|
||||
risks: string[];
|
||||
opportunities: string[];
|
||||
}
|
||||
|
||||
export interface CompetitorInfo {
|
||||
name: string;
|
||||
url: string;
|
||||
estimatedTraffic?: number;
|
||||
strengths: string[];
|
||||
weaknesses: string[];
|
||||
}
|
||||
|
||||
export interface DemandData {
|
||||
searchVolume: number;
|
||||
trend: 'rising' | 'stable' | 'declining';
|
||||
seasonality: boolean;
|
||||
relatedKeywords: string[];
|
||||
}
|
||||
61
packages/shared/src/types/metrics.ts
Normal file
61
packages/shared/src/types/metrics.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
export enum Platform {
|
||||
FACEBOOK = 'FACEBOOK',
|
||||
GOOGLE = 'GOOGLE',
|
||||
ORGANIC = 'ORGANIC'
|
||||
}
|
||||
|
||||
export enum DecisionType {
|
||||
SCALE_PRODUCT = 'SCALE_PRODUCT',
|
||||
SELL_BUSINESS = 'SELL_BUSINESS',
|
||||
SHUTDOWN = 'SHUTDOWN',
|
||||
PAUSE_CAMPAIGN = 'PAUSE_CAMPAIGN',
|
||||
INCREASE_BUDGET = 'INCREASE_BUDGET',
|
||||
HIRE_VA = 'HIRE_VA'
|
||||
}
|
||||
|
||||
export interface Campaign {
|
||||
id: string;
|
||||
businessId: string;
|
||||
platform: Platform;
|
||||
budget: number;
|
||||
active: boolean;
|
||||
impressions: number;
|
||||
clicks: number;
|
||||
conversions: number;
|
||||
revenue: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface Metric {
|
||||
id: string;
|
||||
businessId: string;
|
||||
timestamp: Date;
|
||||
revenue: number;
|
||||
adSpend: number;
|
||||
visitors: number;
|
||||
conversions: number;
|
||||
roas: number | null;
|
||||
}
|
||||
|
||||
export interface Decision {
|
||||
id: string;
|
||||
businessId: string;
|
||||
decisionType: DecisionType;
|
||||
action: string;
|
||||
reasoning: string;
|
||||
revenueAtDecision: number | null;
|
||||
executed: boolean;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface BusinessMetrics {
|
||||
totalRevenue: number;
|
||||
monthlyRevenue: number;
|
||||
totalAdSpend: number;
|
||||
monthlyAdSpend: number;
|
||||
averageRoas: number;
|
||||
totalConversions: number;
|
||||
totalVisitors: number;
|
||||
conversionRate: number;
|
||||
}
|
||||
44
packages/shared/src/types/workflow.ts
Normal file
44
packages/shared/src/types/workflow.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export enum WorkflowType {
|
||||
MARKET_VALIDATION = 'MARKET_VALIDATION',
|
||||
MVP_DEVELOPMENT = 'MVP_DEVELOPMENT',
|
||||
LANDING_PAGE_SEO = 'LANDING_PAGE_SEO',
|
||||
PAID_ADS = 'PAID_ADS',
|
||||
CONTENT_MARKETING = 'CONTENT_MARKETING',
|
||||
EMAIL_AUTOMATION = 'EMAIL_AUTOMATION',
|
||||
ANALYTICS_SETUP = 'ANALYTICS_SETUP',
|
||||
OPTIMIZATION_LOOP = 'OPTIMIZATION_LOOP'
|
||||
}
|
||||
|
||||
export enum WorkflowStatus {
|
||||
PENDING = 'PENDING',
|
||||
IN_PROGRESS = 'IN_PROGRESS',
|
||||
COMPLETED = 'COMPLETED',
|
||||
FAILED = 'FAILED',
|
||||
RETRYING = 'RETRYING'
|
||||
}
|
||||
|
||||
export interface WorkflowRun {
|
||||
id: string;
|
||||
businessId: string;
|
||||
workflowType: WorkflowType;
|
||||
status: WorkflowStatus;
|
||||
inputData: Record<string, any>;
|
||||
outputData: Record<string, any> | null;
|
||||
error: string | null;
|
||||
attempts: number;
|
||||
startedAt: Date | null;
|
||||
completedAt: Date | null;
|
||||
}
|
||||
|
||||
export interface WorkflowExecutionContext {
|
||||
businessId: string;
|
||||
workflowType: WorkflowType;
|
||||
inputData: Record<string, any>;
|
||||
retryCount: number;
|
||||
}
|
||||
|
||||
export interface WorkflowResult {
|
||||
success: boolean;
|
||||
data?: Record<string, any>;
|
||||
error?: string;
|
||||
}
|
||||
19
packages/shared/tsconfig.json
Normal file
19
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2022"],
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user