Start delivering small, slick, cross-platform desktop application with this starter repo utilizing python's Flask and the jinja-flowbite Jinja package.
Use the Discussion section for questions, suggestions and issues.
The desktop application consists of a server-side, python webapp displayed in a native WebView control and distributed as a single, standalone executable
The tech stack is intentionally simple and approachable such that any intermediate software engineer should be able to pickup, experiment, and go quickly.
Tech Stack:
- The Interactive SSR WebApp:
- The Desktop
- pywebview for hosting the python webapp in a native desktop window
- pyinstaller for bundling the application into a standalone, single file exe
- Install python 3.11 or newer
- Install Nodejs LTS (
currently v20.9.0
) - Visual Studio Code
- Pylance:
ms-python.vscode-pylance
- Tailwind CSS Intellisense:
bradlc.vscode-tailwindcss
- Jinja:
wholroyd.jinja
- Jinja2 Snippet Kit:
wyattferguson.jinja2-snippet-kit
- BetterJinja:
samuelcolvin.jinjahtml
- Markdown All in One:
yzhang.markdown-all-in-one
- markdownlint:
davidanson.vscode-markdownlint
python -m venv venv
.\venv\Scripts\activate # windows
source ./venv/bin/activate # linux
pip install -r requirements.txt
Use the Discussion section for questions, suggestions and issues.
This is Flowbite and Tailwind CSS minification.
npm install
Use the Discussion section for questions, suggestions and issues.
Development consists of two parallel
command-line tools running simultaneously.
-
tailwindcss minification
npm run watchcss
-
flask web server
.\venv\Scripts\activate npm run webdev
With the above vscode extensions installed, one may set breakpoints and run via the vscode debugger by pressing the F5 key.
.\venv\Scripts\activate
npm run desktop
Use the Discussion section for questions, suggestions and issues.
WARNING. Distributable executables should be created by a CICD pipeline.
-
If needed, update the version found in
build.ps1
orbuild.sh
file -
From a terminal run the following command to build the single file, standalone exe:
.\venv\Scripts\activate # only run if the venv is not active npm run dist # for windows, use `distnix` for linux and osx
- The
/dist
directory contains the build .exe - The
desktop.spec
file may be tailored to your application's needs.
- The
Use the Discussion section for questions, suggestions and issues.