Init Commit

This commit is contained in:
KarimTamani
2025-05-04 19:17:04 +01:00
commit d9905351bd
61 changed files with 3015 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
export const colorOptions = [
"#fd7f6f", // Warm coral red
"#7eb0d5", // Soft sky blue
"#b2e061", // Fresh lime green
"#bd7ebe", // Soft lavender pink
"#ffb55a", // Vibrant orange
"#ffee65", // Warm yellow
"#beb9db", // Light purple grey
"#fdcce5", // Light blush pink
"#8bd3c7", // Minty teal
"#f4a1a1", // Soft peachy red
"#9bd78c", // Fresh pastel green
"#d1a9e0" // Light lilac purple
];
export const randomColor = () => {
return colorOptions[Math.floor(Math.random() * colorOptions.length)];
};
+4
View File
@@ -0,0 +1,4 @@
export interface DataType {
id: string;
name: string;
}
+14
View File
@@ -0,0 +1,14 @@
import { DataType } from "../data/data-types";
export interface Field {
id: string;
name: string;
type: DataType;
primaryKey: boolean;
unique: boolean;
nullable: boolean;
createdAt: number;
default?: string;
}
+22
View File
@@ -0,0 +1,22 @@
export interface Relationship {
id: string;
name: string;
sourceSchema?: string;
sourceTableId: string;
targetSchema?: string;
targetTableId: string;
sourceFieldId: string;
targetFieldId: string;
sourceCardinality: Cardinality;
targetCardinality: Cardinality;
createdAt: number;
}
export type RelationshipType =
| 'one_to_one'
| 'one_to_many'
| 'many_to_one'
| 'many_to_many';
export type Cardinality = 'one' | 'many';
+14
View File
@@ -0,0 +1,14 @@
import { Field } from "./field";
export interface Table {
id: string;
name: string;
x: number;
y: number;
fields: Field[];
width?: number;
order?: number;
color: string;
createdAt: number;
comments?: string;
}