DEV Community

Cover image for “REMI-IA Challenge: Production-Ready Event Log API with Xano”
Jramone3
Jramone3

Posted on

“REMI-IA Challenge: Production-Ready Event Log API with Xano”

Xano AI-Powered Backend Challenge: Public API Submission

This is a submission for the Xano AI-Powered Backend Challenge: Production-Ready Public API

What I Built

I built a public API called REMI-IA Challenge, designed to register and track user actions in an event_log table.

The API provides a structured way to log events with metadata, making it useful for auditing, monitoring, and collaborative workflows.

API Documentation

Main Endpoint: create_event_log (POST)

Authentication: Bearer token required.

Rate Limits: Standard Xano workspace limits apply.

Parameters:

  • user_id (int)
  • account_id (int)
  • action (text)
  • metadata (json)

Example Endpoint Definition:

xano
query create_event_log verb=POST {

auth = "user"

  input {
    int user_id
    int account_id
    text action filters=trim
    json metadata
  }

  stack {
    db.add event_log {
      data = {
        created_at: "now"
        user_id   : $input.user_id
        account_id: $input.account_id
        action    : $input.action
        metadata  : $input.metadata
      }
    } as $eventlogentry
  }
Enter fullscreen mode Exit fullscreen mode

response = {event_log_entry: $eventlogentry}
}

Demo
Example Response:
{

"event_log_entry": {
    "id": 18,
    "user_id": 1,
    "account_id": 10,
    "action": "readme_create",
    "metadata": {
      "section": "Introduction",
      "description": "Sample text",
      "detail": "Additional detail"
    },
    "created_at": 1764954080301
  }
}
Testing with curl (placeholders):

curl -X POST "https://<your-workspace-id>.xano.io/api:<api-group>/create_event_log" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
  -d '{
    "user_id": 1,
    "account_id": 10,
    "action": "readme_create",
    "metadata": {
      "section": "Introduction",
      "description": "Sample text",
      "detail": "Additional detail"
    }
  }'
Enter fullscreen mode Exit fullscreen mode

The AI Prompt I Used
"Generate a backend endpoint in Xano to log user actions into an event_log table with metadata support."

How I Refined the AI-Generated Code
The AI-generated code provided a basic structure. I refined it by:

Adding authentication (auth = "user") to secure the endpoint.

Structuring metadata as JSON for flexibility.

Ensuring timestamps (created_at: "now") are automatically recorded.

Validating input fields with filters (e.g., trim for text).

My Experience with Xano
Working with Xano allowed me to quickly transform AI-generated backend code into a production-ready API. The Debug tool was the most helpful feature, enabling me to validate endpoints in real time. One challenge was ensuring authentication worked correctly with curl, which I solved by configuring the Bearer token properly.

The AI Prompt I Used

"Generate a backend endpoint in Xano to log user actions into an event_log table with metadata support."

Sección “Refinements in Xano”

How I Refined the AI-Generated Code

The AI-generated code provided a basic structure.

I refined it by:

  • Adding authentication (auth = "user") to secure the endpoint.
  • Structuring metadata as JSON for flexibility.
  • Ensuring timestamps (created_at: "now") are automatically recorded.
  • Validating input fields with filters (e.g., trim for text).

📌 Example curl with placeholders

curl -X POST "https://<your-workspace-id>.xano.io/api:<api-group>/create_event_log" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
  -d '{
    "user_id": 1,
    "account_id": 10,
    "action": "readme_create",
    "metadata": {
      "section": "Introduction",
      "description": "Sample text",
      "detail": "Additional detail"
    }
  }'
Enter fullscreen mode Exit fullscreen mode

📌 Example JSON output in terminal

{
  "event_log_entry": {
    "id": 18,
    "user_id": 1,
    "account_id": 10,
    "action": "readme_create",
    "metadata": {
      "section": "Introduction",
      "description": "Sample text",
      "detail": "Additional detail"
    },
    "created_at": 1764954080301
  }
}
Enter fullscreen mode Exit fullscreen mode

📌 ASCII Diagram of Your API Flow

 +--------+        +-------+        +----------------+        +-------------------+
   |  User  | -----> |  curl | -----> |   Xano Backend | -----> |  Event Log (DB)   |
   +--------+        +-------+        +----------------+        +-------------------+
        |                                                           |
        |                                                           v
        |                                                   +-------------------+
        |                                                   | JSON Response     |
        |<--------------------------------------------------| {event_log_entry} |
                                                            +-------------------+
Enter fullscreen mode Exit fullscreen mode

Conclusion
The REMI-IA Challenge API demonstrates how AI-assisted backend generation can be refined into a secure, production-ready public API using Xano. By combining automated code generation with manual improvements—such as authentication, structured metadata, and timestamp management—we achieved a reliable event logging service that can be easily integrated into collaborative and auditing workflows.

This project highlights the value of Xano’s debugging and endpoint management tools, which made the refinement process straightforward and efficient. We look forward to sharing this work with the community and receiving feedback from the judges.

Top comments (0)