2024-12-31 11:34:39 +01:00
|
|
|
# Fuel Stats
|
2024-12-25 23:00:19 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
An app for tracking your fuel consumption and optimizing your driving efficiency.
|
2024-12-25 23:00:19 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
## Used Technologies
|
2024-12-26 02:13:03 +01:00
|
|
|
- **Frontend:** HTML, CSS, JavaScript
|
2024-12-25 23:00:19 +01:00
|
|
|
- **Backend:** PHP (OOP)
|
2024-12-26 02:13:03 +01:00
|
|
|
- **Database:** MariaDB
|
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
## How to Build
|
2024-12-27 02:35:01 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
### Build Using Docker
|
|
|
|
Run the container using docker-compose:
|
2024-12-27 02:35:01 +01:00
|
|
|
```bash
|
2024-12-31 11:34:39 +01:00
|
|
|
docker-compose --profile <dev|prod> up -d
|
2024-12-27 02:35:01 +01:00
|
|
|
```
|
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
The app should be available at http://localhost:8000.
|
2024-12-27 02:36:34 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
PhpMyAdmin should be available at http://localhost:8080.
|
2024-12-27 02:35:01 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
### Build Manually
|
|
|
|
1. Clone the repository:
|
2024-12-26 02:13:03 +01:00
|
|
|
```bash
|
2024-12-31 11:34:39 +01:00
|
|
|
git clone https://git.filiprojek.cz/fr/fuel-stats.git
|
2024-12-26 02:13:03 +01:00
|
|
|
```
|
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
2. Create `config/environment.php`:
|
|
|
|
- It should have the following structure:
|
2024-12-26 02:13:03 +01:00
|
|
|
```php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
define('DB_HOST', 'your db host');
|
|
|
|
define('DB_USER', 'your db username');
|
|
|
|
define('DB_PASS', 'your db password');
|
|
|
|
define('DB_NAME', 'your db name');
|
|
|
|
```
|
2024-12-31 11:34:39 +01:00
|
|
|
- For the database, you can use the included `docker-compose.yaml` which includes both MariaDB and PhpMyAdmin.
|
2024-12-26 02:13:03 +01:00
|
|
|
|
2024-12-31 11:34:39 +01:00
|
|
|
3. Start a local web server:
|
|
|
|
- You can use PHP's integrated server by running this:
|
2024-12-26 02:13:03 +01:00
|
|
|
```bash
|
2024-12-28 22:27:24 +01:00
|
|
|
php -S localhost:8000 -t ./public
|
2024-12-26 02:13:03 +01:00
|
|
|
```
|
2024-12-31 11:34:39 +01:00
|
|
|
- You can use any host and any port you prefer.
|
2024-12-26 02:13:03 +01:00
|
|
|
|
|
|
|
## Usage
|
2024-12-31 11:34:39 +01:00
|
|
|
1. Register and log in to the app.
|
|
|
|
2. Add your vehicles with their details (fuel type, registration, etc.).
|
|
|
|
3. Record each refueling:
|
|
|
|
- Select your vehicle.
|
|
|
|
- Input the number of liters, price per liter, and total cost.
|
|
|
|
4. Track your fuel consumption and spending through the dashboard.
|
|
|
|
5. View detailed stats and graphs to analyze your driving habits.
|
|
|
|
|
|
|
|
## License
|
|
|
|
This project is licensed under GPL3.0 and later. More information is available in the `LICENSE` file.
|