🚗 A car rental API application that allows customers to rent vehicles and managers to manage vehicle inventory 🚗
- Table of Contents
- API Endpoints
- API Testing
- Overview
- Built With
- How To Use
- About This Project
- Key Features
- Contact
This API provides the following endpoints:
Method | URL | Explanation |
---|---|---|
POST | https://umit8104.pythonanywhere.com/users/register/ |
New user registration |
POST | https://umit8104.pythonanywhere.com/users/auth/login/ |
User login |
POST | https://umit8104.pythonanywhere.com/users/auth/logout/ |
User logout |
Method | URL | Explanation |
---|---|---|
GET | https://umit8104.pythonanywhere.com/api/car/ |
All vehicles list |
POST | https://umit8104.pythonanywhere.com/api/reservation/ |
Create new reservation |
GET | https://umit8104.pythonanywhere.com/api/reservation/1 |
Specific booking details |
PUT | https://umit8104.pythonanywhere.com/api/reservation/1 |
Update reservation |
DELETE | https://umit8104.pythonanywhere.com/api/reservation/1 |
Delete reservation |
Postman Collection contains the necessary requests to test each endpoint of your API. You can use it to quickly understand the functionality of the API.
To test APIs via Postman, you can follow the steps below:
- Install Postman (if not installed): Download Postman.
- This Postman Collection download and import.
- Start testing APIs via Postman.
Postman Collection Link:
Rent_A_Car App API Postman Collection
Rent A Car API application is a system that aims to facilitate car rental processes. Features of the application:
- Customers:
- Can list and reserve suitable vehicles for certain date ranges.
- Can view or cancel their reservations.
- Cannot rent more than one vehicle within the same date range.
- Managers:
- The tool can perform CRUD operations for customer and reservation tables.
- Past dates are not listed and reserved vehicles cannot be booked again.
Rent A Car API uygulaması, araç kiralama süreçlerini kolaylaştırmayı hedefleyen bir sistemdir. Uygulamanın özellikleri:
- Müşteriler:
- Belirli tarih aralıklarında uygun araçları listeleyebilir ve rezerve edebilir.
- Rezervasyonlarını görüntüleyebilir veya iptal edebilir.
- Aynı tarih aralığında birden fazla araç kiralayamaz.
- Yöneticiler:
- Araç, müşteri ve rezervasyon tabloları için CRUD işlemleri yapabilir.
- Geçmiş tarihler listelenmez ve rezerve edilen araçlar tekrar rezerve edilemez.
➡ Testing user authentication processes with Postman.
➡ Testing CRUD operations on the Rent_A_Car_App API with Postman.
This project is built with the following tools and libraries:
- Django Rest Framework - A powerful framework for developing REST APIs.
- dj-rest-auth - User authentication and authorization.
- django-filter - To facilitate data filtering operations.
To clone and run this application, you'll need Git
When installing the required packages in the requirements.txt file, review the package differences for windows/macOS/Linux environments.
Complete the installation by uncommenting the appropriate package.
requirements.txt dosyasındaki gerekli paketlerin kurulumu esnasında windows/macOS/Linux ortamları için paket farklılıklarını inceleyin.
Uygun olan paketi yorumdan kurtararak kurulumu gerçekleştirin.
# Clone this repository
$ git clone https://github.com/Umit8098/Project_Django_Rest_Framework_Rent_A_Car_App_CH-12.git
# Install dependencies
$ python -m venv env
$ python -m venv env (for macOs/linux OS)
$ env/Scripts/activate (for win OS)
$ source env/bin/activate (for macOs/linux OS)
$ pip install -r requirements.txt
$ python manage.py migrate (for win OS)
$ python3 manage.py migrate (for macOs/linux OS)
# Create and Edit .env
# Add Your SECRET_KEY in .env file
"""
# example .env;
SECRET_KEY =123456789abcdefg...
"""
# Run the app
$ python manage.py runserver
- After cloning the app and installing the dependencies, you can follow these steps:
- Login Request:
- URL:
https://umit8104.pythonanywhere.com/users/auth/login/
- Method:
POST
- Body (JSON):
- URL:
{
"email": "mary@gmail.com",
"password": "mary123456"
}
- Create Reservation:
- URL:
https://umit8104.pythonanywhere.com/api/reservation/
- Method:
POST
- Headers:
- URL:
Authorization: Token <token key returned when logged in>
-
- Body (JSON):
{
"customer": 1,
"car": 2,
"start_date": "2025-05-26",
"end_date": "2025-05-28"
}
- It is an API application developed to digitize and optimize car rental processes. It offers special capabilities to both customers and managers:
- Customers:
- Can specify a date range and list available vehicles. Past dates are not listed.
- A vehicle can be reserved within the selected date range, but a second vehicle cannot be rented within the same date range.
- A reserved vehicle cannot be reserved on those dates.
- Can list reservations.
- Can delete reservations.
- Managers:
- Car table CRUD operations
- Customer (User) table CRUD operations
- Reservation table CRUD operations
- Araç kiralama süreçlerini dijitalleştirmek ve optimize etmek amacıyla geliştirilmiş bir API uygulamasıdır. Hem müşterilere hem de yöneticilere özel yetenekler sunar:
- Müşteriler:
- Tarih aralığı belirtip müsait araç listeleyebilir. Geçmiş tarihler listelenmez.
- Seçilen tarih aralığında araç rezerve edilebilir, ancak aynı tarih aralığında ikinci bir araç kiralayamaz.
- Rezerve edilmiş bir aracı, o tarihlerde rezerve edemez.
- Rezervasyonlarını listeyebilir.
- Rezervasyonlarını silebilir.
- Yöneticiler:
- Araba tablosu CRUD işlemleri
- Müşteri (Kullanıcı) tablosu CRUD işlemleri
- Reservasyon tablosu CRUD işlemleri
- 🚗 Vehicle Reservation: Customers can view available vehicles and make reservations within specified date ranges.
- 🚫 No Overlapping Reservations: Customers cannot reserve multiple vehicles during the same time period.
- 🔄 Reservation Management: Customers can view, cancel, and manage their reservations.
- 🛠️ Admin CRUD Operations: Managers can perform CRUD (Create, Read, Update, Delete) operations on vehicles, customers, and reservations.
- 📅 Future Reservations Only: The app prevents reservations for past dates and avoids re-booking reserved vehicles.
- 🛡️ User Authentication: Users must register and authenticate to access vehicle rental features and manage their reservations.
- 🚗 Araç Rezervasyonu: Müşteriler müsait araçları görüntüleyebilir ve belirlenen tarih aralıklarında rezervasyon yapabilirler.
- 🚫 Çakışan Rezervasyon Yok: Müşteriler aynı zaman diliminde birden fazla araç rezerve edemez.
- 🔄 Rezervasyon Yönetimi: Müşteriler rezervasyonlarını görüntüleyebilir, iptal edebilir ve yönetebilir.
- 🛠️ Yönetici CRUD İşlemleri: Yöneticiler araçlar, müşteriler ve rezervasyonlar üzerinde CRUD (Oluşturma, Okuma, Güncelleme, Silme) işlemlerini gerçekleştirebilir.
- 📅 Yalnızca Gelecekteki Rezervasyonlar: Uygulama, geçmiş tarihler için rezervasyonları önler ve ayrılmış araçların yeniden rezervasyonunu önler.
- 🛡️ Kullanıcı Kimlik Doğrulaması: Araç kiralama özelliklerine erişmek ve rezervasyonlarını yönetmek için kullanıcıların kaydolması ve kimlik doğrulaması yapması gerekir.
-
GitHub @Umit8098
-
LinkedIn @umit-arat