From df6d2c51b15d55a30b8515de637aa7af490b2d95 Mon Sep 17 00:00:00 2001 From: nasrlol Date: Wed, 27 Nov 2024 00:54:43 +0100 Subject: small modifications to the file system --- bin/assets/text/quotes.txt | 30 ------------------------------ docs/guide.md | 13 +++++++++++++ docs/guide.txt | 13 ------------- public/api.py | 27 +++++++++++++++++++++++++++ public/api_server.service | 15 +++++++++++++++ public/index.html | 37 +++++++++++++++++++++++++++++++++++++ templates/api.py | 27 --------------------------- templates/api_server.service | 15 --------------- templates/index.html | 37 ------------------------------------- 9 files changed, 92 insertions(+), 122 deletions(-) delete mode 100644 bin/assets/text/quotes.txt create mode 100644 docs/guide.md delete mode 100644 docs/guide.txt create mode 100644 public/api.py create mode 100644 public/api_server.service create mode 100644 public/index.html delete mode 100644 templates/api.py delete mode 100644 templates/api_server.service delete mode 100644 templates/index.html diff --git a/bin/assets/text/quotes.txt b/bin/assets/text/quotes.txt deleted file mode 100644 index 9f778ed..0000000 --- a/bin/assets/text/quotes.txt +++ /dev/null @@ -1,30 +0,0 @@ -“Code is like humor, it’s better if it’s clean.” -“Software is a great combination.” -“Computers are like a bicycle for the mind.” -“Simplicity is the soul of efficiency.” -“Good code is its own best documentation.” -“In programming, clarity is key.” -“Programs must be written for people.” -“Computers are only tools.” -“The best way to predict the future is to invent it.” -“Talk is cheap. Show me the code.” -"It’s not a bug, it’s a feature.” -“The computer is mightier than the pen.” -"Code is the art of telling computers what to do.” -"Make it work, make it right, make it fast.” -“Every problem can be solved with code.” -“The only limit is your imagination.” -“Programming is thinking, not typing.” -"Design is the soul of programming.” -“There’s no place like 127.0.0.1.” -“Without algorithms, there’s no solution.” -“Compilers turn ideas into machine code.” -“A program is only as good as its design.” -"Code never lies, comments sometimes do.” -“Debugging is twice as hard as writing.” -"Computers don’t make mistakes, programmers do.” -“Code fast, debug slow, optimize last.” -“Keep it simple, stupid (KISS).” -“Without testing, code is poetry.” -“Good software comes from great design.” -“The harder you work, the luckier you get.” \ No newline at end of file diff --git a/docs/guide.md b/docs/guide.md new file mode 100644 index 0000000..b248f49 --- /dev/null +++ b/docs/guide.md @@ -0,0 +1,13 @@ +------------------------------------------------------------- + + I2C CONTROLLER GUIDE + +------------------------------------------------------------- + +This program is designed to control an LCD1602 using python. It supports +a GUI and CLI interface and is at the moment only linux compatible. + +You will need to have a couple of dependency's readdy on your device to use the software. + +* sounddevice +* ... diff --git a/docs/guide.txt b/docs/guide.txt deleted file mode 100644 index b248f49..0000000 --- a/docs/guide.txt +++ /dev/null @@ -1,13 +0,0 @@ -------------------------------------------------------------- - - I2C CONTROLLER GUIDE - -------------------------------------------------------------- - -This program is designed to control an LCD1602 using python. It supports -a GUI and CLI interface and is at the moment only linux compatible. - -You will need to have a couple of dependency's readdy on your device to use the software. - -* sounddevice -* ... diff --git a/public/api.py b/public/api.py new file mode 100644 index 0000000..b04ef77 --- /dev/null +++ b/public/api.py @@ -0,0 +1,27 @@ +from flask import Flask, request, jsonify, render_template + +app = Flask(__name__) + + +@app.route("/") +def index(): + return render_template("index.html") + + +@app.route("/api/run-script", methods=["POST"]) +def run_script(): + data = request.json + if not data: + return jsonify({"error": "No data provided"}), 400 + + script_result = my_script_logic(data.get("input")) + + return jsonify({"result": script_result}) + + +def my_script_logic(input_value): + return f"Processed input: {input_value}" + + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=5000, debug=True) diff --git a/public/api_server.service b/public/api_server.service new file mode 100644 index 0000000..b69c5e4 --- /dev/null +++ b/public/api_server.service @@ -0,0 +1,15 @@ +[Unit] +Description=REST API Server for RPI +After=network.target + +[Service] +ExecStart=/usr/bin/python3 /home/pi/I2C/bin/main.py +WorkingDirectory=/home/pi/I2C +User=nasr +Group=pi +Restart=always +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy=multi-user.target + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..5436dbd --- /dev/null +++ b/public/index.html @@ -0,0 +1,37 @@ + + + + + + + CONSOLE + + + + + + + +
+ Resources + Speech Transcriber + Display a Message + General Tools +
+
+

This is the main control center for the I2C deivce. You can find + the main code and information about the project under my GITHUB

+ +
+ + + + + diff --git a/templates/api.py b/templates/api.py deleted file mode 100644 index b04ef77..0000000 --- a/templates/api.py +++ /dev/null @@ -1,27 +0,0 @@ -from flask import Flask, request, jsonify, render_template - -app = Flask(__name__) - - -@app.route("/") -def index(): - return render_template("index.html") - - -@app.route("/api/run-script", methods=["POST"]) -def run_script(): - data = request.json - if not data: - return jsonify({"error": "No data provided"}), 400 - - script_result = my_script_logic(data.get("input")) - - return jsonify({"result": script_result}) - - -def my_script_logic(input_value): - return f"Processed input: {input_value}" - - -if __name__ == "__main__": - app.run(host="0.0.0.0", port=5000, debug=True) diff --git a/templates/api_server.service b/templates/api_server.service deleted file mode 100644 index b69c5e4..0000000 --- a/templates/api_server.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=REST API Server for RPI -After=network.target - -[Service] -ExecStart=/usr/bin/python3 /home/pi/I2C/bin/main.py -WorkingDirectory=/home/pi/I2C -User=nasr -Group=pi -Restart=always -Environment="PYTHONUNBUFFERED=1" - -[Install] -WantedBy=multi-user.target - diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 5436dbd..0000000 --- a/templates/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - CONSOLE - - - - - - - -
- Resources - Speech Transcriber - Display a Message - General Tools -
-
-

This is the main control center for the I2C deivce. You can find - the main code and information about the project under my GITHUB

- -
- - - - - -- cgit v1.2.3-70-g09d2