{"id":19379565,"url":"https://github.com/hercules2013/electron-fastapi","last_synced_at":"2026-05-02T20:32:52.962Z","repository":{"id":218535535,"uuid":"701019978","full_name":"Hercules2013/electron-fastapi","owner":"Hercules2013","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-05T18:42:57.000Z","size":5544,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T05:44:30.482Z","etag":null,"topics":["electron","fastapi","python"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hercules2013.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-10-05T18:42:19.000Z","updated_at":"2023-12-07T18:55:37.000Z","dependencies_parsed_at":"2024-01-22T17:08:35.655Z","dependency_job_id":null,"html_url":"https://github.com/Hercules2013/electron-fastapi","commit_stats":null,"previous_names":["hercules757/electron-fastapi","hercules2013/electron-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hercules2013%2Felectron-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hercules2013%2Felectron-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hercules2013%2Felectron-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hercules2013%2Felectron-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hercules2013","download_url":"https://codeload.github.com/Hercules2013/electron-fastapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240515094,"owners_count":19813797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","fastapi","python"],"created_at":"2024-11-10T09:10:34.149Z","updated_at":"2026-05-02T20:32:42.949Z","avatar_url":"https://github.com/Hercules2013.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Electron JS Python Fast API](https://raw.githubusercontent.com/gnoviawan/fast-api-electron-js/main/public/assets/media/logo/electron-fastapi.png)\n\n# Electron JS x Python Fast API\n\u003e Modern web UI x Python FAST API\n\n## Preview\n![Fast API Electron JS Preview](https://raw.githubusercontent.com/gnoviawan/fast-api-electron-js/main/public/assets/media/logo/python-electronjs.gif)\n\n\n\n## Prerequisite\n\n- Working Python environment (virtual environment is recommended), Python 3\n- Know how to use Node.js command\n\n\n\n## Features\n\n 1. Python Backend - do as you wish with python, do AI / ML / etc and send those data to modern web UI\n 2. Cross Platform APP using web UI\n\n\n\n## Installing / Getting started\n\nclone this git\n\n```shell\ngit clone https://github.com/gnoviawan/fast-api-electron-js.git\n```\n\n\n\n## Initial Configuration\n\nchange directory to cloned git\n\n```shell\ncd fast-api-electron-js\n```\n\ninstall all python dependencies\n\n```shell\nnpm run py-install\n```\n\ninstall all node js dependencies\n\n```shell\nnpm install\n```\n\n\n\n## Developing\n\n#### Directory Structure :\n\n`engine/` : a python directory for Fast API, create/modify all python module there, keep the `api.py` file name if you want to easily building the app later.\n\n`public/`: all frontend related files\n\n`public/assets/js/python.js`: is responsible to communicate between our frontend and backend.\n\n`public/assets/js/main.js`: electron main window\n\n#### Preview your Application :\n\nrun this command to preview your app\n\n```shell\nnpm run electron-dev\n```\n\n\n\n## Deploying / Publishing\n\n#### Building Python :\n\nbefore we building our app we have to build our Python FastAPI to .exe file ( windows ) or other executable format for each OS using PyInstaller and then call our Python Fast api as a child process inside electron js.\n\nrun this command to build python using `PyInstaller` library\n\nplease adjust the `api.spec` if you want to modify the build process or icon, please refer to the [PyInstaller documentation](https://pyinstaller.readthedocs.io/en/stable/spec-files.html)\n\n```shell\nnpm run py-build\n```\n\nalso if you are not using Windows change this code inside `public/assets/js/main.js` to another OS executable format ( not tested )\n\n```javascript\nconst  API_PROD_PATH = path.join(process.resourcesPath, \"../lib/api/api.exe\")\n```\n#### Build the application :\n\nafter we build our fast API it's time to build our main APP, run this command to build it\n\n```shell\nnpm run electron-build\n```\n\nour app are published to this path `dist`\nif you want to change the build options modify this config file `electron-builder.config.json` more about the options please check [electron-builder](https://www.electron.build/) documentation\n\n\n\n## All Reference Links for this project\n\n#### Server / Backend API ( Python )\n\n[Python Fast API](https://fastapi.tiangolo.com/) = main package that create our API backend\n\n[uvicorn](https://www.uvicorn.org/) = ASGI Python Server\n\n#### Middleware (Javascript)\n\n[Axios JS](https://axios-http.com/docs/intro) = package to communicate beetwen Python and Frontend\n\n#### Frontend ( HTML, CSS, Javascript )\n\n[Electron JS](https://www.electronjs.org/) = to create standalone application\n\n[Tabler](https://tabler.io/) = Front end UI Kit / Framework\n\n#### Utility\n\n[Electron Builder](https://www.electron.build/) = packate to build our Electron APP\n\n[Electron Reloader](https://www.npmjs.com/package/electron-reloader) = to automatic reload our Electron APP when in development stage\n\n[Python Shell](https://github.com/extrabacon/python-shell) = to create Python shell inside Node.js Application, usefull when we in development stage\n\n[PyInstaller](https://pyinstaller.readthedocs.io/en/stable/index.html) = build our python to executable format\n\n\n\n## [Licensing](https://github.com/gnoviawan/fast-api-electron-js/blob/main/LICENSE.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhercules2013%2Felectron-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhercules2013%2Felectron-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhercules2013%2Felectron-fastapi/lists"}