Skip to content

Commit

Permalink
Merge branch 'main' into Inuka
Browse files Browse the repository at this point in the history
  • Loading branch information
inuksperera committed Mar 24, 2024
2 parents 80aa427 + c5fe889 commit 52e876c
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use a base image with Node.js and Chromium installed
FROM node:18

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN yarn

COPY Frontend/package*.json ./

RUN cd Frontend && yarn

COPY Backend/package*.json ./

RUN cd Backend && yarn

RUN yarn upgrade

RUN yarn electron:build

# Copy the Electron application source code into the container
COPY . .

EXPOSE 8080

CMD ["npm", "electron:serve"]
58 changes: 57 additions & 1 deletion Electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const {
shell,
session
} = require("electron");
const isDev = false;
const windowStateKeeper = require("electron-window-state");
const path = require("path");
const {
Expand Down Expand Up @@ -40,6 +39,8 @@ function createWindow() {
const primaryDisplay = screen.getPrimaryDisplay();
const primaryDisplayBounds = primaryDisplay.bounds;

const isDev = app.isPackaged ? false : true;

const win = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
Expand Down Expand Up @@ -81,6 +82,61 @@ function createWindow() {
},
});

const template = [
{
label: 'SYNK',
submenu: [
{
label: 'About SYNK',
click() {
dialog.showMessageBox(win, {
type: 'info',
icon: path.join(__dirname, 'icon.png'),
message: 'SYNK',
detail: 'v0.1.0 \n\n©2024 Clueless Jellybeans',
buttons: ['Ok'],
defaultId: 0
})
}
},
{
type: 'separator'
},
{
label: 'Hide SYNK',
click() {
win.hide()
},
},
{
type: 'separator'
},

{
label: 'Show SYNK',
click() {
win.show()
},
},
{
type: 'separator'
},

{
label: 'Quit SYNK',
click() {
win.close()
}
},
]
}
];

if(!isDev) {
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}

splashScreen.loadFile(
isDev
? './Frontend/public/preload.html'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"chart.js": "^4.4.2",
"child_process": "^1.0.2",
"chokidar": "^3.6.0",
"electron-is-dev": "^3.0.1",
"electron-packager": "^17.1.2",
"electron-tray-window": "^1.2.7",
"electron-window-state": "^5.0.3",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4818,6 +4818,11 @@ electron-download@^4.1.0:
semver "^5.4.1"
sumchecker "^2.0.2"

electron-is-dev@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-3.0.1.tgz#1cbc79b1dd046787903acd357efdfab6549dc17a"
integrity sha512-8TjjAh8Ec51hUi3o4TaU0mD3GMTOESi866oRNavj9A3IQJ7pmv+MJVmdZBFGw4GFT36X7bkqnuDNYvkQgvyI8Q==

electron-packager@^17.1.2:
version "17.1.2"
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-17.1.2.tgz#18030b28024d242b706d0a8a67ed4cd1a57311aa"
Expand Down

0 comments on commit 52e876c

Please sign in to comment.