{"id":26562607,"url":"https://github.com/hmika/carrentalshop","last_synced_at":"2026-04-10T07:55:53.763Z","repository":{"id":279502430,"uuid":"936268154","full_name":"HMika/CarRentalShop","owner":"HMika","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T23:19:01.000Z","size":4736,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T15:18:14.803Z","etag":null,"topics":["assertj","docker-compose","java","jpa","junit","jwt-token","maven","mockito","postgres","spring-boot","spring-security"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HMika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-20T19:57:13.000Z","updated_at":"2025-03-13T23:19:04.000Z","dependencies_parsed_at":"2025-03-04T23:24:28.108Z","dependency_job_id":null,"html_url":"https://github.com/HMika/CarRentalShop","commit_stats":null,"previous_names":["hmika/carrentalsop","hmika/carrentalshop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMika%2FCarRentalShop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMika%2FCarRentalShop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMika%2FCarRentalShop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMika%2FCarRentalShop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HMika","download_url":"https://codeload.github.com/HMika/CarRentalShop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244973810,"owners_count":20541025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertj","docker-compose","java","jpa","junit","jwt-token","maven","mockito","postgres","spring-boot","spring-security"],"created_at":"2025-03-22T15:18:18.368Z","updated_at":"2026-04-10T07:55:53.725Z","avatar_url":"https://github.com/HMika.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚗 Car Rental Shop Application\n\n## 📖 Overview\nThe **Car Rental Shop Application** is a **Spring Boot-based backend service** designed to streamline car rental operations. It provides a backend system that handles:\n- **User authentication** using JWT-based security.\n- **Car management** for listing, retrieving, and managing car data.\n- **Rental transactions** to book and track car rentals.\n\nThe application ensures **secure and efficient rental management** through **role-based access control** and **RESTful API design**.\n\n---\n\n## 🎯 Motivation\nThe goal of this project is to **simplify car rental management** by offering:\n- A **centralized platform** for managing rentals, users, and cars.\n- **Role-based authentication** to differentiate between users and admins.\n- A **structured relational database** for handling rental records efficiently.\n- **Secure transactions** with JWT-based authentication and access control.\n\n### **Main Goals**\n✔️ Automating the car rental process with a **structured digital solution**.  \n✔️ Reducing reliance on **manual record-keeping**.  \n✔️ Ensuring **scalability and performance** with modern backend technologies.  \n\n---\n\n## 🛠️ Technology Stack\nThis project leverages **modern technologies** to ensure **reliability, scalability, and security**.\n\n### **Backend**\n- **Spring Boot** – Main framework for backend development.\n- **Spring Security \u0026 JWT** – Used for authentication and role-based access control.\n- **Spring Data JPA \u0026 Hibernate** – ORM framework for database interactions.\n\n### **Database**\n- **PostgreSQL** – Relational database management system.\n- **Flyway** – Database versioning and migrations.\n\n### **Build \u0026 Dependency Management**\n- **Maven** – Dependency management and project build tool.\n\n### **Testing \u0026 Code Quality**\n- **JUnit** – Unit testing framework.\n- **AssertJ** – Fluent assertions for improved test readability.\n- **JaCoCo** – Code coverage analysis.\n- **SonarQube** – Code quality monitoring.\n\n---\n\n## 🔒 Security\nThe application follows best **security practices**:\n- **JWT-based authentication** – Secure token-based authentication for users.\n- **Role-based access control (RBAC)** – Different permissions for **users** and **admins**.\n- **Stateless session management** – Ensures scalability by avoiding server-side session storage.\n- **CSRF protection disabled** – Since it is a REST API intended for client-server communication.\n\n---\n\n## 📊 Database Schema\nThe application database consists of the following tables:\n\n1️⃣ **Roles** – Stores role-based access control data.  \n2️⃣ **Users** – Stores user information, including authentication details.  \n3️⃣ **Cars** – Stores car details (make, model, year, price, etc.).  \n4️⃣ **Rentals** – Stores rental transaction details.  \n\nThese tables define relationships between **users, roles, cars, and rental transactions**.\n\u003cimg width=\"517\" alt=\"Screenshot 2025-03-08 at 12 54 01\" src=\"https://github.com/user-attachments/assets/fb109efe-88b3-4f5e-bce1-6ee630c75700\" /\u003e\n\n---\n\n## Car Rental Shop Application – Startup Guide\n\n### Prerequisites\nBefore running the application, ensure that you have the following tools installed and configured:\n\n### 1. Install Docker\nThe application uses PostgreSQL as its database, which will run inside a Docker container. Ensure Docker is installed:\n- Download and install Docker for your operating system.\n\n### 2. Install Docker Compose\nThe database container is managed using Docker Compose.\n- Docker Compose should be installed along with Docker.\n- To verify installation, run:\n\n  ```sh\n  docker-compose --version\n  ```\n\n### 3. Install Java \u0026 Maven\nThe backend application is built using Java 17+ and Maven.\n\n- Install Java Development Kit (JDK 17+)\n- Install Maven:\n\n#### On Linux/macOS:\n\n```sh\nsudo apt install maven  # Debian-based\nbrew install maven      # macOS\n```\n\n#### On Windows:\nDownload from Apache Maven and configure the PATH variable.\n\n#### Verify installation:\n\n```sh\njava -version\nmvn -version\n\n## Step-by-Step Guide to Start the Application\n\n### 1. Clone the Repository\nFirst, clone the project repository from your source control (GitHub, GitLab, etc.):\n\n```sh\ngit clone https://github.com/your-repository/car-rental-shop.git\ncd car-rental-shop\n```\n\n## Start the Database with Docker\nThe project includes a `docker-compose.yml` file that sets up the PostgreSQL database inside a Docker container.\n\n### Steps:\n1. Navigate to the project directory.\n2. Run the following command to start the database container:\n\n   ```sh\n   docker-compose up -d\n   ```\n   This will:\n   - Pull the PostgreSQL image (if not already downloaded).\n   - Create and start a database container with the required configuration.\n   - Run the database in detached mode (`-d` flag) in the background.\n\n3. Verify that the container is running:\n   \n   ```sh\n   docker ps\n   ```\n   You should see a running PostgreSQL container.\n\n## Configure Database Connection\nThe application uses an `application.properties` file to define database connection settings. Ensure that the connection details match the database container configuration.\n\nThe default settings in `src/main/resources/application.properties` should be:\n\n```ini\nspring.datasource.url=jdbc:postgresql://localhost:5432/carrent_db\nspring.datasource.username=your_db_user\nspring.datasource.password=your_db_password\nspring.datasource.driver-class-name=org.postgresql.Driver\n\nspring.jpa.database=POSTGRESQL\nspring.jpa.hibernate.ddl-auto=update\nspring.jpa.properties.hibernate.format_sql=true\n```\n\nIf necessary, update the username and password to match the credentials defined in your `docker-compose.yml` file.\n\n## Build the Application\nOnce the database is running, you need to build the project using Maven.\n\nRun the following command inside the project root directory:\n\n```sh\nmvn clean install\n```\n\nThis will:\n- Download all dependencies.\n- Compile the Java source code.\n- Run tests (optional).\n- Package the application into a `.jar` file.\n\n## Start the Backend Application\nAfter building the project, start the backend service using:\n\n```sh\nmvn spring-boot:run\n```\n\nor run the compiled JAR file manually:\n\n```sh\njava -jar target/car-rental-shop.jar\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmika%2Fcarrentalshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmika%2Fcarrentalshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmika%2Fcarrentalshop/lists"}