Skip to content

Project Structure

---
title: Overview
---
graph LR
    A{share codebase} -->|copy to| B[Program]
    A -->|copy to| C[Compute Node]
    A -->|copy to| D[Web]
    A -->|copy to| E[Electron]
    A -->|copy to| F[Express]
    B -->|build| G((EXE))
    G -.->|needs| C
    G -.->|needs| E
    G -.->|needs| F
    D -->|build| H((HTML))
    E -->|build| I((msi, deb Files))
    F -->|build| J((NodeJS Files))
    style G fill:#f7d899
    style H fill:#f7d899
    style I fill:#f7d899
    style J fill:#f7d899
    style A fill:#eccafc

Share

It's a codebase which share in different application

Source code path location

It's locate at src/share

"Share" Action

Which start copy the code into different folder

npm run share

Modify Notice

So if you want to modify the core logic
You should modify the content in the src/share
Example:
If you edit the code in src/main/client/....
After share command, your modify action will be gone

Worker

The executable program which run the task logic on it.
This program is called by runner. In order to implement multithread logic in NodeJS environment

Source code path location

It's locate at src/program The program entry point is src/program/worker.ts

Build program

Use command below to package the program to executable file

# Build exe depend on current os
npm run pkg
# Build worker.exe which run on windows
npm run pkg win
# Build worker.exe which run on mac
npm run pkg mac
# Build worker.exe which run on linux
npm run pkg linux
The output will locate at ./bin folder

Clean build application warning

If you have multiple executable in the bin folder
And you build the electron application or express application
They will copy the entire bin folder, which means it will copy the unnecessary files to output
Make sure delete bin folder before build any runner application

Runner

Static Web

Simple task management host by browser, which it close when user close browser
It's unreliable you could said, But easy deploy

Notices:

  • Backend
  • Playground
  • Authentication

Source code path location

It's locate at src/renderer

Build html

Use command below to use vite package the renderer to html files

# Output html files
npm run build:web
The output will locate at ./build/renderer folder

Electron Application

Notices:

  • Backend
  • Playground
  • Authentication

Source code path location

Frontend locate at src/renderer Backend locate at src/main

Build electron

Use command below to package the electron app to installation files

# Build electron app depend on current os
npm run build
# Build electron app which run on windows (.msi)
npm run build:win
# Build electron app which run on mac
npm run build:mac
# Build electron app which run on linux (.deb)
npm run build:linux
The output will locate at ./dist folder

Express Server

Notices:

  • Backend
  • Playground
  • Authentication

It's nodejs express server which hosting the backend

Source code path location

Frontend locate at src/renderer Backend locate at src/server

Build express

Use command below to package the express to nodejs deploy files

# Output nodejs files
npm run build:server
The output will locate at ./build/server folder

Compute Node

It's the client side application, it recevied server signal and do the calculation then return the info etc...
It runs without user interface

Source code path location

It's locate at src/node

Build node

Use command below to package the express to nodejs deploy files

# Output nodejs files
npm run build:node
The output will locate at ./build/node folder