Skip to content

Commit

Permalink
- Implemented Client/Server model
Browse files Browse the repository at this point in the history
- Created Postgres Database
- Enabled OpenApi endpoint </_nitro/openapi.json>
- defined server APIs
- Added database migration infrastructure
- Enabled server debugging
- Moved domain and application layers to server
- Added row events to XDataTable
- Introduced debouncing for rationale
- removed legacy
  • Loading branch information
mlhaufe committed Jul 14, 2024
1 parent ca51f58 commit d7721b4
Show file tree
Hide file tree
Showing 291 changed files with 7,130 additions and 3,257 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/compose.extend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
web:
image: node:22-bookworm
depends_on:
- db
restart: unless-stopped
# mounts the workspace folder from the local source tree into the Dev Container.
volumes:
- .:/workspace/cathedral:cached
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
# puts the Dev Container on the same network as the database, so that it can access it on localhost
network_mode: service:db
13 changes: 10 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Node.js",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/javascript-node:dev-22-bookworm",
"name": "Cathedral",
"dockerComposeFile": [
"../compose.yml",
"compose.extend.yml"
],
"service": "web",
"workspaceFolder": "/workspace/${localWorkspaceFolderBasename}",
"shutdownAction": "stopCompose",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",
// https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand Down
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_DB: cathedral
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ logs
public/apple-touch-icon-*.png
public/favicon.ico
public/maskable-icon-*.png
public/pwa-*.png

# database
server/data/db/cathedral.sqlite
public/pwa-*.png
33 changes: 33 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "server: nuxt",
"outputCapture": "std",
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
"args": [
"dev"
],
}
],
"compounds": [
{
"name": "fullstack: nuxt",
"configurations": [
"server: nuxt",
"client: chrome"
]
}
]
}
3 changes: 1 addition & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export default defineAppConfig({
darkMode: 'light',
connString: 'idb://cathedral'
darkMode: 'light'
})
4 changes: 0 additions & 4 deletions application/AssumptionInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/ComponentInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/ConstraintCategoryInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/ConstraintInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/EffectInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/FunctionalBehaviorInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/GlossaryTermInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/GoalInteractor.ts

This file was deleted.

30 changes: 0 additions & 30 deletions application/Interactor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/InvariantInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/LimitInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/NonFunctionalBehaviorInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/ObstacleInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/OutcomeInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/PersonInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/SolutionInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/StakeholderCategoryInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/StakeholderInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/StakeholderSegmentationInteractor.ts

This file was deleted.

3 changes: 0 additions & 3 deletions application/UseCase.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/UseCaseInteractor.ts

This file was deleted.

4 changes: 0 additions & 4 deletions application/UserStoryInteractor.ts

This file was deleted.

27 changes: 20 additions & 7 deletions components/XDataTable.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<script lang="ts" setup>
import { type Uuid, emptyUuid } from '~/domain/Uuid'
import { type Uuid, emptyUuid } from '~/server/domain/Uuid'
// export type RowType = { id: Uuid, name: string }
export type RowType = any
const props = defineProps<{
datasource: RowType[],
datasource: RowType[] | null,
filters: Record<string, { value: any, matchMode: string }>,
emptyRecord: { id: Uuid, name: string },
onCreate: (data: RowType) => Promise<void>,
onDelete: (id: Uuid) => Promise<void>,
onUpdate: (data: RowType) => Promise<void>
onUpdate: (data: RowType) => Promise<void>,
onRowExpand?: (event: { data: RowType }) => void,
onRowCollapse?: (event: { data: RowType }) => void
}>()
const dataTable = ref<any>(),
Expand All @@ -20,8 +22,8 @@ const dataTable = ref<any>(),
confirm = useConfirm()
const onCreateEmpty = async () => {
props.datasource.unshift(Object.assign({}, props.emptyRecord))
editingRows.value = [props.datasource[0]]
(props.datasource ?? []).unshift(Object.assign({}, props.emptyRecord))
editingRows.value = [(props.datasource ?? [])[0]]
createDisabled.value = true
// remove the sortfield to avoid the new row from being sorted
sortField.value = undefined
Expand Down Expand Up @@ -52,11 +54,21 @@ const onCancel = ({ data, index }: { data: RowType, index: number }) => {
if (data.id !== emptyUuid)
return
props.datasource.splice(index, 1)
(props.datasource ?? []).splice(index, 1)
createDisabled.value = false
sortField.value = 'name'
}
const onRowExpand = (event: { data: RowType }) => {
if (props.onRowExpand)
props.onRowExpand(event)
}
const onRowCollapse = (event: { data: RowType }) => {
if (props.onRowCollapse)
props.onRowCollapse(event)
}
const onRowEditSave = async (event: { newData: RowType, originalEvent: Event }) => {
const { newData, originalEvent } = event
Expand Down Expand Up @@ -121,7 +133,8 @@ const onSort = (event: any) => {
<DataTable ref="dataTable" :value="props.datasource as unknown as any[]" dataKey="id" filterDisplay="row"
v-model:filters="filters as any" :globalFilterFields="Object.keys(filters)" editMode="row"
@row-edit-init="onRowEditInit" v-model:editingRows="editingRows" @row-edit-save="onRowEditSave"
@row-edit-cancel="onCancel" @sort="onSort" :sortField="sortField" :sortOrder="1">
@row-edit-cancel="onCancel" @row-expand="onRowExpand" @row-collapse="onRowCollapse" @sort="onSort"
:sortField="sortField" :sortOrder="1">
<slot></slot>
<Column frozen align-frozen="right">
<template #body="{ data, editorInitCallback }">
Expand Down
16 changes: 16 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
db:
image: postgres:16-bookworm
restart: unless-stopped
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}

volumes:
postgres-data:
6 changes: 0 additions & 6 deletions data/AssumptionRepository.ts

This file was deleted.

6 changes: 0 additions & 6 deletions data/ComponentRepository.ts

This file was deleted.

6 changes: 0 additions & 6 deletions data/ConstraintCategoryRepository.ts

This file was deleted.

6 changes: 0 additions & 6 deletions data/ConstraintRepository.ts

This file was deleted.

6 changes: 0 additions & 6 deletions data/EffectRepository.ts

This file was deleted.

8 changes: 0 additions & 8 deletions data/FunctionalBehaviorRepository.ts

This file was deleted.

6 changes: 0 additions & 6 deletions data/GlossaryTermRepository.ts

This file was deleted.

Loading

0 comments on commit d7721b4

Please sign in to comment.