working branch #1

Merged
quoije merged 9 commits from main into wip 2024-09-15 21:25:49 -04:00
12 changed files with 43 additions and 7 deletions
Showing only changes of commit c4c10972a1 - Show all commits
+6 -6
View File
@@ -1,15 +1,15 @@
from flask import Flask, render_template, make_response, json
import app_obd, app_car, app_account, app_gps, time
from app_events import socketio
import modules.app_obd, modules.app_car, modules.app_account, modules.app_gps, time
from modules.app_events import socketio
from gevent.pywsgi import WSGIServer
app = Flask(__name__)
socketio.init_app(app)
account = app_account.Account()
obd = app_obd.OBD()
car = app_car.Car()
gps = app_gps.get_gps()
account = modules.app_account.Account()
obd = modules.app_obd.OBD()
car = modules.app_car.Car()
gps = modules.app_gps.get_gps()
@app.route('/')
def index():
View File
View File
+23
View File
@@ -0,0 +1,23 @@
from pymongo import MongoClient
from dotenv import load_dotenv
import os
load_dotenv("./creds.env")
mUser = os.getenv()
mPass = os.getenv()
mDB = os.getenv()
def get_database():
# Provide the mongodb atlas url to connect python to mongodb using pymongo
CONNECTION_STRING = "mongodb+srv://"+ mUser + ":" + mPass + "@cluster.mongodb.net/" + mDB
# Create a connection using MongoClient. You can import MongoClient or use pymongo.MongoClient
client = MongoClient(CONNECTION_STRING)
# This is added so that many files can reuse the function get_database()
if __name__ == "__main__":
# Get the database
dbname = get_database()
View File
View File
View File
+7
View File
@@ -0,0 +1,7 @@
##
## MangoDB server connection details
##
mangosrv_user = ""
mangosrv_pass = ""
mangosrv_db = ""
+4
View File
@@ -0,0 +1,4 @@
## TSV File to MangoDB
## VN_20240401_00_00_00.TSV
##
## VN NAME, DATE, TIME, GPS_X, GPS_Y, SPEED, ODOMETER
1 ## TSV File to MangoDB
2 ## VN_20240401_00_00_00.TSV
3 ##
4 ## VN NAME, DATE, TIME, GPS_X, GPS_Y, SPEED, ODOMETER
+3 -1
View File
@@ -1,3 +1,5 @@
Flask
Flask-SocketIO
gevent
gevent
pymongo
python-dotenv