The application is responsible for managing individualized water and gas consumption readings from images, using the Google Gemini API for value recognition.
To install this project, follow these steps:
-
Clone the repository:
git clone https://github.com/dopimentel/back-end-consumption-reader.git
-
Access the project root folder:
cd back-end-consumption-reader
-
Create a .env file:
Create a file named
.env
in the project root folder and add the necessary environment variables. For example:GEMINI_API_KEY=YOUR_API_KEY
To use this project, follow these guidelines:
-
Make sure you have Docker:
docker-compose up
Receives a Base64 encoded image and integrates with the Google Gemini API to extract the reading value.
Request Body:
{
"image": "base64",
"customer_code": "string",
"measure_datetime": "datetime",
"measure_type": "WATER" or "GAS"
}
Response Body:
{
"image_url": "string",
"measure_value": "integer",
"measure_uuid": "string"
}
Confirms or corrects the value read by the Gemini API.
Request Body:
{
"measure_uuid": "string",
"confirmed_value": "integer"
}
Response Body:
{
"success": true
}
Lists the readings performed for a specific customer. An optional measure_type parameter can be provided to filter by type (WATER or GAS).
Response Body:
{
"customer_code": "string",
"measures": [
{
"measure_uuid": "string",
"measure_datetime": "datetime",
"measure_type": "string",
"has_confirmed": "boolean",
"image_url": "string"
}
]
}
- TypeScript
- Docker
- Node.js
- Express.js
- MySQL
- Sequelize
- Google Gemini API
This project is licensed under the MIT License.