GenaPlem / django_car_rental

1 stars 1 forks source link

SwiftGo Car Rental Service

SwiftGo Car Rental Service opens the door to automotive adventures. Our platform makes car rentals easy, offering reliability, convenience, and a diverse selection of vehicles. Whether you're planning a quick city drive or an extended road trip, SwiftGo has you covered. Book your car online effortlessly and hit the road with confidence, knowing you have a reliable vehicle for your journey. Join us today and embark on your next exciting car adventure with SwiftGo.

SwiftGo responsiveness.png

View SwiftGo Car Rental service now


Table of Contents


User Experience (UX)

SwiftGo's user experience is carefully crafted to cater to users' diverse needs, providing a convenient and efficient online car rental service. From the moment users land on the homepage to the final steps of booking a car, the process is streamlined for ease and satisfaction.

Project Goals

The SwiftGo project was conceptualized to enrich the portfolio with a comprehensive full-stack application built using Django. The key objective was to simulate a real-world car rental service, complete with user authentication, vehicle selection, and booking management. This platform demonstrates a blend of functionality and design, aiming to streamline the rental process with an emphasis on user convenience.

Agile Methodology

As a nascent full-stack developer, the foray into Django was met with uncharted challenges and learning opportunities. Initial user stories were drafted to encapsulate fundamental features, setting the stage for the first iteration of development. This iterative process allowed for the prioritization of core functionalities, with additional features earmarked for future updates in the project's backlog. Agile Methodology was used to help prioritize and organize tasks, writing the user stories and using Project Boards on Github. Template was created to help write User Stories and define Epics

User Stories Template ![User Stories Template](documentation/images/design/user_stories_template.png)
Epic Template ![Epic Template](documentation/images/design/epic_template.png)
User Stories, Issues ![User Stories, Issues](documentation/images/design/issues.png)
Project Board ![Project Board](documentation/images/design/project_board.png)

User Stories

Epics

User Stories

  1. Account Security and Management

    • User registration, log in, log out
    • Forgot password
    • Email Confirmation
  2. User Experience and Engagement and Booking System Enhancement

    • Alert messages
    • Crud functionality
    • Car pagination
    • Admin panel
    • Double bookings
    • Book Car
    • Total Price

Detailed look can be found in the project board

Target Audience

SwiftGo serves a broad demographic, welcoming anyone over the age of 20 with a minimum of two years of driving experience. Insurance options are tailored to different age groups, ensuring inclusivity and catering to varied user needs. The service is particularly advantageous for individuals who do not own a car or require a vehicle sporadically.

First time user

New users are greeted by the homepage's hero section, which presents a picturesque background, an inviting title, and a slogan that encapsulates SwiftGo's ethos: "Explore in Style - Your journey, your terms." A call-to-action button, "Rent Now," beckons users to the cars listing page where they can embark on their rental journey.

On selecting a vehicle, first-time users are directed to the Car Reservation page where details of the chosen car are displayed. A prompt encourages unregistered users to sign in, guiding them seamlessly to the sign-in page. The header, consistently present across all pages, provides quick navigation to the sign-in page.

Registered User

Once registered, users can fully engage with SwiftGo's services. The sign-up process is fortified with email confirmation to ensure security and authenticity. Upon successful registration and email verification, users gain the ability to book vehicles. The booking form, presented after the user has signed in, requests essential details and preferences, respecting the user's time and choices.

Should users wish to modify their upcoming bookings, the profile page provides a comprehensive view of their reservations, along with options to edit or cancel them. The booking process is safeguarded by validations in the datepicker, ensuring no overlaps with existing bookings and adherence to the rental rules.

Admin user

Administrative features are accessible through the Django admin panel. These include managing the fleet, adjusting bookings, and toggling vehicle availability. This level of control ensures that the fleet's status is accurately reflected on the website, allowing for maintenance and updates as needed.

Design

The Woodland Whispers Retreat website boasts an inviting and visually pleasing design. Earthy tones and a warm color palette evoke a sense of tranquility. The navigation bar features a circular logo and easy-to-read text. Captivating photos are displayed in a bordered carousel with elegant captions. The about section utilizes a dark background and horizontal lines for clarity. Social media links are presented in the contact section, and the footer complements the overall design.

