AlexTelon / FlexiCharge-Backend

6 stars 11 forks source link

FlexiCharge-Backend

Start up

Prerequisites

Needed to start app.

.env.example file

Add packages

Database

Connect to local database

  - Host: 127.0.0.1
  - Port: 5432
  - Username: postgres
  - Password: abc123
  - .env file
    - USE_LOCAL_DATABASE=1

Awilix variables and methods - consider removing

OCPP

OCPP handles communication between chargers and backend. Conversations can be iniated by either chargers or backend. A conversation is always iniated with a request and responded to with a confirmation, in most conversations the usefull data is in the request, and the confirmation is just a message to confirm that data arrived as expected. These messages try to follow the OCPP protocol as closely as possible, with some exceptions (for example uniqueID).

Enviroment Variables

TESTS

In your env. file you must set RUN_OCCP_TEST=1 before you run docker-compose up to start the app. Now the tests will run everytime you save a file (i.e everytime the server restarts).

Both the charger tests and live metrics tests are fully automated, meaning that before the tests run, corresponding "charger client socket mock" and "user client socket mock" are created with hardcoded responses for the server.

HTTP

HTTP documentation