diff --git a/lnbits/extensions/example/crud.py b/lnbits/extensions/example/crud.py new file mode 100644 index 000000000..5540c5ec1 --- /dev/null +++ b/lnbits/extensions/example/crud.py @@ -0,0 +1,5 @@ +# crud.py is for communication with your extensions database + +# add your dependencies here + +# add your fnctions here \ No newline at end of file diff --git a/lnbits/extensions/example/migrations.py b/lnbits/extensions/example/migrations.py index 99d7c362d..9d37d977a 100644 --- a/lnbits/extensions/example/migrations.py +++ b/lnbits/extensions/example/migrations.py @@ -1,3 +1,5 @@ +# migrations.py is for building your database + # async def m001_initial(db): # await db.execute( # f""" diff --git a/lnbits/extensions/example/static/fastapi-framework.png b/lnbits/extensions/example/static/fastapi-framework.png new file mode 100644 index 000000000..b446ce259 Binary files /dev/null and b/lnbits/extensions/example/static/fastapi-framework.png differ diff --git a/lnbits/extensions/example/static/fastapilogo.png b/lnbits/extensions/example/static/fastapilogo.png new file mode 100644 index 000000000..57eb6a800 Binary files /dev/null and b/lnbits/extensions/example/static/fastapilogo.png differ diff --git a/lnbits/extensions/example/static/quasar-example.png b/lnbits/extensions/example/static/quasar-example.png new file mode 100644 index 000000000..64da65aba Binary files /dev/null and b/lnbits/extensions/example/static/quasar-example.png differ diff --git a/lnbits/extensions/example/static/quasar-framework.png b/lnbits/extensions/example/static/quasar-framework.png new file mode 100644 index 000000000..c06e8cfad Binary files /dev/null and b/lnbits/extensions/example/static/quasar-framework.png differ diff --git a/lnbits/extensions/example/static/quasarlogo.png b/lnbits/extensions/example/static/quasarlogo.png new file mode 100644 index 000000000..69228f86a Binary files /dev/null and b/lnbits/extensions/example/static/quasarlogo.png differ diff --git a/lnbits/extensions/example/static/script-example.png b/lnbits/extensions/example/static/script-example.png new file mode 100644 index 000000000..813a4254f Binary files /dev/null and b/lnbits/extensions/example/static/script-example.png differ diff --git a/lnbits/extensions/example/static/vif-example.png b/lnbits/extensions/example/static/vif-example.png new file mode 100644 index 000000000..3e6cfa11e Binary files /dev/null and b/lnbits/extensions/example/static/vif-example.png differ diff --git a/lnbits/extensions/example/static/vuejs-framework.png b/lnbits/extensions/example/static/vuejs-framework.png new file mode 100644 index 000000000..eb634533c Binary files /dev/null and b/lnbits/extensions/example/static/vuejs-framework.png differ diff --git a/lnbits/extensions/example/static/vuejslogo.png b/lnbits/extensions/example/static/vuejslogo.png new file mode 100644 index 000000000..fe23ad992 Binary files /dev/null and b/lnbits/extensions/example/static/vuejslogo.png differ diff --git a/lnbits/extensions/example/templates/example/index.html b/lnbits/extensions/example/templates/example/index.html index d732ef376..3ff604d2e 100644 --- a/lnbits/extensions/example/templates/example/index.html +++ b/lnbits/extensions/example/templates/example/index.html @@ -1,58 +1,212 @@ {% extends "base.html" %} {% from "macros.jinja" import window_vars with context %} {% block page %} - + + + + + + + +
+ Update thing + Create thing + Cancel +
+
+
+
+ + -
- Frameworks used by {{SITE_TITLE}} -
- - + {{SITE_TITLE}} Extension Development Guide + + + + - {% raw %} - - - {{ tool.name }} - {{ tool.language }} - - {% endraw %} - - - -

- A magical "g" is always available, with info about the user, wallets and - extensions: -

- {% raw %}{{ g }}{% endraw %} + + + + + + + + + + +
Frameworks
+ +
+ + + + + + +
+
+ + + + +
File Structure
+ Coming soon... +
+ + +
Dev Enviroment
+ Coming soon... +
+ + +
Useful Tools
+
+ + + + + + + +
+
+
+
{% endblock %} {% block scripts %} {{ window_vars(user) }} + diff --git a/lnbits/extensions/example/views_api.py b/lnbits/extensions/example/views_api.py index 5b702717e..9d56a6410 100644 --- a/lnbits/extensions/example/views_api.py +++ b/lnbits/extensions/example/views_api.py @@ -2,34 +2,11 @@ # add your dependencies here -# import httpx -# (use httpx just like requests, except instead of response.ok there's only the -# response.is_error that is its inverse) - from . import example_ext # add your endpoints here - -@example_ext.get("/api/v1/tools") -async def api_example(): - """Try to add descriptions for others.""" - tools = [ - { - "name": "fastAPI", - "url": "https://fastapi.tiangolo.com/", - "language": "Python", - }, - { - "name": "Vue.js", - "url": "https://vuejs.org/", - "language": "JavaScript", - }, - { - "name": "Quasar Framework", - "url": "https://quasar.dev/", - "language": "JavaScript", - }, - ] - - return tools +@example_ext.get("/api/v1/test/{test_data}") +async def api_example(test_data): + # Do some python things and return the data + return test_data