This is a backend service for handling and processing measurements like flow, temperature, pressure, etc. The backend is built using Python and uses Docker for deployment.
To get started, clone the repository from Git:
git clone [email protected]:pokopt/fuer_assignment.git
cd fuer_assignment
Make sure to set up the required environment variables for the app to run. You can create a .env
file in the root of the project:
POSTGRES_DB=your_db_name
POSTGRES_USER=your_db_user
POSTGRES_PASSWORD=your_db_password
POSTGRES_HOST=db
You can run the entire application, including the PostgreSQL database, with Docker Compose.
-
Build and start the Docker containers:
docker-compose --build
-
Run the container with measurements that backend should process (e.g. power and flow).
docker-compose run -p 0.0.0.0:8080:8080 fuer_backend power flow
-
The backend should now be running on http://localhost:8080.
-
You can stop the containers with:
docker-compose down
To run the app locally without Docker:
-
Install the dependencies (preferably in a virtual environment):
pip install -r requirements.txt
-
Set up environment variables (or create a
.env
file as described above). -
Start the application (handling measurements of flow and power):
PYTHONPATH=. python app/main.py power flow
-
The app will be running on http://localhost:8080.
You can run tests locally to verify that the backend is working as expected.
-
Install test dependencies (if any):
pip install -r requirements_dev.txt
-
Run tests:
PYTHONPATH=. pytest