LeulTew/CarRental-ThreeJS-MVC
ASP.NET Core MVC car rental app with Three.js landing (no React), EF Core + Identity, PayPal sandbox, and Git LFS. Portfolio-ready.
π CarRental 5.0 β ASP.NET Core MVC + Three.js
Fast, full-stack car rental platform with an interactive Three.js landing page (no React), robust MVC backend, and PayPal sandbox payments. Experience cutting-edge web development in action!
π₯ Download Demo Video | π Live App | π Report Issue
π Table of Contents
- β¨ Overview
- π¬ Demo & Screenshots
- π Features
- ποΈ Architecture
- π οΈ Tech Stack
- β‘ Quick Start
- π§ Configuration
- ποΈ Data & Migrations
- π£οΈ API Routes
- β‘ Performance Notes
- π§Ή Repository Hygiene
- π Resume Highlights
β¨ Overview
Welcome to CarRental 5.0, a showcase of modern web development excellence! This project delivers a complete car rental experience with:
- π¨ Immersive Landing: Pure Three.js with GLTF models for stunning visuals and lightning-fast load times (no React overhead).
- π§ Robust Backend: ASP.NET Core MVC with Entity Framework, authentication, payments, and email integration.
- π³ Payment Integration: Secure PayPal sandbox transactions with currency conversion.
- π Advanced Filtering: Multi-criteria search, favorites, reviews, and role-based management.
ποΈ Project Structure
Carrental/
βββ Controllers/ # MVC Controllers (Home, Car, Account, etc.)
βββ Models/ # Domain entities & ViewModels
βββ Views/ # Razor templates
βββ Services/ # Business logic (Payments, Email)
βββ wwwroot/ # Static assets (Three.js, GLTF models)
βββ Migrations/ # EF Core migrations
βββ Program.cs # App startup & configuration
Key Files for Orientation:
- Landing Page:
Views/Home/Index.cshtml+wwwroot/Home/assets/js/main.js - 3D Assets:
wwwroot/car1..car4/(GLTF models) - Payments:
Services/PaypalServices.cs - Database:
Models/CarContext.cs
π¬ Demo & Screenshots
Dive into the action with our interactive demo and key app screens!
π₯ Demo Video
π₯ Download & Play Demo Video
Download the MP4 file and play it locally to see the Three.js landing, catalog browsing, booking flow, and payments in action!
πΈ Key Screenshots
| Feature | Description | File Path |
|---|---|---|
| π Home (Three.js Landing) | Interactive 3D model viewer with navigation | Views/Home/Index.cshtml |
| π Catalog & Filters | Advanced search with make/model, price, availability | /Car |
| π³ Payment Screen | PayPal checkout with booking summary | Views/Car/ProcessPayment.cshtml |
πΌοΈ Screenshots Gallery
Add your own screenshots to docs/screens/ and update paths below:
- Landing Page:
docs/screens/landing.png - Catalog View:
docs/screens/catalog.png - Details/Booking:
docs/screens/details.png - Payment Flow:
docs/screens/payment.png
π₯ Download Demo Video: docs/assets/Carrentaldemo.mp4
π Features
π¨ Frontend Highlights
- Three.js Landing Page: GLTF model loading with OrbitControls, responsive scaling, and arrow navigation
- Responsive Design: Mobile-friendly UI with vanilla JS/CSS and Swiper for galleries
π§ Backend Powerhouse
- Advanced Filtering: Make, Model, Type, Color, Price Range, Availability, Favorites, Sorting
- Car Management: Gallery, versions (for sale), reviews, favorites toggle
- Booking System: Date conflict checks, total calculations, completion tracking
- Payment Processing: PayPal sandbox with redirect/return flow and ETBβUSD conversion
π Security & Auth
- ASP.NET Identity: User registration, login, roles (Admin, Manager, Provider, Customer)
- Google OAuth: External login integration
- Email Notifications: Confirmation and forgot-password via SMTP with HTML templates
π€ Extra Features
- Favorites: Many-to-many user-car relationships
- Speech-to-Text: Google Cloud Speech API endpoint for voice inputs
- Role-Based Access: Granular permissions for different user types
ποΈ Architecture
πΊοΈ Module Map
HTTP Request
β
Controller (Home/Car/Account)
β
Repository / DbContext
β
Domain Models β ViewModels
β
Razor View
β
HTML Response
Parallel: Three.js β GLTFLoader β wwwroot/car{1..4} (MIME-mapped)
Core Controllers: Home, Car, Account, Admin, Role, SpeechToText
ποΈ Domain Model (ER Diagram)
AppUser ββββ Favorite ββββ Car ββββ CarImage
β β β
β β ββββ CarVersion (sale variants)
β β
ββββ Booking ββββ Payment
β
ββββ Review (via UserId)
Key Relationships:
Favorite: Composite key (UserId, CarId) for many-to-manyBooking: Links toPaymentviaTransactionId, controlsIsCompletedCar: Supports both rental and sale modes- Monetary Fields:
decimal(18,2)precision via EF mappings
π Key Flows
- Search & List:
CarController.Indexβ Filter pipeline β Paginated results - Booking (Rent): Create
Bookingβ Redirect to PayPal β Success updates DB - Purchase (Sale): Simplified flow with
IsForSaleflag - Payment:
PayUsingPayPalβ Approval βSuccesspersists transaction - Email:
BookingConfirmationβ HTML template β SMTP send
π οΈ Tech Stack
| Category | Technologies |
|---|---|
| Backend | ASP.NET Core MVC (.NET 6.0), Entity Framework Core (SQL Server) |
| Frontend | Three.js + GLTFLoader + OrbitControls, Razor Views, Vanilla JS/CSS |
| Auth | ASP.NET Identity, Google OAuth |
| Payments | PayPal .NET SDK (Sandbox) |
| SMTP via AuthMessageSenderOptions | |
| Database | SQL Server with EF Migrations |
| Deployment | GitHub Actions CI, Git LFS for assets |
| Other | Swiper (galleries), Google Cloud Speech API |
β‘ Quick Start
Prerequisites
- .NET 6 SDK
- SQL Server (or Docker for local)
Installation
-
Clone & Navigate:
git clone https://github.com/LeulTew/CarRental-ThreeJS-MVC.git cd CarRental-ThreeJS-MVC -
Configure Environment:
cp Carrental/Carrental/appsettings.example.json Carrental/Carrental/appsettings.Development.json # Edit appsettings.Development.json with your secrets -
Setup Database:
dotnet ef database update --project Carrental/Carrental/Carrental.csproj
-
Run the App:
dotnet run --project Carrental/Carrental/Carrental.csproj
-
Browse: https://localhost:7022/
π Fish Shell Commands
# Restore dependencies
dotnet restore Carrental/Carrental/Carrental.csproj
# Run with hot reload
dotnet run --project Carrental/Carrental/Carrental.csprojπ§ Configuration
Secure your app with environment variables (recommended for production):
| Variable | Description | Example |
|---|---|---|
ConnectionStrings__MyConnection |
SQL Server connection string | Server=localhost;Database=CarRental;... |
GoogleKeys__ClientId |
Google OAuth Client ID | your-client-id.apps.googleusercontent.com |
GoogleKeys__ClientSecret |
Google OAuth Secret | your-secret |
AuthMessageSenderOptions__Email |
SMTP email | noreply@carrental.com |
AuthMessageSenderOptions__Password |
SMTP password | your-password |
AuthMessageSenderOptions__SmtpServer |
SMTP server | smtp.gmail.com |
AuthMessageSenderOptions__SmtpPort |
SMTP port | 587 |
PayPal__ClientId |
PayPal Client ID | your-paypal-client-id |
PayPal__ClientSecret |
PayPal Secret | your-paypal-secret |
See appsettings.example.json for full structure.
ποΈ Data & Migrations
- DbContext:
CarContext(inheritsIdentityDbContext<AppUser>) - Precision: Monetary fields use
decimal(18,2)for accurate calculations - Relationships: Many-to-many
Favoritewith composite keys
Migration Commands
# Apply existing migrations
dotnet ef database update --project Carrental/Carrental/Carrental.csproj
# Create new migration
dotnet ef migrations add YourMigrationName --project Carrental/Carrental/Carrental.csproj
dotnet ef database update --project Carrental/Carrental/Carrental.csprojπ£οΈ API Routes
| Route | Method | Description |
|---|---|---|
/ |
GET | Landing page (Three.js) |
/Car |
GET | Catalog with filters |
/Car/Search |
GET | Search with query params |
/Car/Details/{id} |
GET | Car details & booking |
/Car/Book |
POST | Create rental booking |
/Car/BuyNow |
POST | Purchase car |
/Car/PayUsingPayPal |
POST | Initiate PayPal payment |
/Car/Success |
GET | Payment success callback |
/Car/ToggleFavorite |
POST | Add/remove favorite |
/Account/Login |
GET/POST | User login (with Google OAuth) |
/SpeechToText |
POST | Voice input processing |
β‘ Performance & UX Notes
- π Fast Loading: Pure Three.js with CDN imports minimizes bundle size and TTI
- π± Responsive: Adaptive model scaling and touch-friendly controls
- π State Preservation: Query params maintain filter/pagination state
- π― MIME Types: GLTF assets served correctly via
FileExtensionContentTypeProvider
π§Ή Repository Hygiene
- Git LFS: Tracks large assets (images, GLTF/GLB, videos, .bacpac) to keep repo lean
- .gitignore: Excludes build artifacts, secrets, Windows artifacts, and bulk datasets
- Ignored Assets:
Cars/folder (optional local data)
π Resume Highlights
This project demonstrates enterprise-level skills:
- Full-Stack Mastery: ASP.NET MVC with EF Core, Three.js integration, payment processing
- Architecture Excellence: Repository pattern, clean domain models, precise mappings
- Security Best Practices: Config binding, env vars, OAuth integration
- Performance Optimization: CDN usage, LFS for assets, responsive design
- DevOps Ready: CI/CD with GitHub Actions, migrations, container-friendly
Perfect for portfoliosβshowcases modern web dev from 3D graphics to secure payments!
π€ Contributing
We welcome contributions! Here's how to get started:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature. - Commit your changes:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/your-feature. - Open a Pull Request.
Please ensure your code follows the project's style and includes tests where applicable.
π Engineering Notes: See docs/summary.md for detailed code insights.