Skip to main content

Quick Start Guide

Prerequisites

  • Python 3.8+
  • MongoDB instance
  • Environment variables configured
  • JWT authentication service

Setup

  1. Install dependencies:

    pip install -r requirements.txt
    # or using uv
    uv sync
  2. Configure environment variables:

  3. Configure environment variables:

    cp .env.example .env
    # Edit .env with your configuration

Service Access

The Recommend service is deployed and accessible at: https://recommend.trydodo.xyz

Authentication

Get JWT token from the Admin service authentication endpoints:

# Sign up
curl -X POST "https://admin.trydodo.xyz/api/users/signup" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'

# Login
curl -X POST "https://admin.trydodo.xyz/api/users/login" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'

First API Call

  1. Test the health endpoint:

    curl https://recommend.trydodo.xyz/health
  2. Create a product:

  3. Create a product:

    curl -X POST "https://recommend.trydodo.xyz/api/products/upload" \
    -H "Authorization: Bearer <your-jwt-token>" \
    -H "Content-Type: application/json" \
    -d '[{
    "customer_id": "test_user",
    "name": "Test Product",
    "price": 99.99
    }]'
  4. Get recommendations:

    curl -X POST "http://localhost:5051/api/recommend" \
    -H "Authorization: Bearer <your-jwt-token>" \
    -H "Content-Type: application/json" \
    -d '{
    "sequence_data": {"preferences": ["electronics"]},
    "task": "product_recommendation",
    "template": "personalized"
    }'

    Note: The model_key parameter is optional.

Next Steps