Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
baa1d24
development branches was created for futher development with PostgreS…
PuLeeNa Nov 3, 2025
c3ad980
Refactor backend structure: remove unused classes, implement entity a…
PuLeeNa Nov 3, 2025
2fa21dd
Merge pull request #3 from EnterpriseApplicationDevelopmentProject/fi…
kin-lgtm Nov 3, 2025
24d1b3e
update poxml
kin-lgtm Nov 3, 2025
5ff9bf6
property update
kin-lgtm Nov 3, 2025
c8f8dad
entity create
kin-lgtm Nov 3, 2025
537f5b1
create DTO
kin-lgtm Nov 3, 2025
3773726
create controller
kin-lgtm Nov 3, 2025
d6a7474
create mapper
kin-lgtm Nov 3, 2025
3a2d573
create repo
kin-lgtm Nov 3, 2025
762a538
create service
kin-lgtm Nov 3, 2025
27c21ed
create impl
kin-lgtm Nov 3, 2025
ec1d2c2
add username password
kin-lgtm Nov 3, 2025
37cbbed
CSRF tocken
kin-lgtm Nov 3, 2025
53e7d55
Merge pull request #4 from EnterpriseApplicationDevelopmentProject/fi…
kin-lgtm Nov 3, 2025
5b78848
created EmployeeDTO and Employee Entity entirely with mentioning how …
PuLeeNa Nov 3, 2025
c547685
progress and notification
Nethmini-jayasekara Nov 4, 2025
5758a7e
progress2
Nethmini-jayasekara Nov 4, 2025
bc995c1
Create the authentication
behan02 Nov 4, 2025
6c6233f
Merge pull request #5 from EnterpriseApplicationDevelopmentProject/em…
kin-lgtm Nov 4, 2025
b0bb88e
Create reset password and forgot password endpoints
behan02 Nov 4, 2025
deaaa9a
Add employee entity and employee dto
behan02 Nov 4, 2025
6b702c4
Merge branch 'development' into auth-new
kin-lgtm Nov 4, 2025
537b2ea
Merge pull request #8 from EnterpriseApplicationDevelopmentProject/au…
kin-lgtm Nov 4, 2025
6cb4eb3
Create the customer entity and employee entity
behan02 Nov 4, 2025
cfaa1cc
Merge branch 'development' into auth-new-2
kin-lgtm Nov 4, 2025
a61f213
Merge pull request #9 from EnterpriseApplicationDevelopmentProject/au…
kin-lgtm Nov 4, 2025
cff0c4f
progress controller
Nethmini-jayasekara Nov 5, 2025
0b267ef
Merge pull request #10 from EnterpriseApplicationDevelopmentProject/f…
kin-lgtm Nov 5, 2025
c174d4e
Crud operations in Appoinments
dinujayawkt Nov 5, 2025
500993f
update vehicle and connect customer
kin-lgtm Nov 5, 2025
9d3da36
resolve email service conflict
kin-lgtm Nov 5, 2025
dfe9bce
add customer profile update
kin-lgtm Nov 5, 2025
6930fe9
Added project Crud operations
dinujayawkt Nov 5, 2025
c3c7325
Added updates with fix/vehicle-profile
dinujayawkt Nov 5, 2025
6fd6302
Merge branch 'fix/create-vehicle-profile' into Appoinments
kin-lgtm Nov 5, 2025
4e3d38e
added authentication lines for appoinments
dinujayawkt Nov 6, 2025
3ece3be
updated authentications in securityconfig projects visibilty
dinujayawkt Nov 6, 2025
7ee12c4
Created Timelog functionality
dinujayawkt Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions CLOUDINARY_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Cloudinary Setup Guide

## Overview
This application uses Cloudinary for storing and managing vehicle images.

## Setup Instructions

