Soare-Robert-Daniel / image-search-with-ai-description

A small project for a Hackathon. Use AI to generate image description which can be used by a search engine.
https://image-search-with-ai-description.vercel.app
MIT License
2 stars 0 forks source link

Connect to database #2

Open Soare-Robert-Daniel opened 1 year ago

Soare-Robert-Daniel commented 1 year ago

Connect to the database and make an API endpoint to save the image on the disk and register it to the database. The data should be stored like this:

When adding a new entry:

{
  "id": 123,
  "image_src": "localhost://app.demo/assets/img.jpg'",
  "prompt": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
  "status": "new"
}

After making and API request to processing:

{
  "id": 123,
  "image_src": "localhost://app.demo/assets/img.jpg'",
  "prompt": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
  "status": "processing"
}

After finishing:

{
  "id": 123,
  "image_src": "localhost://app.demo/assets/img.jpg'",
  "prompt": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
  "status": "done"
}