Context & problem
The project separates gateway, vehicle and user responsibilities across Java/Spring Boot services. The vehicle service manages records and vehicle-to-user associations, while the companion user service integrates with Amazon Cognito. AWS work included Amazon RDS for MySQL persistence and EC2/VPC infrastructure configuration.
Backend services & cloud infrastructure
AWS & service architecture
Configured Amazon EC2 and VPC infrastructure for a car-rental backend using Amazon RDS for MySQL persistence and Amazon Cognito for user management.
Application services and integrations
Gateway
User and vehicle API proxies
Vehicle service
Vehicle records, validation and user associations.
Amazon RDS
MySQL database integration
User service
User creation, lookup and listing.
Amazon Cognito
User-pool integration
Infrastructure I configured
Amazon EC2
Compute configuration
Amazon VPC
Network configuration
The linked repository covers the vehicle-service module. The API walkthrough below records that service against a disposable local database.
Recorded API workflow
Create, associate, release.
Follow one vehicle through this Spring Boot service: register its details, associate it with a user, then release it for reuse.
Local demonstration with fictional data · These controls inspect recorded requests; they do not send API calls.
Create / recorded result
Vehicle registered and available
The service validates the fictional vehicle, assigns its UUID and saves an AVAILABLE record.
- Status
- AVAILABLE
- Associated user
- No association returned
- Association timestamp
- Not returned
Same vehicle throughout: 1a7f0fc1-76b9-42be-9177-48ab933dcf03
Request
POST /vehicles{
"brand": "Fictional Motors",
"model": "Demo Compact",
"licence_number": "DEMO-001"
}
Response
HTTP 200application/json
{
"id": "1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"status": "AVAILABLE",
"model": "Demo Compact",
"brand": "Fictional Motors",
"licence_number": "DEMO-001"
}
Saved state
Subsequent GET · HTTP 200Recorded readback
GET /vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03{
"id": "1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"status": "AVAILABLE",
"model": "Demo Compact",
"brand": "Fictional Motors",
"licence_number": "DEMO-001"
}
Bold, marked lines identify state fields. Scroll horizontally, or focus a code block and use Left/Right.
Inspect original recorded payloads
Original record objects retain the exact response body strings and local request URLs.
Action record
{
"index": 3,
"label": "valid-create",
"started_utc": "2026-11-16T04:15:28.096514+00:00",
"finished_utc": "2026-11-16T04:15:28.151007+00:00",
"request": {
"method": "POST",
"url": "http://127.0.0.1:51872/vehicles",
"body": "{\"brand\":\"Fictional Motors\",\"model\":\"Demo Compact\",\"licence_number\":\"DEMO-001\"}"
},
"response": {
"status": 200,
"body": "{\"id\":\"1a7f0fc1-76b9-42be-9177-48ab933dcf03\",\"status\":\"AVAILABLE\",\"model\":\"Demo Compact\",\"brand\":\"Fictional Motors\",\"licence_number\":\"DEMO-001\"}",
"content_type": "application/json"
},
"expected_status": 200
}Subsequent GET record
{
"index": 4,
"label": "created-read",
"started_utc": "2026-11-16T04:15:28.184485+00:00",
"finished_utc": "2026-11-16T04:15:28.197356+00:00",
"request": {
"method": "GET",
"url": "http://127.0.0.1:51872/vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"body": null
},
"response": {
"status": 200,
"body": "{\"id\":\"1a7f0fc1-76b9-42be-9177-48ab933dcf03\",\"status\":\"AVAILABLE\",\"model\":\"Demo Compact\",\"brand\":\"Fictional Motors\",\"licence_number\":\"DEMO-001\"}",
"content_type": "application/json"
},
"expected_status": 200
}Validation and state guards
Inspect the rejected requests and their recorded results. The owner-string comparison is not authenticated authorization.
Blank licenceHTTP 400
Blank licence rejected
A blank licence number is rejected before persistence. The database remained empty after this request.
Request
POST /vehicles{
"brand": "Fictional Motors",
"model": "Demo Compact",
"licence_number": ""
}
Response
HTTP 400application/json
{
"code": 400,
"message": "You must define the licence plate number"
}
Inspect original recorded payloads
Original record objects retain the exact response body strings and local request URLs.
Action record
{
"index": 2,
"label": "blank-licence-create",
"started_utc": "2026-11-16T04:15:27.961153+00:00",
"finished_utc": "2026-11-16T04:15:28.061023+00:00",
"request": {
"method": "POST",
"url": "http://127.0.0.1:51872/vehicles",
"body": "{\"brand\":\"Fictional Motors\",\"model\":\"Demo Compact\",\"licence_number\":\"\"}"
},
"response": {
"status": 400,
"body": "{\"code\":400,\"message\":\"You must define the licence plate number\"}",
"content_type": "application/json"
},
"expected_status": 400
}Repeated associationHTTP 404
Existing association preserved
A second association is rejected. The following GET retains the original owner and timestamp.
Request
POST /vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03/user/demo-user-001No request body
Response
HTTP 404application/json
{
"code": 404,
"message": "Not Found"
}
Saved state
Subsequent GET · HTTP 200Recorded readback
GET /vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03{
"id": "1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"status": "ASSOCIATED",
"owner": "demo-user-001",
"model": "Demo Compact",
"brand": "Fictional Motors",
"licence_number": "DEMO-001",
"association_date": "2026-11-16T04:15:28.211+00:00"
}
Bold, marked lines identify state fields. Scroll horizontally, or focus a code block and use Left/Right.
Inspect original recorded payloads
Original record objects retain the exact response body strings and local request URLs.
Action record
{
"index": 8,
"label": "repeat-associate",
"started_utc": "2026-11-16T04:15:28.278721+00:00",
"finished_utc": "2026-11-16T04:15:28.284121+00:00",
"request": {
"method": "POST",
"url": "http://127.0.0.1:51872/vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03/user/demo-user-001",
"body": null
},
"response": {
"status": 404,
"body": "{\"code\":404,\"message\":\"Not Found\"}",
"content_type": "application/json"
},
"expected_status": 404
}Subsequent GET record
{
"index": 9,
"label": "after-repeat-read",
"started_utc": "2026-11-16T04:15:28.317799+00:00",
"finished_utc": "2026-11-16T04:15:28.324725+00:00",
"request": {
"method": "GET",
"url": "http://127.0.0.1:51872/vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"body": null
},
"response": {
"status": 200,
"body": "{\"id\":\"1a7f0fc1-76b9-42be-9177-48ab933dcf03\",\"status\":\"ASSOCIATED\",\"owner\":\"demo-user-001\",\"model\":\"Demo Compact\",\"brand\":\"Fictional Motors\",\"licence_number\":\"DEMO-001\",\"association_date\":\"2026-11-16T04:15:28.211+00:00\"}",
"content_type": "application/json"
},
"expected_status": 200
}Wrong-owner releaseHTTP 404
Association preserved for a different user identifier
A different user identifier cannot release this association. The following GET shows the unchanged association.
Request
DELETE /vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03/user/demo-user-002No request body
Response
HTTP 404application/json
{
"code": 404,
"message": "Not Found"
}
Saved state
Subsequent GET · HTTP 200Recorded readback
GET /vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03{
"id": "1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"status": "ASSOCIATED",
"owner": "demo-user-001",
"model": "Demo Compact",
"brand": "Fictional Motors",
"licence_number": "DEMO-001",
"association_date": "2026-11-16T04:15:28.211+00:00"
}
Bold, marked lines identify state fields. Scroll horizontally, or focus a code block and use Left/Right.
Inspect original recorded payloads
Original record objects retain the exact response body strings and local request URLs.
Action record
{
"index": 10,
"label": "wrong-owner-release",
"started_utc": "2026-11-16T04:15:28.325993+00:00",
"finished_utc": "2026-11-16T04:15:28.332850+00:00",
"request": {
"method": "DELETE",
"url": "http://127.0.0.1:51872/vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03/user/demo-user-002",
"body": null
},
"response": {
"status": 404,
"body": "{\"code\":404,\"message\":\"Not Found\"}",
"content_type": "application/json"
},
"expected_status": 404
}Subsequent GET record
{
"index": 11,
"label": "after-wrong-owner-read",
"started_utc": "2026-11-16T04:15:28.366379+00:00",
"finished_utc": "2026-11-16T04:15:28.372416+00:00",
"request": {
"method": "GET",
"url": "http://127.0.0.1:51872/vehicles/1a7f0fc1-76b9-42be-9177-48ab933dcf03",
"body": null
},
"response": {
"status": 200,
"body": "{\"id\":\"1a7f0fc1-76b9-42be-9177-48ab933dcf03\",\"status\":\"ASSOCIATED\",\"owner\":\"demo-user-001\",\"model\":\"Demo Compact\",\"brand\":\"Fictional Motors\",\"licence_number\":\"DEMO-001\",\"association_date\":\"2026-11-16T04:15:28.211+00:00\"}",
"content_type": "application/json"
},
"expected_status": 200
}Contribution & scope
- Vehicle creation, retrieval and listing through Spring Boot REST endpoints.
- Nonblank-field validation before persistence, including the recorded blank-licence rejection.
- AVAILABLE and ASSOCIATED lifecycle rules, with user and timestamp persistence and matching-owner release.
- Configured EC2 and VPC infrastructure for the wider backend project, alongside RDS persistence and Cognito user management.
How it fits together
- Spring Boot REST controllers handle requests for vehicle operations.
- Service logic checks lifecycle state and compares the supplied user identifier with the stored owner; this comparison is not authenticated authorization.
- A persistence layer stores vehicle records. Saved GET responses were matched against the isolated database readbacks.
- Association returns HTTP 201 with an empty body; release returns HTTP 200 with an empty body. The separate GETs show the resulting state. Cleared owner/date fields are omitted from JSON and stored as NULL in the database.
What I learned
- Separating request handling from service and persistence logic makes backend responsibilities easier to follow.
- Validation and explicit associations are important when linked records change.