# What2Eat

A small answer to “what should I eat?”, rebuilt from Vue 2 to Vue 3

Source: https://works.im0o.top/en/projects/309cbe5c/
Date: 2021-12-12
End date: 2025-05-18
Tags: Web Development, Vue, TypeScript

## Project links

- [Source](https://github.com/akinodev/whattoeat)


What2Eat is a small page for deciding what to eat next. Press the button, watch a few options pass by, and keep the final result or try again.

![The What2Eat page](https://image.im0o.top/2026/20261117104652646.webp)

## The 2021 version

I built the original with Vue 2 and Element UI loaded from CDNs, using Axios to fetch the food list from JSON. The main elements were a button, food pictures, and the selection animation. It was deployed on Vercel.

The project also accepted image pull requests. GitHub Actions ran a Python script to add contributed images to the site configuration. The early blog post retains the interface screenshot and usage link.

## The 2025 rewrite

I rebuilt it with Vue 3, TypeScript, Vite, and Naive UI. Each food record contains a name, picture, emoji, background color, and tags. Image imports are handled by the build.

Multiple tags can narrow the choices before a draw. A food must match all selected tags; if none do, the page asks for different tags. Clicking a tag on the current result adds it to the filter.

The display switches between pictures and emoji. Animation is optional: enabled, it cycles through several candidates before settling; disabled, it returns one choice immediately. During the animation, food tags are hidden and filters disabled, then the complete result appears.

![A result and tag filters in the Vue 3 version](https://image.im0o.top/2026/20261117104649821.webp "A result and tag filters in the Vue 3 version")

## Image credits

Some food images come from pcrbot/whattoeat, and the early version also included shop avatars. The README credits the logo to John Frank Wayre / Helen Rae Cooper. I kept the image and logo credits with the project.

[Open What2Eat](https://what2eat.im0o.top) · [Source code](https://github.com/akinodev/whattoeat) · [Early development notes](https://blog.im0o.top/posts/76c8cbd5.html)

