AutoRenewPayByPhone is a Rust-based project that automates the process of renewing parking sessions using the PayByPhone API.
The project consists of two main components: front and back.
front: The frontend application built with Dioxus.back: The backend service that interacts with the PayByPhone API.
- Rust (latest stable version)
- Cargo
- WASM target for the frontend
- Whatever other target you need to build the backend
- Docker (for building Docker images)
git clone https://github.com/remi-espie/AutoRenewPayByPhone.git
cd AutoRenewPayByPhoneNavigate to the front directory and build the frontend:
cd front
cargo buildNavigate to the back directory and build the backend:
cd back
cargo buildcargo buildcd front
dx runcargo run -p backYou can also build and run the project using Docker.
docker build -t autopbf/front ./front
docker build -t autopbf/back ./backdocker run -d -p 8080:8080 autopbf/front
docker run -d -p 8081:8081 autopbf/backYou can also use Docker Compose to run the project from already built image available in this repo.
docker compose upThe project uses environment variables for configuration. You can set the following environment variables:
BEARER: Bearer token used to authenticate to the backend.API_URL: The URL of the backend API.PORT: The port on which the backend will listen.
Note
Because the frontend is a WASM app, environment variable are not available.
API_URL is hardcoded in the frontend code, but is recreated from the environment or the .env file at build time, so you can set it in the .env file, rebuild and it will be taken into account.
The project also uses a configuration file located at config.yaml. You can set the following configuration options:
accounts: # A list of car "accounts", each account represents a car
- name: # The display name of a car account
plate: # The plate of the car
lot: # The ID of the parking lot, find it in the URL of the parking lot page
pay_by_phone: # PayByPhone related information
login: # PayByPhone login information, typically your phone number
password: # PayByPhone password
payment_account_id: # PayByPhone payment card ID, can be empty if you park on a free lotContributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.