This document walks through every available HTTP endpoint so the Flutter / Web front-end can integrate confidently.
Architecture follows ASP.NET Core Clean Architecture — API layer hosts the controllers, Application layer handles business rules and DTOs.
Headers
Content-Type: application/jsonfor all requests with bodies.- Endpoints marked (Auth Required) expect
Authorization: Bearer <JWT_TOKEN>returned byPOST /api/auth/login.
POST /api/auth/signup
Request:
{
"username": "mostafa123",
"name": "Mostafa Medhat",
"phoneNumber": "+201234567890",
"email": "mostafamedhat@gmail.com",
"password": "12345678",
"confirmPassword": "12345678"
}Response:
{
"success": true,
"message": "User created successfully",
"userId": "USR-551201",
"identecation": "84219932"
}Notes:
- Backend stores the user, generates
userId+identecation, and emails a 6-digit HTML verification code toemail.
POST /api/auth/verify-signup
Request:
{
"userId": "USR-551201",
"verificationCode": "654321"
}Response:
{
"success": true,
"message": "Account verified"
}Use this after the user enters the code they received via email.
POST /api/auth/login
Request:
{
"username": "mostafa123",
"password": "12345678"
}Response:
{
"success": true,
"token": "JWT_TOKEN",
"user": {
"userId": "USR-551201",
"identecation": "84219932",
"username": "mostafa123",
"name": "Mostafa Medhat",
"phoneNumber": "+201234567890",
"email": "mostafamedhat@gmail.com",
"car_charge": 87,
"esp32": {
"btName": "ESP32-Charger",
"btAddress": "AA:BB:CC:DD:EE:FF"
},
"status_position": {
"north": 30,
"east": 30,
"south": 30,
"west": 30
}
}
}Save token for future authenticated calls.
POST /api/auth/forgot-password
Request:
{
"phoneNumber": "+201234567890",
"email": "mostafamedhat@gmail.com"
}Response:
{
"success": true,
"message": "Reset code generated and sent"
}POST /api/auth/reset-password
Request:
{
"phoneNumber": "+201234567890",
"email": "mostafamedhat@gmail.com",
"resetCode": "123456",
"newPassword": "12345678",
"confirmPassword": "12345678"
}Response:
{
"success": true,
"message": "Password reset successfully"
}POST /api/user/register-esp32
Request:
{
"identecation": "84219932",
"btName": "ESP32-Charger",
"btAddress": "AA:BB:CC:DD:EE:FF"
}Backend finds the user by
identecation(scanned via Flutter) and stores Bluetooth info.
Response:
{
"success": true,
"message": "ESP32 registered successfully"
}GET /api/user/{userId}
Response:
{
"userId": "USR-551201",
"identecation": "84219932",
"username": "mostafa123",
"name": "Mostafa Medhat",
"phoneNumber": "+201234567890",
"email": "mostafamedhat@gmail.com",
"car_charge": 87,
"esp32": {
"btName": "ESP32-Charger",
"btAddress": "AA:BB:CC:DD:EE:FF"
},
"status_position": {
"north": 30,
"east": 30,
"south": 30,
"west": 30
}
}GET /api/user/{userId}/identecation
Response:
{
"success": true,
"message": "Identecation retrieved",
"userId": "USR-551201",
"identecation": "84219932"
}DELETE /api/user/{userId}
Response:
{
"success": true,
"message": "Account deleted"
}POST /api/esp32/update-charge
Request:
{
"identecation": "84219932",
"car_charge": 87
}Response:
{
"success": true,
"message": "Car charge updated"
}POST /api/hub/update-position
Request:
{
"identecation": "84219932",
"status_position": {
"north": 30,
"east": 30,
"south": 30,
"west": 30
}
}Response:
{
"success": true,
"message": "Position updated"
}- Sign Up → backend emails code.
- Verify Signup with code.
- Login → receive JWT.
- Register ESP32 via identecation code when scanned.
- ESP32 pushes car charge every minute; hub pushes
status_position. - User info / identecation / delete available via authenticated endpoints.
If you need additional payload fields, sync with backend before rollout so DTOs stay aligned.