Color Scheme

The site adopts a color palette of #26222A (dark gray), #FF8A00 (vibrant orange), and white, ensuring readability and a modern, user-friendly interface.

Color Scheme

Images

All images, including the vehicle assets in the database, were generated by Dall-e in ChatGPT, aligning with the site's aesthetic and branding.

Typography

For SwiftGo Car Rental Service, typography plays a key role in ensuring readability and enhancing the overall aesthetic of the site:

Wireframes

The wireframes provided an initial blueprint for SwiftGo Car Rental Service's design. Below are the wireframes for various pages, both for desktop and mobile versions:

Home Page ![Home Page](documentation/images/design/home_page.png)
Home Page mobile ![Home Page mobile](documentation/images/design/home_page_mobile.png)
Our Cars ![Our Cars Page](documentation/images/design/our_cars.png)
Our Cars Mobile ![Our Cars Page mobile](documentation/images/design/our_cars_mobile.png)
Renting Page ![Renting Page](documentation/images/design/renting_page.png)
Renting Page Mobile ![Renting Page mobile](documentation/images/design/renting_page_mobile.png)
Profile Page ![Profile Page](documentation/images/design/profile.png)
Profile Page Mobile ![Profile Page mobile](documentation/images/design/profile_mobile.png)
Login Page ![Login Page](documentation/images/design/login.png)
Login Page Mobile ![Login Page mobile](documentation/images/design/login_mobile.png)
Registration Page ![Registration Page](documentation/images/design/registeration.png)
Registration Page Mobile ![Registration Page mobile](documentation/images/design/registration_mobile.png)

Throughout the development process, the design evolved significantly. Changes were made to enhance user experience, improve aesthetics, and incorporate new features. These modifications were based on iterative testing, user feedback, and a continuous refinement approach. As a result, the final implementation may vary from these initial wireframes, reflecting the adaptive and responsive nature of the development process.

Data Models

  1. AllAuth User Model
    • Django Allauth, the User model is the default user model provided by the Django authentication system
    • The User entity has a one-to-many relationship with the Booking entity. This means that a User can have multiple Bookings, but each Booking is associated with only one User.

  2. Car Model
    • A Car can have multiple Bookings, but each Booking is associated with only one Car. This is represented by the foreign key relationship between Car and Booking.
    • Admin can add cars through djangos admin panel.
    • Only Admin can change the data in the backend.
    • User can see the Car information and image based on the chosen Car.
    • Information provided is price per day, image, description(make, model and year), number of seats, transmission type and fuel type

  3. Booking Model
    • A User can have multiple Bookings, but each Booking is associated with only one User. This is represented by the foreign key relationship between User and Booking.
    • Booking model has a feature that prevents overlapping bookings, so users cant book on the same dates
    • Total price is also calculated either in front-end and in the backend that is then displayed to user to show the total price of the booking, that includes if a user also adds child seat and change insurance type for the booking.
    • Full CRUD functionality is available to the user.
    • User in order to book has to fill name and surname, start and end dates, select insurance type and optional child seat if required.

User Journey

The user journey for SwiftGo Car Rental Service is designed to be intuitive and efficient, ensuring users can navigate the service with ease from start to finish.

User Journey

  1. Start: The journey begins at the Home Page, where users are introduced to the service.
  2. Account Registration: Users can register for an account by providing necessary details. An email confirmation is required to complete the registration process.
  3. Search for Cars: Once registered, users can search for available cars.
  4. Select a Car: Users select a car from the list of available options.
  5. View Car Details: Detailed information about the car, including price and amenities, is available for users to make an informed decision.
  6. Booking: Users select their dates, specify the number of guests, choose any additional amenities, and proceed to book the car.
  7. Booking Confirmation: After booking, users receive a confirmation of their reservation.
  8. CRUD Operations: Users have the ability to manage their bookings by editing or canceling as needed.
  9. End: The journey concludes with the user completing their car rental experience or returning to manage their bookings.

Each step of the journey is supported by user-friendly features and real-time feedback, ensuring a smooth rental process.

Database Scheme

