- Introduction
- Setting up Vagrant Enviroment (Optional)
- Backend - Laravel
- DB Schema
- FrontEnd
- References
- Authors
The purpose of the application is to allow Car Rental businesses to make reservation process for their customers both intuitive and easier. This application is based on REST API architecture which was realized with Laravel, AngularJS and MySQL. UI is powered by Bootstrap.
After forking this project create database.sqlite file from project directory.
touch database/database.sqlite
composer install
npm install
Run migration
#Navigate to project directory
php artisan migrate --seed
or
php artisan migrate:refresh --seed
These commands will seed databse with dummy data. Now run
php artisan serve
Test Login
email: test@mail.com
pass: 85200258
List of routes used by this application with limited access and grants. Routes are defined inside app\Http\routes.php
-
User Group: Administrator
- /admin
- /admin/cars - View for managing cars within the fleet
- /admin/makes - View for managing car makes
- /admin/branches - View for managing company branches
- /admin/fuels - View for managing fuels
- /admin/extras - View for managing extra buying options
- /admin/classes - View for managing car classes
- /admin/reservations - View for managing reservations
- /admin/api/reservations - API to retrieve all reservations
- /admin/api/reservations/confirm - API to confirm reservation was received
- /admin/api/reservations/deliver - API to confirm that car was delivered to customer
- /admin/api/reservations/returned - API to confirm that car was returned and set reservation as completed
- [POST] /api/makes - API to add makes
- [POST] /api/fuels - API to add fuels
- [POST] /api/extras - API to add extras
- [POST] /api/cities - API to add cities
- [POST] /api/classes - APi to classes
- [POST] /api/colors - API to add colors
- [POST] /api/branches - API to add branches
- [POST] /api/models - API to models under available make
- [POST] /api/cars - API to add cars
-
Access: Authenticated users
- /api/reservation/save - API to confirm reservation by user
- /api/users/reservations - API to retrieve reservation for user
- /reservations - View to display user's reservations
-
Access: Public
- / - View home page
- /fleet - View to display fleet
- /contact - View to display contact form
- /register - View to display registration form
- /login - View to display login form
- /reset - View for password reset
- /settings/lang/{id} - Route to change the current locale
- /api/authenticated - Route to check whether an user is authenticated
- /api/makes - API to retrieve makes
- /api/fuels - API to retrieve fuels
- /api/extras - API to retrieve extras
- /api/cities - API to retrieve cities
- /api/classes - API to retrieve car classes
- /api/colors - API to retrieve colors
- /api/branches - API to retrieve branches
- /api/models - API to retrieve models
- /api/cars - API to retrieve cars
- /api/email/send - API to send an email
Controllers used by this application are located inside App\Http\Controllers
- HomeController - returns public Views
- Admin Controller - returns Views accessible only by Administrator
- ApiController - All API endpoints
- AuthController - Auth Controller
- PasswordController - Password Recovery Controller
Views used by this application are located inside resources\views
- /admin
- branches - view, edit, add branches
- cars - view, edit, add cars
- classes - view, edit, add car classes
- extras - view, edit, add extras
- fuels - view, edit, add fuel
- makes - view, edit, add makes
- reservations - view and manage reservations
- /auth
- /email
- password - recover password template
- /passwords
- email - reset password template
- reset - reset password
- /email
- /layouts
- app - parent view
- /user
- reservations - display user's reservations
- contact - Contact View
- fleet - Fleet View
- home - Home Page View
Laravel Default Auth. More details can be found at:
Auth Controllers were overridden inside App\Http\Controllers\Auth\AuthController.php
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
'address' => 'required',
'city' => 'required',
'phone' => 'required',
]);
}
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'address' => $data['address'],
'city' => $data['city'],
'phone' => $data['phone'],
]);
}
Built-in localization Laravel Localization
Translation files can be found within resources\lang
directory.
The application currently supports English and Croatian languages.
Database management system used by this app is MySQL. DB Schema, i.e. Model Structure can be seen here.
This app uses AngularJS as the frontend JS framework. Everything Angular related can be found withing public\js\app
directory.
- app.js - Initialize AngularJS app
- /controllers/RentACarController.js - Defines app controllers
- /services/RentACarService.js - Defines calls to API endpoints
For the better UI, this app uses Bootstrap CSS framework
4-step reservations form is displayed on the Home Page
- Pickup and return place and time selection as well as renting duration
- Vehicle selection
- Extras selection
- Reservation confirmation
A user can navigate through the reservation form if these rules are met
- A User is logged in
- Both pickup and return place and time are selected (Step 1.)
- Vehicle is selected (Step 2.)
If at least one rule is not met, a user will not be able to go to the next step.
If all the rules are met, a user will be able to complete the reservation process.
This page displays every car within the fleet.
This page allows administrators to manage branches.
This page allows administrators to manage cars.
This page allows administrators to manage car classes.
This page allows administrators to manage extras.
This page allows administrators to manage fuel.
This page allows administrators to manage makes and models.
This page allows administrators to manage reservation. Each reservation has 4 states. First state, Reservation submitted by user
. Second state, Reservation confirmed
. Third state, Car delivered to a user
. Fourth state, Car returned by user; Reservation Completed
.
This page displays reservations made by a user.
- Laravel - https://laravel.com
- AngularJS - angularjs.org
- angular-file-model - https://github.com/ghostbar/angular-file-model
- Bootstrap - https://getbootstrap.com/getting-started/
- Bootstrap DateTime Picker (Jonathan Peterson) - https://github.com/Eonasdan/bootstrap-datetimepicker
- jQuery - https://jquery.com
- MomentJS - http://momentjs.com
- Anton Krizmanić @ https://github.com/cupko55
- Antonio Šamuga @ https://github.com/thebasix