Initial commit

This commit is contained in:
2020-10-19 19:00:17 +02:00
parent 634ead79db
commit 48140f557b
61 changed files with 18269 additions and 0 deletions

3
backend_python/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

8
backend_python/.idea/backend.iml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
backend_python/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

8
backend_python/.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/backend.iml" filepath="$PROJECT_DIR$/.idea/backend.iml" />
</modules>
</component>
</project>

6
backend_python/.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

Binary file not shown.

Binary file not shown.

17
backend_python/main.py Normal file
View File

@@ -0,0 +1,17 @@
from flask import Flask, jsonify
from flask_restful import Api, Resource, reqparse, abort
import pymongo, pika
import vars
import resources.user as user
app = Flask(__name__)
api = Api(app)
api.add_resource(user.UserLogin, "/user/login")
if __name__ == '__main__':
vars.db = pymongo.MongoClient("mongodb+srv://backend:Rjmzs75W9EYwW8G7@cluster0.qxerq.mongodb.net/livebeat?retryWrites=true&w=majority")
print(vars.db.list_databases())
rabbit = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = rabbit.channel()
app.run(debug=True)

View File

@@ -0,0 +1,7 @@
from flask_restful import Api, Resource, reqparse, abort
import vars
class UserLogin(Resource):
def get(self):
print(vars.db['livebeat'])
return

6
backend_python/vars.py Normal file
View File

@@ -0,0 +1,6 @@
"""
This file contains all variables that are shared across the entire application.
For example: Database connection, sockets, etc.
"""
db = None