Welcome to the Car Rental System, an easy-to-use platform designed to manage car rentals for both customers and administrators. This system allows for user registration, car management, rental booking, and rental management.
- Customer and Administrator roles
- User registration and login
- Car management (CRUD operations)
- Rental booking and management
- Pricing service for calculating rental prices
- Command-line interface for easy navigation
- User-friendly interface with clear instructions
- Superadmin account for initial setup
- Data persistence using SQLite database
- Data validation and error handling
- User-friendly error messages
- Detailed documentation and usage guide
- Loyalty program for customers
Before you install and run the Car Rental System, make sure you have the following software installed:
- Python 3.9 or later
- pip 24 or later (Python package installer)
- Clone the Repository
git clone https://github.com/joseabril25/car-rental-py.git
cd car_rental_system
- Create a Virtual Environment
python -m venv .venv
- Activate the Virtual Environment
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activate
- Install Required Packages
pip install -r requirements.txt
- Run the Application
python main.py
- Follow the on-screen instructions to navigate the application.
- Superadmin credentials:
- Username: superadmin
- Password: superadmin
- Database will be created automatically if car_rental_system.db does not exist.
- No additional configuration is required to run the application.
- main.py - The entry point of the application. It handles initialization and starting the command-line interface.
- /models
- base.py - Contains the SQLAlchemy Base declarative class.
- car.py - Defines the Car model.
- user.py - Defines the User model.
- rental.py - Defines the Rental model.
- /database
- engine.py - Configures and initializes the database connection and session.
- /managers
- car_manager.py - Manages car-related operations.
- user_manager.py - Manages user operations.
- rental_manager.py - Manages rental operations.
- /factories
- car_factory.py - Generates Car objects.
- user_factory.py - Generates User objects.
- rental_factory.py - Generates Rental objects.
- /utils
- helpers.py - Contains helper functions for date validation and formatting.
- ui
- cli.py - Contains the command-line interface for the application.
- admin_cli.py - Contains the command-line interface for administrators.
- customer_cli.py - Contains the command-line interface for customers.
- /states
- global_state.py - Contains the global state of the application.
- /services
- pricing_service.py - Contains the pricing service for calculating rental prices.
- requirements.txt - Lists all Python packages that need to be installed.
Upon starting the application, you will be greeted with the welcome screen. From here, you can choose to log in or register as a new user.
- Login automatically detects if you are an administrator or a customer based on your role.
- Registration allows you to create a new user account but as a customer.
Administrators have access to the following features:
- User Management:
- View all users
- Create users (customers and admins only)
- Update users (username, password and role)
- Delete users
- Car Management:
- View all cars
- Create cars
- Update cars (brand, model, year, and price, etc.)
- Delete cars
- Rental Management:
- View all rentals
- Approve or Deny rentals
- Update rentals
- Delete rentals
Customers have access to the following features:
- View available cars
- Rent cars
- View customer rentals
- Book a rental
- Cancel/Update a rental
- View profile
- Update profile
The Car Rental System is released under the MIT License. See the LICENSE file for full license text.
- Date handling issues when incorrect formats are entered. Ensure dates are always in YYYY-MM-DD format.
- Performance issues with large datasets due to non-optimized queries.
- User Authentication - No account lockout mechanism for multiple failed login attempts. Implement a rate-limiting or lockout mechanism after a certain number of failed attempts.
- Concurrency Issues: Potential race conditions when multiple users try to book the same car simultaneously. Implement transaction management and locks to handle concurrency.
- Data Validation: Lack of comprehensive data validation might lead to inconsistent data entries. Implement thorough validation for all user inputs and database entries.
- Security: Potential security vulnerabilities, such as SQL injection, if user inputs are not sanitized. Ensure proper sanitization of all user inputs and use parameterized queries.
- User Interface: The command-line interface might be less intuitive for some users. Consider adding more user-friendly prompts and help messages.
Developed by:
Jose Abril Jr. - Initial work and ongoing maintenance
Feel free to contact the developer for any inquiries or support regarding the system.