{"id":20411046,"url":"https://github.com/yanamlnk/car-sharing","last_synced_at":"2026-04-21T13:31:18.248Z","repository":{"id":192059116,"uuid":"685926117","full_name":"yanamlnk/car-sharing","owner":"yanamlnk","description":"Project created during Java Backend Developer track provided by Hyperskill","archived":false,"fork":false,"pushed_at":"2023-09-01T15:14:28.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T03:16:14.545Z","etag":null,"topics":["gradle","h2-database","java","sql"],"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/yanamlnk.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":"2023-09-01T10:29:32.000Z","updated_at":"2024-01-18T10:04:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"095567ca-5948-4c98-a122-a818a5747163","html_url":"https://github.com/yanamlnk/car-sharing","commit_stats":null,"previous_names":["yanamlnk/car-sharing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yanamlnk/car-sharing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanamlnk%2Fcar-sharing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanamlnk%2Fcar-sharing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanamlnk%2Fcar-sharing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanamlnk%2Fcar-sharing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanamlnk","download_url":"https://codeload.github.com/yanamlnk/car-sharing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanamlnk%2Fcar-sharing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32094307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gradle","h2-database","java","sql"],"created_at":"2024-11-15T05:49:22.958Z","updated_at":"2026-04-21T13:31:18.229Z","avatar_url":"https://github.com/yanamlnk.png","language":"Java","readme":"# About\n[Car Sharing](https://hyperskill.org/projects/140) project is a part of Java Backend Developer track provided by Hyperskill.\n\n- This is an application for managing car rental process. As a manager, you can create companies that will rent cars, manage those companies, add cars.  As a customer, you can rent, return and check rented car.\n- Application is working with H2 database.\n- Connection to the database is done with the help of JDBC api.\n\n## Functionality\n1. The database file name is obtained from the command-line arguments in a format `-databaseFileName someName`. If no arguments are provided, then the database name can be anything.\n2. After the connection to the database is established, application outputs menu with the help of `System.out`. Application is getting user's input through `System.in`.\n\n## Menu\nYou can choose submenu by typing the corresponding number, or type `0` to stop the application.\n\n```\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n```\n### Exit\n`Exit` stops the application.\n\n### Manager\n`Manager` menu gives you an opportunity to create a company, check company list, add cars to the specified company and check the list of cars.\n\n```\n1. Company list\n2. Create a company\n0. Back\n```\n- `Back` to return to the main menu.\n- `Company list` to log in to the specific company. If company list is empty, the program outputs `The company list is empty!` and returns to the `Manager` menu. If there are already some companies, you can log in to the specific company to manage its cars.\n- `Create a company` asks for a company name and creates it.\n\n**Example:** \n\n```\n// user's input is indicated with \u003e\u003e\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n\u003e\u003e 1\n\n1. Company list\n2. Create a company\n0. Back\n\u003e\u003e 1\n\nThe company list is empty!\n\n1. Company list\n2. Create a company\n0. Back\n\u003e\u003e 2\n\nEnter the company name:\n\u003e\u003e SuperRental\n\nThe company was created!\n\n1. Company list\n2. Create a company\n0. Back\n\u003e\u003e 2\n\nEnter the company name:\n\u003e\u003e RentUrCar\n\nThe company was created!\n\n1. Company list\n2. Create a company\n0. Back\n\u003e\u003e 1\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 1\n\n'SuperRental' company\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 1\n\nThe car list is empty!\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 2\n\nEnter the car name:\n\u003e\u003e VW Golf\n\nThe car was added!\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 2\n\nEnter the car name:\n\u003e\u003e Mazda Miata\n\nThe car was added!\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 1\n\nCar list:\n1. VW Golf\n2. Mazda Miata\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 0\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 2\n\n'RentUrCar' company\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 2\n\nEnter the car name:\n\u003e\u003e Toyota Yaris\n\nThe car was added!\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 1\n\nCar list:\n1. Toyota Yaris\n\n1. Car list\n2. Create a car\n0. Back\n\u003e\u003e 0\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 0\n\n1. Company list\n2. Create a company\n0. Back\n\u003e\u003e 0\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n```\n\n### Customer\n`Customer` menu gives you an opportunity to rent and return a car, as well as to check whether a customer already has a rented car.\n- If there are no customers, you will not be able to get to the customer menu. You need to create at least one customer first.\n\n**Example:** \n\n```\n// user's input is indicated with \u003e\u003e\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n\u003e\u003e 2\n\nThe customer list is empty!\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n\u003e\u003e 3\n\nEnter the customer name:\n\u003e\u003e Bob Miller\n\nThe customer was added!\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n\u003e\u003e 2\n\nChoose a customer:\n1. Bob Miller\n0. Back\n```\n- After you log in as a specific customer, the customer menu appears.\n```\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n```\n- `Rent a car` to choose a company and a car\n- `Return a rented car` to return the car\n- `My rented car` to check the details of the rented car\n\n**Example:** \n\n```\n// user's input is indicated with \u003e\u003e\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n\u003e\u003e 2\n\nChoose a customer:\n1. Bob Miller\n2. Alice Ford\n0. Back\n\u003e\u003e 1\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 3\n\nYou didn't rent a car!\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 2\n\nYou didn't rent a car!\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 1\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 1\n\nChoose a car:\n1. VW Golf\n2. Mazda Miata\n0. Back\n\u003e\u003e 1\n\nYou rented 'VW Golf'\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 3\n\nYour rented car:\nVW Golf\nCompany:\nSuperRental\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 0\n\nChoose a customer:\n1. Bob Miller\n2. Alice Ford\n0. Back\n\u003e\u003e 2\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 1\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 1\n\nChoose a car:\n1. Mazda Miata\n0. Back\n\u003e\u003e 0\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 2\n\nChoose a car:\n1. Toyota Yaris\n0. Back\n\u003e\u003e 1\n\nYou rented 'Toyota Yaris'\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 0\n\nChoose a customer:\n1. Bob Miller\n2. Alice Ford\n0. Back\n\u003e\u003e 1\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 2\n\nYou've returned a rented car!\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 1\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 2\n\nNo available cars in the RentUrCar company\n\nChoose a company:\n1. SuperRental\n2. RentUrCar\n0. Back\n\u003e\u003e 1\n\nChoose a car:\n1. VW Golf\n2. Mazda Miata\n0. Back\n\u003e\u003e 2\n\nYou rented 'Mazda Miata'\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 1\n\nYou've already rented a car!\n\n1. Rent a car\n2. Return a rented car\n3. My rented car\n0. Back\n\u003e\u003e 0\n\nChoose a customer:\n1. Bob Miller\n2. Alice Ford\n0. Back\n\u003e\u003e 0\n\n1. Log in as a manager\n2. Log in as a customer\n3. Create a customer\n0. Exit\n```\n\n## Tables\nThe list of created tables in the database:\n\n1. **COMPANY** with the following columns:\n   - **ID** with the type `INT`, `PRIMARY KEY` and `AUTO_INCREMENT`.\n   - **NAME** with the type `VARCHAR`, `UNIQUE` and `NOT NULL`.\n\n2. **CAR** with the following columns:\n   - **ID** with the type `INT`, `PRIMARY KEY` and `AUTO_INCREMENT`.\n   - **NAME** with the type `VARCHAR`, `UNIQUE` and `NOT NULL`.\n   - **COMPANY_ID** with the type `INT`, `NOT NULL`, `FOREIGN KEY` referring to the **ID** column of the table **COMPANY**.\n\n3. **CUSTOMER** with the following columns:\n   - **ID**  with the type `INT`, `PRIMARY KEY` and `AUTO_INCREMENT`.\n   - **NAME** with the type `VARCHAR`, `UNIQUE` and `NOT NULL`.\n   - **RENTED_CAR_ID** with the type `INT`, `FOREIGN KEY` referring to the **ID** column of the **CAR** table, and this column can be `NULL` in case the customer didn't rent a car.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanamlnk%2Fcar-sharing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanamlnk%2Fcar-sharing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanamlnk%2Fcar-sharing/lists"}