### 1. Create a Cloudinary Account
1. Go to [Cloudinary](https://cloudinary.com/)
2. Sign up for a free account
3. Once logged in, go to your [Dashboard](https://cloudinary.com/console)

### 2. Get Your Credentials
From your Cloudinary Dashboard, copy:
- **Cloud Name**
- **API Key**
- **API Secret**

### 3. Configure Environment Variables

#### Option 1: Using Environment Variables (Recommended for Production)
Set the following environment variables:

**Windows (PowerShell):**
```powershell
$env:CLOUDINARY_CLOUD_NAME="your-cloud-name"
$env:CLOUDINARY_API_KEY="your-api-key"
$env:CLOUDINARY_API_SECRET="your-api-secret"
```

**Windows (Command Prompt):**
```cmd
set CLOUDINARY_CLOUD_NAME=your-cloud-name
set CLOUDINARY_API_KEY=your-api-key
set CLOUDINARY_API_SECRET=your-api-secret
```

**Linux/Mac:**
```bash
export CLOUDINARY_CLOUD_NAME="your-cloud-name"
export CLOUDINARY_API_KEY="your-api-key"
export CLOUDINARY_API_SECRET="your-api-secret"
```

#### Option 2: Update application.properties (For Development)
Replace the placeholder values in `src/main/resources/application.properties`:
```properties
cloudinary.cloud-name=your-actual-cloud-name
cloudinary.api-key=your-actual-api-key
cloudinary.api-secret=your-actual-api-secret
```

⚠️ **Warning:** Never commit your actual credentials to version control!

### 4. Test the Configuration
Run your application and try uploading a vehicle image using the API endpoints.

## API Endpoints

### Create Vehicle with Image
```http
POST /api/vehicles
Content-Type: multipart/form-data

Parameters:
- vehicle: JSON string of VehicleDTO
- image: Image file (optional)
```

### Update Vehicle with Image
```http
PUT /api/vehicles/{id}
Content-Type: multipart/form-data

Parameters:
- vehicle: JSON string of VehicleDTO
- image: Image file (optional)
```

## Example Using Postman

1. **Create Vehicle with Image:**
- Method: POST
- URL: `http://localhost:8080/api/vehicles`
- Body type: form-data
- Add fields:
- `vehicle` (text):
```json
{
"customerId": 1,
"model": "Toyota Camry",
"color": "Blue",
"vin": "1HGBH41JXMN109186",
"licensePlate": "ABC-1234",
"year": 2023,
"registrationDate": "2023-01-15"
}
```
- `image` (file): Select your vehicle image

2. **Update Vehicle with Image:**
- Method: PUT
- URL: `http://localhost:8080/api/vehicles/1`
- Body type: form-data
- Add fields:
- `vehicle` (text): VehicleDTO JSON
- `image` (file): New vehicle image

## Image Specifications

- **Supported formats:** JPEG, PNG, GIF, WebP
- **Maximum file size:** 10MB (can be configured)
- **Automatic optimization:** Images are automatically resized to max 800x600 pixels
- **Storage location:** Images are stored in folder `ead-automobile/vehicles/`

## Features

✅ **Automatic image upload** to Cloudinary
✅ **Image deletion** when vehicle is deleted
✅ **Image update** - old image is automatically deleted
✅ **Image optimization** - automatic resizing and quality optimization
✅ **Secure storage** - images are served over HTTPS

## Troubleshooting

### Issue: "Failed to upload image"
- Check your Cloudinary credentials are correct
- Verify your internet connection
- Check Cloudinary dashboard for quota limits

### Issue: "Invalid API key"
- Ensure environment variables are set correctly
- Restart your application after setting environment variables

### Issue: "Upload quota exceeded"
- Free tier has monthly limits (25GB storage, 25 credits/month)
- Consider upgrading your Cloudinary plan

## Security Notes

🔒 **Never commit credentials to Git**
- Add `.env` to `.gitignore`
- Use environment variables in production
- Rotate API credentials periodically

## Additional Resources

- [Cloudinary Documentation](https://cloudinary.com/documentation)
- [Cloudinary Java SDK](https://cloudinary.com/documentation/java_integration)
Loading