Two Backends
Primary Backend (Port 3001)- Admin operations
- Cookie-based JWT auth
- Full CRUD for users, buildings, sectors
- Mobile operations
- Phone + OTP auth
- User profiles, simple queries
✨ The Urban Management docs now have a brand-new home! Explore the improved documentation experience
Quick guide to integrating with Urban Management APIs
const response = await fetch('http://localhost:3001/api/v1/auth/signin', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ email, password })
});
// Step 1: Sign in
const authResponse = await fetch('http://localhost:3002/api/v1/auth/signin', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ phoneNumber })
});
const { accessToken } = await authResponse.json();
// Step 2: Request OTP
await fetch('http://localhost:3002/api/v1/auth/otp/create', {
method: 'POST',
headers: { 'Authorization': `Bearer ${accessToken}` }
});
// Step 3: Validate OTP
const sessionResponse = await fetch('http://localhost:3002/api/v1/auth/otp/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({ otp })
});
const { sessionToken } = await sessionResponse.json();
{
"success": true,
"data": { ... }
}
{
"success": false,
"error": {
"message": "Error description",
"code": "ERROR_CODE"
}
}
Was this page helpful?