Skip to content

metepg/car-diary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car diary

A simple car diary application created for a friend. Feel free to use or modify.

Note: The application is in Finnish.

Overview

  • Frontend: React (Vite) with Material-UI
  • Backend: Spring Boot (Kotlin)
  • Database: PostgreSQL

Table of Contents

Features

  • Authentication: Spring Boot Security with basic form login
  • Diary Entries: Save kilometers to the driving diary
  • PDF Export: Print required information per month to PDF (generated in the backend using OpenPDF)
  • CRUD Operations: Create, read, update and delete diary entries
  • Dark Mode: Application supports dark mode

Setup Instructions

Backend

  1. Navigate to the /server directory:
    cd server
  2. Build the project:
    mvn clean install
  3. Initialize demo data (optional, but recommended to ensure the local environment has at least one user available for login):
    ./init.sh
  4. Run the application in dev profile:
    mvn spring-boot:run -Dspring-boot.run.profiles=dev

Frontend

After completing the backend setup, navigate to the frontend directory and start the development server:

  1. Navigate to the /client directory:
    cd client
  2. Start the development server:
    npm run dev

Building the Application

To build both the frontend and backend as a single car.jar file, run the following command:

  1. From the /server directory of the project:
    mvn clean package

This will generate a car.jar file in directory /server/target/ that can be deployed.

Database

  1. Set up the PostgreSQL database with the required schema.
  2. Update the database configuration in application-dev.properties.

Usage

  • Login: Access the application and login with your credentials.
  • Add Entries: Save your driving kilometers.
  • Edit Entries: Modify existing entries.
  • Delete Entries: Remove unnecessary entries.
  • Export PDF: Generate a monthly report in PDF format.
  • Dark Mode: Switch to dark mode as preferred.

Screenshots

Here are some screenshots of the application:

Create Entry

Create Entry

Trips View

Trips View

Trips View (Dark Mode)

Create Entry (Dark Mode)

Edit Trip

Edit Trip

PDF Export Demo

PDF Export Demo

Deployment

Using GitHub Actions to deploy this app to Hetzner.

License

This project is licensed under the MIT License.