AI prompts
base on SteVe - OCPP server implementation in Java ![SteVe](src/main/resources/webapp/static/images/logo.png)
[![build and run tests](https://github.com/steve-community/steve/actions/workflows/main.yml/badge.svg)](https://github.com/steve-community/steve/actions/workflows/main.yml)
# Introduction
SteVe started its life at the RWTH Aachen University [in 2013](https://github.com/steve-community/steve/issues/827).
The name is derived from _Steckdosenverwaltung_ in German (in English: socket administration).
The aim of SteVe is to support the deployment and popularity of electric mobility, so it is easy to install and to use.
It provides basic functions for the administration of charge points, user data, and RFID cards for user authentication and was tested successfully in operation.
SteVe is considered as an open platform to implement, test and evaluate novel ideas for electric mobility, like authentication protocols, reservation mechanisms for charge points, and business models for electric mobility.
The project is distributed under [GPL](LICENSE.txt) and is free to use.
If you are going to deploy it we are happy to see the [logo](website/logo/managed-by-steve.pdf) on a charge point.
## Relation to Powerfill
[Powerfill](https://powerfill.co/) is a SaaS company to expand beyond the basics of SteVe: While SteVe covers the basics of OCPP functionality in a DIY sense, Powerfill offers more and enterprise features with ease of use. [See the announcement](https://github.com/steve-community/steve/issues/1643) and [sign up for early access](https://powerfill.co/early-access/).
### Charge Point Support
Electric charge points using the following OCPP versions are supported:
* OCPP1.2S
* OCPP1.2J
* OCPP1.5S
* OCPP1.5J
* OCPP1.6S
* OCPP1.6J
⚠️ Currently, Steve doesn't support [the OCPP-1.6 security whitepaper](https://openchargealliance.org/wp-content/uploads/2023/11/OCPP-1.6-security-whitepaper-edition-3-2.zip) yet (see [#100](https://github.com/steve-community/steve/issues/100)) and anyone can send events to a public steve instance once the chargebox id is known.
Please, don't expose a Steve instance without knowing that risk.
For Charging Station compatibility please check:
https://github.com/steve-community/steve/wiki/Charging-Station-Compatibility
### System Requirements
SteVe requires
* JDK 17 or newer
* Maven
* MySQL or MariaDB. You should use [one of these](.github/workflows/main.yml#L11) supported versions.
to build and run.
SteVe is designed to run standalone, a java servlet container / web server (e.g. Apache Tomcat), is **not** required.
# Configuration and Installation
1. Database preparation:
**Important**: Make sure that the time zone of the MySQL server is the same as [the time zone of SteVe](src/main/java/de/rwth/idsg/steve/SteveConfiguration.java#L46). Since `UTC` is strongly recommended by OCPP, it is the default in SteVe and you should set it in MySQL, accordingly.
Make sure MySQL is reachable via TCP (e.g., remove `skip-networking` from `my.cnf`).
The following MySQL statements can be used as database initialization (adjust database name and credentials according to your setup).
```
CREATE DATABASE stevedb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'steve'@'localhost' IDENTIFIED BY 'changeme';
GRANT ALL PRIVILEGES ON stevedb.* TO 'steve'@'localhost';
```
2. Download and extract tarball:
You can download and extract the SteVe releases using the following commands (replace X.X.X with the desired version number):
```
wget https://github.com/steve-community/steve/archive/steve-X.X.X.tar.gz
tar xzvf steve-X.X.X.tar.gz
cd steve-X.X.X
```
3. Configure SteVe **before** building:
The basic configuration is defined in [main.properties](src/main/resources/config/prod/main.properties):
- You _must_ change [database configuration](src/main/resources/config/prod/main.properties#L9-L13)
- You _must_ change [the host](src/main/resources/config/prod/main.properties#L22) to the correct IP address of your server
- You _must_ change [web interface credentials](src/main/resources/config/prod/main.properties#L17-L18)
- You _can_ access the application via HTTPS, by [enabling it and setting the keystore properties](src/main/resources/config/prod/main.properties#L32-L35)
For advanced configuration please see the [Configuration wiki](https://github.com/steve-community/steve/wiki/Configuration)
4. Build SteVe:
To compile SteVe simply use Maven. A runnable `jar` file containing the application and configuration will be created in the subdirectory `steve/target`.
```
# ./mvnw package
```
5. Run SteVe:
To start the application run (please do not run SteVe as root):
```
# java -jar target/steve.jar
```
# Docker
If you prefer to build and start this project via docker (you can skip the steps 1, 4 and 5 from above), this can be done as follows: `docker compose up -d`
Because the docker compose file is written to build the project for you, you still have to change the project configuration settings from step 3.
Instead of changing the [main.properties in the prod directory](src/main/resources/config/prod/main.properties), you have to change the [main.properties in the docker directory](src/main/resources/config/docker/main.properties). There you have to change all configurations which are described in step 3.
The database password for the user "steve" has to be the same as you have configured it in the docker compose file.
With the default docker compose configuration, the web interface will be accessible at: `http://localhost:8180`
# Kubernetes
First build your image, and push it to a registry your K8S cluster can access. Make sure the build args in the docker build command are set with the same database configuration that the main deployment will use.
`docker build --build-arg DB_HOST= --build-arg DB_PORT= --build-arg DB_USERNAME= --build-arg DB_PASSWORD= --build-arg DB_DATABASE= -f k8s/docker/Dockerfile -t <IMAGE_NAME> .`
`docker push <IMAGE_NAME>`
Then go to `k8s/yaml/Deployment.yaml` and change `### YOUR BUILT IMAGE HERE ###` to your image tag, and fill in the environment variables with the same database connection that you used at build time.
After this, create the namespace using `kubectl create ns steve` and apply your yaml with `kubectl apply -f k8s/yaml/Deployment.yaml` followed by `kubectl apply -f k8s/yaml/Service.yaml`
To access this publicaly, you'll also have to setup an ingress using something like nginx or traefik.
# Ubuntu
You'll find a tutorial how to prepare Ubuntu for SteVe here: https://github.com/steve-community/steve/wiki/Prepare-Ubuntu-VM-for-SteVe
# AWS
You'll find a tutorial how to setup SteVe in AWS using Lightsail here: https://github.com/steve-community/steve/wiki/Create-SteVe-Instance-in-AWS-Lightsail
# First Steps
After SteVe has successfully started, you can access the web interface using the configured credentials under:
http://<your-server-ip>:<port>/steve/manager
### Add a charge point
1. In order for SteVe to accept messages from a charge point, the charge point must first be registered. To add a charge point to SteVe select *Data Management* >> *Charge Points* >> *Add*. Enter the ChargeBox ID configured in the charge point and confirm.
2. The charge points must be configured to communicate with following addresses. Depending on the OCPP version of the charge point, SteVe will automatically route messages to the version-specific implementation.
- SOAP: `http://<your-server-ip>:<port>/steve/services/CentralSystemService`
- WebSocket/JSON: `ws://<your-server-ip>:<port>/steve/websocket/CentralSystemService`
As soon as a heartbeat is received, you should see the status of the charge point in the SteVe Dashboard.
*Have fun!*
Screenshots
-----
1. [Home](website/screenshots/home.png)
2. [Connector Status](website/screenshots/connector-status.png)
3. [Data Management - Charge Points](website/screenshots/chargepoints.png)
4. [Data Management - Users](website/screenshots/users.png)
5. [Data Management - OCPP Tags](website/screenshots/ocpp-tags.png)
6. [Data Management - Reservations](website/screenshots/reservations.png)
7. [Data Management - Transactions](website/screenshots/transactions.png)
8. [Operations - OCPP v1.2](website/screenshots/ocpp12.png)
9. [Operations - OCPP v1.5](website/screenshots/ocpp15.png)
10. [Settings](website/screenshots/settings.png)
GDPR
-----
If you are in the EU and offer vehicle charging to other people using SteVe, keep in mind that you have to comply to the General Data Protection Regulation (GDPR) as SteVe processes charging transactions, which can be considered personal data.
Are you having issues?
-----
See the [FAQ](https://github.com/steve-community/steve/wiki/FAQ)
Acknowledgments
-----
[goekay](https://github.com/goekay) thanks to
- [JetBrains](https://jb.gg/OpenSourceSupport) who support this project by providing a free All Products Pack license, and
- ej-technologies GmbH who support this project by providing a free license for their [Java profiler](https://www.ej-technologies.com/products/jprofiler/overview.html).
", Assign "at most 3 tags" to the expected json: {"id":"2764","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"