gitwtfhub

wtf is cocktails-demo?

hadley/cocktails-demo — explained in plain English

Analysis updated 2026-08-14 · repo last pushed 2024-09-02

8RAudience · generalComplexity · 2/5StaleSetup · easy

TL;DR

A small R Shiny web app that shows you three random cocktails and lets you filter by spirit and flavor. Built as a demo of AI-assisted app generation, with prompts included.

Mindmap

mindmap
  root((repo))
    What it does
      Shows random cocktails
      Filter by spirit
      Filter by flavor
      Lists ingredients
    Tech stack
      R
      Shiny framework
      YAML data
    Use cases
      Pick a drink
      Teach Shiny basics
      Learn AI prompting
    Audience
      Home mixologists
      Data science instructors
      Curious beginners
    Notable details
      Generated by ChatGPT
      Includes original prompts
      Single self-contained file

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Get cocktail inspiration by browsing three random drinks filtered by spirit and flavor.

REASON 2

Learn how Shiny turns R code into an interactive web page without separate frontend code.

REASON 3

Study the included prompts to see how to describe an app idea clearly enough for an AI to build it.

REASON 4

Demo AI-assisted app generation in a data science or coding class.

What's in the stack?

RShinyYAML

How it stacks up

hadley/cocktails-demoyulab-smu/cast3dhadley/logger
Stars821
LanguageRRR
Last pushed2024-09-022024-10-16
MaintenanceStaleStale
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencegeneralresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires R and the Shiny package installed, but no external services or API keys are needed.

No license information is provided in the repository, so usage rights are unclear.

Wtf does this do

The cocktails-demo project is a small web app that helps you pick a cocktail to make. You open it in your browser, see three random drink ideas, and can narrow things down by choosing a base spirit (like gin, vodka, or rum) and the kind of flavors you're in the mood for (bitter, fruity, refreshing, smoky, and so on). Each cocktail comes with a short description and the ingredients you'd need. Under the hood, the app is built with R using a framework called Shiny, which lets you turn R code into an interactive web page without writing separate frontend code. The cocktail data lives in a structured text file format called YAML, where each drink has fields for its name, description, primary spirit, ingredient list, and flavor tags. The app reads that file, displays three cocktails at random, and re-filters the list whenever you pick a spirit or flavor. It's all one self-contained file, which keeps things simple. The audience here is really anyone who wants cocktail inspiration and happens to have R installed, a home mixologist, a data science instructor demoing Shiny, or someone curious about how AI tools can build small apps. It's less a production product and more a teaching example or personal utility. What's notable is that the app was largely generated by ChatGPT, with light manual edits for correctness and appearance. The README includes the actual prompts used to generate both the cocktail data and the app itself, making it a useful reference if you want to see how to describe an app idea clearly enough for an AI to build it. The project trades polish and scale for simplicity and transparency about its origin.

Yoink these prompts

Prompt 1
Help me run the cocktails-demo Shiny app from hadley/cocktails-demo, I have R installed but have never used Shiny. What packages do I need and how do I launch it?
Prompt 2
I want to create a Shiny app similar to the cocktails-demo that suggests random recipes filtered by two criteria. Write the R code for a minimal version using a small YAML data file with five items.
Prompt 3
Use the prompting style from the cocktails-demo README to generate a YAML dataset of five coffee drinks with fields for name, description, primary ingredient, ingredient list, and flavor tags.
Prompt 4
I want to extend the cocktails-demo app to let users select a second flavor filter. Show me how to modify the Shiny UI and server logic to add a second dropdown.
Prompt 5
Turn the cocktail YAML data from cocktails-demo into a plain R data frame and write a short script that picks three random drinks matching a given spirit and flavor.

Frequently asked questions

wtf is cocktails-demo?

A small R Shiny web app that shows you three random cocktails and lets you filter by spirit and flavor. Built as a demo of AI-assisted app generation, with prompts included.

What language is cocktails-demo written in?

Mainly R. The stack also includes R, Shiny, YAML.

Is cocktails-demo actively maintained?

Stale — no commits in 1-2 years (last push 2024-09-02).

What license does cocktails-demo use?

No license information is provided in the repository, so usage rights are unclear.

How hard is cocktails-demo to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is cocktails-demo for?

Mainly general.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.