This boilerplate provides a solid foundation for developing Windows applications using a full-stack web application developed with HTML, CSS, and JavaScript (front-end, back-end, and local database).
While initially configured for Windows, it can be adapted for Linux applications as well.
The build will provide you with a portable version and a "setup.exe".
This application is a comprehensive "all-in-one" solution, which deploys all necessary services with a single command.
It is built upon:
The boilerplate consists of two important parts:
server side: contains Electron, the Express API, and the database
client side: contains the interface, which can be edited as needed and then built into static files for Electron to use.
Install requirements
yarn installation
This command installs the required dependencies by running "yarn install" in both the main project and the interface project.
Configuration
DEBUG=TRUE/FALSE - Enables or disables live changes view in Electron using "yarn dev"
CONSOLE=TRUE/FALSE - Displays browser development tools in Electron using "yarn dev"
Development
This command opens a window in your browser and a previewing of the Electron application.
yarn dev
Alternatively, you can simply open the client using:
yarn serve:client
Similarly, there are also the following commands:
yarn start
yarn start:client
Build
This command builds the Svelte project (client) into a static folder. It then generates a "dist" folder with the "windows-unpacked" version and an "app-setup.exe" inside.
yarn build
Alternatively, you can build the Svelte project in static version, with the "www" folder being named "interface":
yarn build:client
🔴 Default ports of the application in dev mode:
Interface: 57805
API: 57806
🔴 Database use example:
There are 4 API requests showing examples of basic usage of the local database, whose functions are defined in "database/db.js"
Default URL: http://localhost:57806
{
"name": "John",
"age": 32
}
{
"data": {
"name": "John",
"age": 32,
"_id": "jNofwTqfxvh8vP0e"
}
}
{
"data": [
{
"name": "John",
"age": 32,
"_id": "jNofwTqfxvh8vP0e"
}
]
}
{
"name": "Oscar",
"age": 37
}
{
"message": "Document updated successfully.",
"data": [
{
"name": "Oscar",
"age": 37,
"_id": "jNofwTqfxvh8vP0e"
}
]
}
{
"message": "Document removed successfully."
}