Inspiration

In France, nearly 8 million people rent their homes, and every year hundreds of thousands receive a payment order, eviction notice, or court summons—often without fully understanding what it means or what rights they have. Resources to understand these situations do exist: legal deadlines and protections safeguard tenants, but this information is buried within complex legal texts that are difficult to access.

EasyLoc was born from a simple observation: the gap between what the law guarantees and what people know they can demand is enormous. A tenant who receives a payment order has two months to respond before eviction proceedings can begin. Two months is both a short and sufficient amount of time—provided you know that deadline exists.

What it does

EasyLoc is an AI assistant specialized in French tenants' rights. Users can upload any housing-related document—lease agreements, payment orders, eviction notices, rent receipts, or other documents—and the application performs three key functions:

Analyze

The AI identifies the document type, evaluates its urgency on a scale from 1 to 5, extracts critical deadlines, lists applicable rights, and generates a step-by-step action plan in the form of an interactive checklist. Legal deadlines are automatically calculated based on the document type and the corresponding legal requirements.

For example, for a payment order, the legal deadline $D$ is:

$$ D = D_{\text{received}} + 2 \text{ months} $$

Annual rent increases are also regulated through the French Rent Reference Index (IRL):

$$ \text{Revised Rent} = \text{Current Rent} \times \frac{\text{Current Quarter IRL}}{\text{Reference Quarter IRL}} $$

Advise

An AI chat assistant answers questions specific to the tenant's situation, generates personalized legal letters (formal notices, DALO housing appeals, requests for additional time before a judge), and retrieves official legal texts in real time through the Légifrance API.

Guide

An interactive map helps users locate nearby organizations such as ADIL offices, social service centers (CCAS), emergency assistance services, and tenant support organizations.

How we built it

The frontend is built entirely with HTML, CSS, and JavaScript—without any framework—to maximize performance on limited mobile connections.

The backend consists of a single PHP proxy that handles all operations: Mistral AI requests, OAuth2 authentication with the PISTE/Légifrance API including token caching, and document storage within user sessions.

The Mistral integration relies on function calling. The AI has access to five tools that it can invoke autonomously depending on context:

  • search_organizations
  • calculate_deadline
  • show_letter_template
  • ask_user_questions
  • search_french_law

Responses are delivered through Server-Sent Events (SSE) streaming for a smooth conversational experience.

The multilingual system (French/English) is managed through an i18n.js module using data-i18n attributes in HTML and translation keys for all interface text.

The application is deployed on Hostinger with LiteSpeed under the /EasyLoc/ subdirectory of the domain https://jul-ia.fr.

Challenges we ran into

Subdirectory routing

Hostinger silently strips query strings in certain LiteSpeed configurations. Requests such as ?action=mistral were reaching PHP with an empty $_GET array.

The solution required a three-layer parsing strategy:

  1. $_GET
  2. parse_str(parse_url(..., PHP_URL_QUERY)) applied to QUERY_STRING
  3. Manual extraction from REQUEST_URI

File transfer between pages

Files are uploaded on index.html, while document analysis occurs on dashboard.html.

localStorage is limited to approximately 5 MB, which is insufficient for storing PDF files in Base64 format. The solution was IndexedDB, which supports arbitrarily large files. On the dashboard side, the original File object is reconstructed using dataURLtoFile().

AI language consistency

Three different entry points interact with Mistral (initial analysis, chat assistant, and letter generation), each with its own prompt.

We had to inject language detection through getLang() into each workflow independently to ensure that the entire experience remains in English whenever the user selects English.

Streaming and Mistral tools

Mistral's function calling is not compatible with streaming mode.

Our final architecture performs two sequential API calls:

  1. A non-streaming request to detect tool calls.
  2. A second streaming request to generate the final response.

Both share the same AbortController, allowing users to interrupt generation at any time.

Accomplishments that we're proud of

We are proud to have built an application that is genuinely usable by people with no legal background.

The analysis produces structured, actionable, and prioritized guidance rather than a wall of legal text. The interactive checklist is designed to be followed concretely, step by step.

Most importantly, the application responds in real time. Streaming creates the feeling of talking to someone rather than waiting for a form to process.

What we learned

We learned that a prompt is an interface.

The quality of the output depends as much on how the AI is instructed as on the model itself. Designing prompts capable of producing strict bilingual JSON with clearly defined optional fields required as much effort as writing the code that consumes that JSON.

We also learned that PHP remains remarkably effective for lightweight backends deployed on shared hosting, provided sessions and CORS headers are handled properly.

Finally, we learned that the real challenge of a legal assistance tool is not technical—it is avoiding oversimplification. The AI must explain without distorting, reassure without minimizing, and guide without replacing professional legal advice.

What's next for EasyLoc

Deadline reminders

Send email or push notifications when important legal deadlines are approaching. No tenant should miss a deadline simply because time passed unnoticed.

Server-side history across devices

Today, chat history is stored locally in localStorage. User accounts would allow tenants to access their case files from any device.

Support for other vulnerable housing situations

The same architecture can be adapted for struggling homeowners, residents of shelters, and people in emergency housing—situations where access to legal information is often even more fragmented.

Partnerships with nonprofit organizations

EasyLoc was designed to integrate into the workflows of ADIL offices, CCAS centers, and tenant advocacy organizations—not to replace them, but to expand their capacity to support vulnerable individuals.

Full internationalization

Today, EasyLoc focuses on French housing law.

The next step is transforming it into a universal platform for tenants worldwide:

  • Country-specific legal knowledge bases
  • Local legal deadlines and protections
  • Connections to official government legal sources (equivalents of Légifrance in Germany, the United Kingdom, Spain, the United States, and beyond)

Our goal is simple: a tenant in Berlin, London, Montreal, or New York should be able to upload a lease agreement and understand their rights within seconds, in their own language.

Built With

  • css3
  • etablissements-publics.api.gouv.fr
  • font-awesome-6.4
  • geo.api.gouv.fr
  • html5
  • inter
  • javascript
  • json
  • leaflet.js
  • localstorage
  • mammoth.js
  • mistral
  • nominatim
  • overpass-api
  • pdf.js
  • php
  • piste-api
  • pixtral
  • sessionstorage
Share this project:

Updates