diff --git a/gui/package.json b/gui/package.json index d9f77e0..44ab6d6 100644 --- a/gui/package.json +++ b/gui/package.json @@ -8,6 +8,7 @@ "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", + "prepublish":"echo WARN: : TODO: implement logic to mirror source code from gitlab onto github for distribution.", "publish": "electron-forge publish" }, "devDependencies": { diff --git a/gui/src/main/BaseComponent.js b/gui/src/main/BaseComponent.js new file mode 100644 index 0000000..c6a1e83 --- /dev/null +++ b/gui/src/main/BaseComponent.js @@ -0,0 +1,13 @@ +// src/main/BaseComponent.js +class BaseComponent { + constructor() { + // Common properties of components can be initialized here + } + + // Common methods shared by all components + initialize() { + // Initialization code common to all components + } +} + +module.exports = BaseComponent; diff --git a/gui/src/main/BaseSystem.js b/gui/src/main/BaseSystem.js new file mode 100644 index 0000000..22165a8 --- /dev/null +++ b/gui/src/main/BaseSystem.js @@ -0,0 +1,17 @@ +// src/main/BaseSystem.js +class BaseSystem { + constructor(name) { + this.name = name; + console.log(`[${this.name}] System created`); + } + + initialize() { + // Initialization code common to all systems + } + + log(message) { + console.log(`[${this.name}] ${message}`); + } +} + +module.exports = BaseSystem; diff --git a/gui/src/main/EventComponent.js b/gui/src/main/EventComponent.js new file mode 100644 index 0000000..f424055 --- /dev/null +++ b/gui/src/main/EventComponent.js @@ -0,0 +1,16 @@ +// src/main/EventComponent.js +const BaseComponent = require('./BaseComponent'); + +class EventComponent extends BaseComponent { + constructor(type, data) { + super(); + this.type = type; + this.data = data; + } + + dispatch(ipcMain) { + ipcMain.emit(this.type, this.data); + } +} + +module.exports = EventComponent; diff --git a/gui/src/main/EventSystem.js b/gui/src/main/EventSystem.js index c7d0721..bb5cb50 100644 --- a/gui/src/main/EventSystem.js +++ b/gui/src/main/EventSystem.js @@ -1,21 +1,22 @@ // src/main/EventSystem.js const { ipcMain } = require('electron'); +const BaseSystem = require('./BaseSystem'); -class EventSystem { +class EventSystem extends BaseSystem { constructor() { - console.log("[EVENT-SYSTEM] created"); + super('EVENT-SYSTEM'); this.initializeIpcListeners(); } initializeIpcListeners() { ipcMain.on('renderer-event', (event, arg) => { - console.log('[EVENT-SYSTEM] Received message from renderer:', arg); + this.log('Received message from renderer: ' + arg); event.reply('main-event-response', 'Response from main process'); }); } test() { - console.log('[EVENT-SYSTEM] test function executed'); + this.log('test function executed'); } } diff --git a/gui/src/main/main.js b/gui/src/main/main.js index 103f52a..5ce2d55 100644 --- a/gui/src/main/main.js +++ b/gui/src/main/main.js @@ -46,4 +46,4 @@ app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } -}); \ No newline at end of file +}); diff --git a/gui/src/renderer/RendererBaseSystem.js b/gui/src/renderer/RendererBaseSystem.js new file mode 100644 index 0000000..4046b0b --- /dev/null +++ b/gui/src/renderer/RendererBaseSystem.js @@ -0,0 +1,15 @@ +// src/renderer/RendererBaseSystem.js +export default class RendererBaseSystem { + constructor(name) { + this.name = name; + console.log(`[${this.name}] System created`); + } + + initialize() { + // Initialization code common to all renderer systems + } + + log(message) { + console.log(`[${this.name}] ${message}`); + } +} diff --git a/gui/src/renderer/RendererEventSystem.js b/gui/src/renderer/RendererEventSystem.js index ef7efe0..bc0c489 100644 --- a/gui/src/renderer/RendererEventSystem.js +++ b/gui/src/renderer/RendererEventSystem.js @@ -1,18 +1,20 @@ // src/renderer/RendererEventSystem.js -export default class RendererEventSystem { - constructor() { - console.log("[R-EVENT-SYSTEM] created"); - this.initializeIpcListeners(); - } +import RendererBaseSystem from './RendererBaseSystem'; - initializeIpcListeners() { - window.api.receive('main-event-response', (data) => { - console.log('[R-EVENT-SYSTEM] Received response from main process:', data); - }); - } +export default class RendererEventSystem extends RendererBaseSystem { + constructor() { + super('R-EVENT-SYSTEM'); + this.initializeIpcListeners(); + } - test() { - console.log('[R-EVENT-SYSTEM] test function executed'); - window.api.send('renderer-event', 'Hello to Better Prompts'); - } + initializeIpcListeners() { + window.api.receive('main-event-response', (data) => { + this.log('Received response from main process: ' + data); + }); + } + + test() { + this.log('test function executed'); + window.api.send('renderer-event', 'Hello to Better Prompts'); + } } diff --git a/gui/src/renderer/index.html b/gui/src/renderer/index.html index af3c5ac..d5342f8 100644 --- a/gui/src/renderer/index.html +++ b/gui/src/renderer/index.html @@ -2,10 +2,10 @@ - Better Prompt - Tonic AI + Better Prompts - Tonic AI -

💖 Better Prompt - Prompt Development Environment

-

An innovative platform for crafting, testing, and sharing AI prompts. PDE is where developers, researchers, and AI enthusiasts converge to push the boundaries of conversational AI.

+

💖 Better Prompts - An Integrated Prompt Development Environment

+

An open and innovative free platform for crafting, testing, and sharing AI prompts. Better Prompts IPDE is where developers, researchers, and AI enthusiasts converge to push the boundaries of conversational AI.

diff --git a/gui/src/renderer/renderer.js b/gui/src/renderer/renderer.js index 618ddfe..116c16b 100644 --- a/gui/src/renderer/renderer.js +++ b/gui/src/renderer/renderer.js @@ -1,4 +1,4 @@ -// renderer.js +// src/renderer/renderer.js import './index.css'; import RendererEventSystem from './RendererEventSystem';