This is a web application designed to handle the rental of Tesla cars in Majorca. It offers a wide range of features related to users, reservations, and cars, accessible through both a Web API interface and a website. Users can register, log in, create reservations, and browse available rental locations and car models.
In the Back-End part, written in C# using ASP.NET, the following technologies were used:
- AutoMapper
- JWT Bearer
- BCrypt
- FluentValidation
- NLog
- SQL
The Front-End part is built using React and leverages the following technologies:
- Axios
- React-Router-Dom
- Controllers
- ReservationController.cs
- TeslaCarController.cs
- UserController.cs
- Authorization
- MinimumAgeRequirement.cs
- Handler
- MinimumAgeRequirementHandler.cs
- Data
- Entity
- Address.cs
- Reservation.cs
- Role.cs
- TeslaCar.cs
- TeslaRentingDbContext.cs
- User.cs
- Enum
- Availability.cs
- MappingProfile
- TeslaRatingMappingProfile.cs
- Model
- AssignRoleDto.cs
- CreateReservationDto.cs
- CreateTeslaCarDto.cs
- LoginDto.cs
- RegisterUserDto.cs
- ReservationDto.cs
- TeslaCarDto.cs
- UpdateReservationDto.cs
- UpdateTeslaCarDto.cs
- UserDto.cs
- Authenticator
- AuthenticationSettings.cs
- Validator
- RegisterUserDtoValidator.cs
- Entity
- Exception
- BadRequestException.cs
- NotFoundException.cs
- TimeOutException.cs
- Middleware
- ErrorHandlingMiddleware.cs
- RequestTimeMiddleware.cs
- Service
- ReservationService.cs
- TeslaCarService.cs
- UserService.cs
- Interface
- IReservationService.cs
- ITeslaCarService.cs
- IUserService.cs
- Program.cs
- TeslaRenting.csproj
- addressSeed.json
- appsettings.Development.json
- appsettings.json
- nlog.config
- roleSeed.json
- teslaCarSeed.json
- userSeed.json
- public
- src
- App.js
- CarDetails.js
- CarList.js
- Create.js
- Home.js
- Navbar.js
- NotFound.js
- UseFetch.js
- index.css
- index.js
- Api
- apiCalls.js
- photos
- teslaphoto.jpg
The data structure is as follows:
The tables are constructed based on the following models:
- Address.cs
- Reservation.cs
- Role.cs
- TeslaCar.cs
- User.cs
The API endpoints are divided into three parts:
To ensure user security, after registration, passwords are hashed using BCrypt and stored in a hashed form in the database.
To run this project, follow these steps:
-
Start the Back-End part first, which runs on
localhost:5001/
. Ensure you have the necessary dependencies and tools, such as the Microsoft .NET SDK, installed on your computer. -
Navigate to the Back-End project directory in the command prompt or terminal.
-
Run the Back-End by entering the command
dotnet run
. The application will be launched atlocalhost:5001/
.
-
Next, start the Front-End part. Navigate to the Front-End project directory in the command prompt or terminal.
-
Install project dependencies by running the command
npm install
. -
Launch the Front-End by entering the command
npm start
. The application will be accessible at the appropriate URL.
These are the basic steps to run the project. Make sure you have all the required dependencies installed before running the application.
To avoid access issues, it is recommended to log in with the pre-seeded user with the following data:
- Email: "oskar@test.com"
- Password: "test123"
This user has administrative privileges, allowing access to all application functions.