Portrait of Patrice GADEGBEPatrice GADEGBE

Huitivi

Huitivi, presented to the user under the name Miadenou, is a prototype of a property listings application for Togo, which makes it possible to search for a property for sale or for rent by place, type, budget and a few criteria, then to contact the operator.

Role
Sole author of the API and of the application
Period
February and March 2025
Status
Prototype. Prototype, version 0.0.1
Technologies
Django 4.2, Django REST Framework, PostgreSQL 15, Flutter, Google Maps
Repositories
Two
Architecture of HuitiviA Flutter application queries Google Maps for the places and the map, then calls a Django API served by nginx and Daphne, which stores its data in PostgreSQL. The listings are entered in the Django admin.ApplicationFlutter, flutter_bloc14 pagesAPIDjango 4.2, REST Frameworkentry in the adminPostgreSQL 15listings, media, favouritesHTTPS, tokenORMGoogle Mapsplaces and map
Figure 1. Architecture of Huitivi. The places are resolved into coordinates by the application, before the search leaves for the API.

Context

The application is aimed at a person looking for a home, an office, a shop or a plot of land in Togo. They compose their search in a few screens, view the results as a list or on a map, keep favourites, then contact the operator by phone, by SMS or by WhatsApp. The listings are entered by the operator in the Django admin, as the application offers no submission form.

The project represents four weeks of work, in February and March 2025, and it has not been continued since. It is therefore a prototype.

Problem

A property search is first about a place, and the user expects to be offered a property located a few kilometres from the spot they named. A radius search usually requires a spatial database, which the prototype did not justify installing. The model also plans to reserve the virtual tours for those who have bought them, while signalling their existence to everyone.

Answer

A search in a single document

The six search screens, which cover the transaction, the type of property, the places, the surface area, the budget and the criteria, fill one and the same filter document, which the application sends to a single endpoint. Every field in it is optional, and the server applies in turn those it receives. The last search and its results are kept on the phone, so that they are found again when the application is reopened.

A radius without a spatial database

The application resolves each chosen place into coordinates and attaches them to the search. The server first filters in SQL on the other criteria, then keeps only the listings located less than ten kilometres from one of the places, computing the geodesic distance in Python and moving on to the next listing as soon as one place fits.

for listing in listings:
    geolocation = listing.geolocation
    latitude = geolocation.lat
    longitude = geolocation.lon
    for location in locations:
        location_latitude = location['latitude']
        location_longitude = location['longitude']
        distance = geodesic((latitude, longitude),
                            (location_latitude, location_longitude)).kilometers
        if distance <= 10:
            result.append(listing)
            break
listings = result
Listing 1. Filtering by distance, applied in Python after the SQL filters.

Media at three levels

The photographs, the 360-degree panoramic views and the videos are three separate tables. The API always indicates whether a listing has a panoramic view or a video, but passes their addresses only to the user who holds the corresponding subscription. The application can thus display a locked thumbnail without ever receiving what it protects.

Limits and outlook

Computing the distances in Python, like sorting by price per square metre, suits a few dozen listings and not a few thousand; a spatial database would become necessary well before that threshold. The ten-kilometre radius is fixed in the code and the search is not paginated.

The purchase of a virtual tour is moreover only a mock-up: the payment sheet is not linked to any provider, and a subscription can be created only in the admin. The video does not yet have a player. Lastly, the prototype contains no tests, and it has not been published on the app stores.

Back to the other projects