Coder Social home page Coder Social logo

joshbrew / esbuild_base_python Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 190 KB

Python quart server + esbuild application base, with websockets/sse streaming from quart (with bonus multithreading example in quart)

License: GNU Affero General Public License v3.0

JavaScript 62.50% Python 32.36% HTML 5.14%
esbuild javascript webapp pwa quart python bilingual

esbuild_base_python's Introduction

Minimal esbuild, Nodejs, and Python Quart concurrent test env.

Requires: Python 3.7 or later and NodeJS LTS or later

image

This test runs a websocket and a thread on the python quart server. You can access the Node-served test page at http://localhost:8000 or the quart server test page at http://localhost:7000 to experiment (add /build at port 7000 to access the node build (minus hot reload)).

Quart enables fast asyncio server streams from python. Bonus thread-generated data in python streaming through websockets to show off the potential.

npm run pip should install any missing python packages. See README)

npm run dev installs nodejs packages and runs both python and node servers concurrently (with hot reloading for FE with a persistent python streaming server backend).

After installing dependencies,

Run Python and Node together:

npm run concurrent

Otherwise

To run: npm run build to bundle, then npm start to run the node server.

  • OR npm test to run both commands in sequence

You can specify https and add an ssl certificate if you follow the instructions.

2 dependencies: esbuild and fragelement

Hot reloading (for dev)

npm run dev

then npm run startdev

nodemon restarts the node server automatically when changes to included source files are detected.

The nodemon dev server adds basic frontend hot reloading via websocket and clientside code injection (see nodeserver/server.js for method).

2 dev dependencies: nodemon and ws

PWA build:

To test:

npm run pwa

This installs workbox-cli, generates the service worker, bundles and then starts the application. Run once if you don't need to modify the service-worker further.

1 additional dependency: workbox-cli

Other notes:

See README.md files in each folder for more explanation on how to work with these types of applications.

esbuild_base_python's People

Contributors

joshbrew avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.