Skip to main content
Inmobiliaria API Hero Light

Welcome to Inmobiliaria API

The Inmobiliaria API is a modern, production-ready REST API designed for real estate property management. Built with Express.js, PostgreSQL, and Better Auth, it provides a complete solution for managing property listings, user authentication, image uploads, and advanced search capabilities.

Quick navigation

Quickstart

Get up and running with your first API call in minutes

Installation

Set up the development environment locally

Authentication

Learn about authentication and authorization

API Reference

Explore all available endpoints and operations

Core features

The Inmobiliaria API provides a comprehensive set of features for building modern real estate applications:

Property management

  • CRUD operations: Create, read, update, and delete property listings
  • Rich metadata: Property types, subtypes, operation types (sale/rent), conditions, and statuses
  • Location data: Full address support with coordinates for mapping integration
  • Image handling: Multi-image uploads with automatic optimization and WebP conversion
  • Advanced search: Filter by price range, property type, location, bedrooms, bathrooms, and more
  • SEO-friendly URLs: Automatic slug generation for property listings

Authentication & authorization

  • Better Auth integration: Email/password authentication with email verification
  • Social login: Google OAuth support
  • Session management: Secure session handling with cookies
  • Role-based access: Admin and user roles with different permissions
  • Password reset: Email-based password recovery flow

File storage

  • Flexible storage: Local filesystem or AWS S3-compatible storage (S3, R2, B2)
  • Image optimization: Automatic generation of thumbnail and large variants
  • WebP conversion: Modern image format for optimal performance
  • Image rotation: Support for rotating images before storage

Data management

  • PostgreSQL database: Robust relational database with Drizzle ORM
  • Type-safe queries: Full TypeScript support throughout the stack
  • Database migrations: Version-controlled schema changes with Drizzle Kit
  • Seed data: Sample data for development and testing

Architecture overview

The API is built with a modern Node.js stack:
┌─────────────────────────────────────────────┐
│           Client Applications               │
│   (Web, Mobile, Third-party integrations)   │
└─────────────────┬───────────────────────────┘

                  │ HTTPS/REST

┌─────────────────▼───────────────────────────┐
│          Express.js API Server              │
│  ┌──────────────────────────────────────┐   │
│  │  Authentication (Better Auth)        │   │
│  ├──────────────────────────────────────┤   │
│  │  Routes & Controllers                │   │
│  ├──────────────────────────────────────┤   │
│  │  Middleware (Auth, Uploads, Errors)  │   │
│  ├──────────────────────────────────────┤   │
│  │  Business Logic & Services           │   │
│  └──────────────────────────────────────┘   │
└─────────┬───────────────────────┬───────────┘
          │                       │
          │                       │
┌─────────▼──────────┐   ┌────────▼──────────┐
│  PostgreSQL DB     │   │  File Storage     │
│  (Drizzle ORM)     │   │  (Local or S3)    │
└────────────────────┘   └───────────────────┘

Technology stack

  • Runtime: Node.js v24.13.1
  • Framework: Express.js v4.21.2
  • Database: PostgreSQL with Drizzle ORM v0.36.4
  • Authentication: Better Auth v1.3.4
  • Image processing: Sharp v0.33.4
  • File uploads: Multer v1.4.5
  • Validation: Zod v3.25.1
  • Email: Resend v6.0.1 with React Email
  • Storage: AWS SDK v3 for S3-compatible storage

API design principles

The API follows REST conventions and modern best practices:
  • RESTful endpoints: Resources are accessed via standard HTTP methods (GET, POST, PUT, DELETE)
  • JSON responses: All responses use JSON format with consistent structure
  • Error handling: Comprehensive error messages with appropriate HTTP status codes
  • Pagination: List endpoints support page-based pagination
  • Filtering: Advanced query parameters for searching and filtering
  • Type safety: Full TypeScript implementation for type safety
  • Security: CORS protection, secure cookies, SQL injection prevention
The API uses a standardized response format: all successful responses include a success: true field and a data field containing the result. Error responses include success: false and a descriptive message field.

Response format

All API responses follow a consistent structure: Successful response:
{
  "success": true,
  "data": {
    // Response data here
  }
}
Error response:
{
  "success": false,
  "message": "Error description"
}
Paginated response:
{
  "success": true,
  "data": [
    // Array of items
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 5,
    "totalItems": 47,
    "limit": 10
  }
}

Getting help

If you need assistance:

Next steps

Start building

Follow the quickstart guide to make your first API call

Set up locally

Install and run the API server on your local machine

Build docs developers (and LLMs) love