-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
278 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# examples | ||
Nuvanti example applications | ||
This repository contains official Nuvanti example applications. | ||
|
||
- northwind: The customer/products/vendor sample database application implemented in Nuvanti | ||
- simple_crm: A simple CRM (customer relationship management) that leverages Nuvanti's higher level CRM model | ||
- starter: Empty RAD model based application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { createBasicUiModel } from "@nuvanti/basic-ui-model"; | ||
import { createRadModel } from "@nuvanti/rad-model"; | ||
import {} from "@nuvanti/ui"; | ||
import { modify } from "@nuvanti/ts-style"; | ||
|
||
const { radModel, addTable, generateFromRad } = createRadModel({ | ||
name: "Nuvanti", | ||
id: "AMacekin", | ||
defaultFieldDisplay: () => { | ||
throw ""; | ||
}, | ||
defaultFormField: () => { | ||
throw ""; | ||
}, | ||
}); | ||
|
||
addTable("User", (table) => { | ||
table.nuvaId("globalId").nonNull().unique(); | ||
table.bool("disabled").nonNull(); | ||
}); | ||
|
||
addTable("Category", (table) => { | ||
table.string("name", 15); | ||
table.string("description", 500); | ||
table.selectFormControl(); | ||
}); | ||
|
||
const { addPage, generateUi } = createBasicUiModel(); | ||
|
||
// addPage({ | ||
// path: "/", | ||
// content: simpleEditableGridPage({ table: "Category", radModel }), | ||
// }); | ||
|
||
// const shell = simpleNavbar({ | ||
// links: [ | ||
// { label: "Home", path: "/" }, | ||
// { label: "Categories", path: "/categories" }, | ||
// { label: "Contacts", path: "/contacts" }, | ||
// { label: "Peeps", path: "/peeps" }, | ||
// ], | ||
// }); | ||
|
||
/** @type {import("@nuvanti/runtime-model").RuntimeModel} */ | ||
export const app = { | ||
...generateFromRad(), | ||
ui: generateUi(shell, createUiModel), | ||
runProfile: [ | ||
{ | ||
asUser: `AMacekin`, | ||
name: "default", | ||
procedure: [ | ||
modify( | ||
`insert into db.User (globalId, disabled) values (cast('AMacekin' as NuvaId), false)` | ||
), | ||
], | ||
time: `2021-11-11T16:37:49.715Z`, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
"checkJs": true, | ||
"lib": ["ESNext"], | ||
"esModuleInterop": true, // force import | ||
"moduleResolution": "node", | ||
|
||
"allowSyntheticDefaultImports": true // force import | ||
}, | ||
|
||
"include": ["app.js"], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@nuvanti/example-northwind", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"license": "NUVANTI", | ||
"scripts": { | ||
"save": "node ../app-scripts/save.js", | ||
"start": "node ../app-scripts/start.js" | ||
}, | ||
"dependencies": { | ||
"@nuvanti/ui": "*", | ||
"@nuvanti/rad-model": "*", | ||
"@nuvanti/ts-style": "*", | ||
"@nuvanti/basic-ui-model": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { createBasicUiModel } from "@nuvanti/basic-ui-model"; | ||
import { createRadModel } from "@nuvanti/rad-model"; | ||
import {} from "@nuvanti/ui"; | ||
import { modify } from "@nuvanti/ts-style"; | ||
|
||
const { radModel, addTable, generateFromRad } = createRadModel({ | ||
name: "Nuvanti", | ||
id: "AMacekin", | ||
defaultFieldDisplay: () => { | ||
throw ""; | ||
}, | ||
defaultFormField: () => { | ||
throw ""; | ||
}, | ||
}); | ||
|
||
addTable("User", (table) => { | ||
table.nuvaId("globalId").nonNull().unique(); | ||
table.bool("disabled").nonNull(); | ||
}); | ||
|
||
addTable("Category", (table) => { | ||
table.string("name", 15); | ||
table.string("description", 500); | ||
table.selectFormControl(); | ||
}); | ||
|
||
const { addPage, generateUi } = createBasicUiModel(); | ||
|
||
// addPage({ | ||
// path: "/", | ||
// content: simpleEditableGridPage({ table: "Category", radModel }), | ||
// }); | ||
|
||
// const shell = simpleNavbar({ | ||
// links: [ | ||
// { label: "Home", path: "/" }, | ||
// { label: "Categories", path: "/categories" }, | ||
// { label: "Contacts", path: "/contacts" }, | ||
// { label: "Peeps", path: "/peeps" }, | ||
// ], | ||
// }); | ||
|
||
/** @type {import("@nuvanti/runtime-model").RuntimeModel} */ | ||
export const app = { | ||
...generateFromRad(), | ||
ui: generateUi(shell, createUiModel), | ||
runProfile: [ | ||
{ | ||
asUser: `AMacekin`, | ||
name: "default", | ||
procedure: [ | ||
modify( | ||
`insert into db.User (globalId, disabled) values (cast('AMacekin' as NuvaId), false)` | ||
), | ||
], | ||
time: `2021-11-11T16:37:49.715Z`, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
"checkJs": true, | ||
"lib": ["ESNext"], | ||
"esModuleInterop": true, // force import | ||
"moduleResolution": "node", | ||
|
||
"allowSyntheticDefaultImports": true // force import | ||
}, | ||
|
||
"include": ["app.js"], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@nuvanti/example-simple-crm", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"license": "NUVANTI", | ||
"scripts": { | ||
"save": "node ../app-scripts/save.js", | ||
"start": "node ../app-scripts/start.js" | ||
}, | ||
"dependencies": { | ||
"@nuvanti/ui": "*", | ||
"@nuvanti/rad-model": "*", | ||
"@nuvanti/ts-style": "*", | ||
"@nuvanti/basic-ui-model": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { createBasicUiModel } from "@nuvanti/basic-ui-model"; | ||
import { createRadModel } from "@nuvanti/rad-model"; | ||
import { } from "@nuvanti/ui"; | ||
import { modify } from "@nuvanti/ts-style"; | ||
|
||
const { radModel, addTable, generateFromRad } = createRadModel({ | ||
name: "Nuvanti", | ||
id: "AMacekin", | ||
defaultFieldDisplay: () => { | ||
throw ""; | ||
}, | ||
defaultFormField: () => { | ||
throw ""; | ||
}, | ||
}); | ||
|
||
addTable("User", (table) => { | ||
table.nuvaId("globalId").nonNull().unique(); | ||
table.bool("disabled").nonNull(); | ||
}); | ||
|
||
addTable("Category", (table) => { | ||
table.string("name", 15); | ||
table.string("description", 500); | ||
table.selectFormControl(); | ||
}); | ||
|
||
const { addPage, generateUi } = createBasicUiModel(); | ||
|
||
// addPage({ | ||
// path: "/", | ||
// content: simpleEditableGridPage({ table: "Category", radModel }), | ||
// }); | ||
|
||
// const shell = simpleNavbar({ | ||
// links: [ | ||
// { label: "Home", path: "/" }, | ||
// { label: "Categories", path: "/categories" }, | ||
// { label: "Contacts", path: "/contacts" }, | ||
// { label: "Peeps", path: "/peeps" }, | ||
// ], | ||
// }); | ||
|
||
/** @type {import("@nuvanti/runtime-model").RuntimeModel} */ | ||
export const app = { | ||
...generateFromRad(), | ||
ui: generateUi(shell, createUiModel), | ||
runProfile: [ | ||
{ | ||
asUser: `AMacekin`, | ||
name: "default", | ||
procedure: [ | ||
modify( | ||
`insert into db.User (globalId, disabled) values (cast('AMacekin' as NuvaId), false)` | ||
), | ||
], | ||
time: `2021-11-11T16:37:49.715Z`, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
"checkJs": true, | ||
"lib": ["ESNext"], | ||
"esModuleInterop": true, // force import | ||
"moduleResolution": "node", | ||
|
||
"allowSyntheticDefaultImports": true // force import | ||
}, | ||
|
||
"include": ["app.js"], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@nuvanti/example-starter", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"license": "NUVANTI", | ||
"scripts": { | ||
"save": "node ../app-scripts/save.js", | ||
"start": "node ../app-scripts/start.js" | ||
}, | ||
"dependencies": { | ||
"@nuvanti/ui": "*", | ||
"@nuvanti/rad-model": "*", | ||
"@nuvanti/ts-style": "*", | ||
"@nuvanti/basic-ui-model": "*" | ||
} | ||
} |