---
# System prepended metadata

title: Travel GPT

---

# Travel GPT

## User Session

```
1
user {
    user_id
    name
    email
    uniq(name, email)
}

N
user_session {
    session_id
    user_id
    mood_message_id
    mood_pic_id
    s3_pic_id
}
```


## Random Mood Generation
```json
GET /v1/mood/:mood_message_id

response
{
    "message": "str",
    "mood_message_id": "<uuid>"
}
```

```json 
// randomly generate mood string
POST /v1/mood/generate

response
{
    "message": "str",
    "mood_message_id": "<uuid>"  // mood id (for cached) | null (for not cached)
}
```

```json 
// create new message
POST /v1/mood
{
    "mood_message_id": "<uuid>",
    "message": "str"
}

response
{
    "mood_message_id": "<uuid>"  // mood id
}
```


## Mood to Picture
```json 
// generate image with message
POST /v1/mood/<mood_message_id>/picture
{
    "used_mood_pic_ids": ["123", "234"]
}

response
{
    "mood_pic_id": "",
    "mood_pic_url": "<url>",
    "mood_pic_size": "<string>"  // > 320 * 320
}
```

## Save Pictures
```json 
// save openai image to s3
POST /v1/pictures
{
    "type": "mood_pic",
    "id":   "<uuid>"  // mood pic id
}

response
{    
    "s3_pic_id":   "<uuid>", // s3 pic id
    "s3_pic_url":  "<url>",
    "s3_pic_size": "<string>"
}
```

## Get Pictures
```json 
GET /v1/pictures/:s3_pic_id

response
{    
    "s3_pic_id":   "<uuid>", // s3 pic id
    "s3_pic_url":  "<url>",
    "s3_pic_size": "<string>"
}
```


## Picture to Spots
```json 
// serpapi * 1 -> google map * m -> (google image * n) -> (suggest)
GET /v1/spots/search?s3_pic_id=<id>  // pic id
 
{
    "spot_id": "<uuid>"
    "address": "2CC7+7R, Kitulgala, Sri Lanka",
    "name":"Gallena nature resort and water park kitulgala",
    "image":{
        "id":"<uuid>",
        "url":"<url>"
    },
    "rating":4.5,
    "rating_n":35,
    "place_id":"ChIJgZEjNxkL4zoRFmD1mzlniTA",
    "reference":"ChIJgZEjNxkL4zoRFmD1mzlniTA",
    "types":[
        "lodging",
        "point_of_interest",
        "establishment"
    ],
    "geometry":{
        "location":{
            "lat":7.020993799999999,
            "lng":80.4134291
        },
        "viewport":{
            "northeast":{
                "lat":7.02211347989272,
                "lng":80.41481907989272
            },
            "southwest":{
                "lat":7.019413820107276,
                "lng":80.41211942010727
            }
        }
    }
}
```

## Nearby Spots

```json
GET /v1/spots/:spot_id/nearby
{
    spots: [
        {
            "spot_id": "<uuid>",
            "address": "2CC7+7R, Kitulgala, Sri Lanka",
            "name":"Gallena nature resort and water park kitulgala",
            "rating":4.5,
            "rating_n":35,
            "place_id":"ChIJgZEjNxkL4zoRFmD1mzlniTA",
            "reference":"ChIJgZEjNxkL4zoRFmD1mzlniTA",
            "types":[
                "lodging",
                "point_of_interest",
                "establishment"
            ],
            "geometry":{
                "location":{
                    "lat":7.020993799999999,
                    "lng":80.4134291
                },
                "viewport":{
                    "northeast":{
                        "lat":7.02211347989272,
                        "lng":80.41481907989272
                    },
                    "southwest":{
                        "lat":7.019413820107276,
                        "lng":80.41211942010727
                    }
                }
            }
        },
        ...etc
    ]
}
```

