Add project scaffolding and documentation
Add .env.example with configuration for database, Redis, security, SMTP, workers, and plugins. Add .gitignore for Python, Node.js, Next.js, Docker volumes, and IDE files. Add MIT License. Update README.md with feature overview, quick start guide, architecture description, plugin system documentation, security details, backup/restore instructions, and developer setup. Add Alembic configuration files and placeholder directories for API, web, worker, and plugin components
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@nexadash/shared",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.6.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
export const APP_NAME = "NexaDash";
|
||||
export const DEFAULT_LOCALE = "en";
|
||||
export const SUPPORTED_LOCALES = ["en", "de"];
|
||||
export const DEFAULT_THEME = "system";
|
||||
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000";
|
||||
|
||||
export const PERMISSIONS = {
|
||||
USER_READ: "user:read",
|
||||
USER_WRITE: "user:write",
|
||||
USER_DELETE: "user:delete",
|
||||
USER_INVITE: "user:invite",
|
||||
ROLE_READ: "role:read",
|
||||
ROLE_WRITE: "role:write",
|
||||
DASHBOARD_READ: "dashboard:read",
|
||||
DASHBOARD_WRITE: "dashboard:write",
|
||||
DASHBOARD_DELETE: "dashboard:delete",
|
||||
DASHBOARD_SHARE: "dashboard:share",
|
||||
PLUGIN_READ: "plugin:read",
|
||||
PLUGIN_WRITE: "plugin:write",
|
||||
PLUGIN_DELETE: "plugin:delete",
|
||||
PLUGIN_ADMIN: "plugin:admin",
|
||||
PLUGIN_INSTALL: "plugin:install",
|
||||
CONNECTION_READ: "connection:read",
|
||||
CONNECTION_WRITE: "connection:write",
|
||||
CONNECTION_DELETE: "connection:delete",
|
||||
CONNECTION_TEST: "connection:test",
|
||||
SYSTEM_READ: "system:read",
|
||||
SYSTEM_WRITE: "system:write",
|
||||
AUDIT_READ: "audit:read",
|
||||
BACKUP_RESTORE: "backup:restore",
|
||||
API_TOKEN_READ: "api_token:read",
|
||||
API_TOKEN_WRITE: "api_token:write",
|
||||
} as const;
|
||||
|
||||
export const STATUS_COLORS = {
|
||||
ok: "bg-emerald-500",
|
||||
warning: "bg-amber-500",
|
||||
error: "bg-rose-500",
|
||||
critical: "bg-rose-600",
|
||||
info: "bg-blue-500",
|
||||
unknown: "bg-slate-400",
|
||||
} as const;
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./types";
|
||||
export * from "./constants";
|
||||
@@ -0,0 +1,147 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
is_active: boolean;
|
||||
is_superuser: boolean;
|
||||
is_owner: boolean;
|
||||
locale: string;
|
||||
theme: string;
|
||||
timezone: string;
|
||||
role?: Role;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
permissions: string[];
|
||||
is_system: boolean;
|
||||
}
|
||||
|
||||
export interface Dashboard {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
folder: string;
|
||||
is_favorite: boolean;
|
||||
is_public: boolean;
|
||||
owner_id: string;
|
||||
layout: Record<string, any>;
|
||||
layouts_by_breakpoint: Record<string, any>;
|
||||
refresh_interval_seconds?: number;
|
||||
order_index: number;
|
||||
tags: string[];
|
||||
widgets: Widget[];
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface Widget {
|
||||
id: string;
|
||||
dashboard_id: string;
|
||||
plugin_id: string;
|
||||
widget_type: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
position_x: number;
|
||||
position_y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
min_width?: number;
|
||||
min_height?: number;
|
||||
max_width?: number;
|
||||
max_height?: number;
|
||||
order_index: number;
|
||||
settings: Record<string, any>;
|
||||
instance_id?: string;
|
||||
is_visible: boolean;
|
||||
is_static: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface Plugin {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
description?: string;
|
||||
author?: string;
|
||||
category: string;
|
||||
icon?: string;
|
||||
is_active: boolean;
|
||||
is_builtin: boolean;
|
||||
is_installed: boolean;
|
||||
permissions: string[];
|
||||
settings_schema: Record<string, any>;
|
||||
credentials_schema: Record<string, any>;
|
||||
widget_types: any[];
|
||||
healthcheck_definition: Record<string, any>;
|
||||
api_routes: string[];
|
||||
has_frontend: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface PluginInstance {
|
||||
id: string;
|
||||
plugin_id: string;
|
||||
service_connection_id?: string;
|
||||
name: string;
|
||||
settings: Record<string, any>;
|
||||
is_enabled: boolean;
|
||||
health_status: string;
|
||||
health_message?: string;
|
||||
last_sync_at?: string;
|
||||
last_error?: string;
|
||||
error_count: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ServiceConnection {
|
||||
id: string;
|
||||
name: string;
|
||||
plugin_id: string;
|
||||
base_url: string;
|
||||
verify_tls: boolean;
|
||||
timeout_seconds: number;
|
||||
credentials_id?: string;
|
||||
is_enabled: boolean;
|
||||
health_status: string;
|
||||
health_message?: string;
|
||||
extra_headers: Record<string, string>;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
id: string;
|
||||
user_id: string;
|
||||
title: string;
|
||||
message?: string;
|
||||
type: string;
|
||||
is_read: boolean;
|
||||
link?: string;
|
||||
metadata: Record<string, any>;
|
||||
read_at?: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface AuditLog {
|
||||
id: string;
|
||||
user_id?: string;
|
||||
action: string;
|
||||
resource_type: string;
|
||||
resource_id?: string;
|
||||
ip_address?: string;
|
||||
user_agent?: string;
|
||||
details: Record<string, any>;
|
||||
severity: string;
|
||||
timestamp: string;
|
||||
created_at: string;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user