An Entity Relationship Diagram (ERD) provides a visual representation of the database schema used by SwiftGo Car Rental Service. This schema is designed to handle user details, car information, and bookings effectively.

Models Diagram

Car Model

The Car entity encapsulates the essential details of each vehicle available for rental:

Booking Model

The Booking entity represents reservations made by users and includes:

The relationship between Car and Booking models supports the application's business logic, ensuring cars cannot be double-booked and are only rented out when available.

Security Features

User Authentication

We use Django Allauth, a comprehensive authentication and authorization solution for Django. It handles user registration, logging in and out, and account management.

Login Required

Key views like car_details (which include a booking form in), profile (to see all your bookings), edit_booking, and delete_booking are protected and ensures that only authenticated users can access and perform actions related to their bookings.

CSRF Protection

Django's built-in CSRF protection guards against Cross-Site Request Forgery attacks. Every user session has a unique CSRF token that must be included with form submissions, preventing attackers from making unauthorized requests.

Form Validation

Our car_details view employs the BookingForm class to validate input data, ensuring that all bookings meet our criteria regarding date ranges, and non-overlapping reservations.

Overlapping Bookings Prevention

To prevent double bookings, our system checks for any existing bookings with overlapping dates. If a conflict is detected, the user is informed with an error message, maintaining the integrity of the booking calendar.

Custom Error Pages

We've created custom error pages to handle 404, providing users with a clear message and an easy way back to the homepage by nav menu.

Features

SwiftGo Car Rental Service is designed to provide users with a comprehensive, intuitive, and secure online car rental experience. Here's an overview of the key features:

User Account Management

Booking Management

Support and Responsiveness

Technical Features

Future Features

The SwiftGo team is committed to enhancing the platform regularly, prioritizing user feedback and industry standards to deliver the best possible car rental experience.

Technologies Used

Languages Used

Databases Used

Frameworks Used

Programs Used

Deployment and Local Development

Live deployment can be found on this View SwiftGo Car Rental live website here

Local Development

How to Fork

  1. Log in(or Sign Up) to Github
  2. Go to repository for this project SwiftGo Car Rental Service
  3. Click the fork button in the top right corner

How to Clone

  1. Log in(or Sign Up) to Github
  2. Go to repository for this project SwiftGo Car Rental Service
  3. Click on the code button, select whether you would like to clone with HTTPS, SSH or GitHub CLI and copy the link shown.
  4. Open the terminal in your code editor and change the current working directory to the location you want to use for the cloned directory.
  5. Type the following command in the terminal (after the git clone you will need to paste the link you copied in step 3 above)
  6. Set up a virtual environment.
  7. Install the packages from the requirements.txt file - run Command pip3 install -r requirements.txt

ElephantSQL Database

SwiftGo Car Rental Service is using ElephantSQL PostgreSQL Database

  1. Click Create New Instance to start a new database.
  2. Provide a name (this is commonly the name of the project: tribe).
  3. Select the Tiny Turtle (Free) plan.
  4. You can leave the Tags blank.
  5. Select the Region and Data Center closest to you.
  6. Once created, click on the new database name, where you can view the database URL and Password.

Cloudinary

SwiftGo Car Rental Service is using Cloudinary

  1. For Primary interest, you can choose Programmable Media for image and video API.
  2. Optional: edit your assigned cloud name to something more memorable.
  3. On your Cloudinary Dashboard, you can copy your API Environment Variable.
  4. Be sure to remove the CLOUDINARY_URL= as part of the API value; this is the key.

Heroku Deployment

Prepare environment and settings.py

Add the following Config Vars in Heroku:

Heroku needs two additional files to deploy properly

Deploy

  1. Make sure DEBUG = False in the settings.py
  2. Go to the deploy tab on Heroku and connect to GitHub, then to the required repository.
  3. Scroll to the bottom of the deploy page and either click Enable Automatic Deploys for automatic deploys or Deploy Branch to deploy manually. Manually deployed branches will need re-deploying each time the GitHub repository is updated.
  4. Click 'Open App' to view the deployed live site.

Site is now live

Testing

Please see TESTING.md for all the detailed testing performed.

References

Docs

Content

Acknowledgments