Skip to content
/ wafer Public

Project showcasing how to use WhatsApp as a frontend for your Elixir Phoenix backend.

Notifications You must be signed in to change notification settings

fedme/wafer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wafer

An example Phoenix project showcasing how to use WhatsApp as a frontend for your Phoenix backend using the WhatsApp Business Platform.

What we are building

Let's create a WhatsApp app for a co-working space that allows users to:

  • Book a desk
  • Book a meeting room
  • View their bookings
  • Cancel a booking

Screenshot of the WhatsApp service

Implementation details

  • There's a controller that receives WhatsApp messages from Meta's webhook.
  • We start a GenServer for each WhatsApp contact who is messaging us, storing chat messages in the state.
  • We are not interested in storing messages, as chat sessions are short-lived and ephemeral (e.g., booking a desk).
  • We have a GPT-based AI agent that answers users' basic questions.
  • We also have a list of predefined flows (e.g., a flow for booking a desk).
  • When the AI agent recognizes predefined intents (e.g., “book a desk”), it triggers the corresponding flow.

Architecture

Screenshot of the WhatsApp service

Contact Process

Screenshot of the WhatsApp service

Phoenix instructions

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

To start Observer you can run:

iex -S mix phx.server
Mix.ensure_application!(:observer)
:observer.start()

About

Project showcasing how to use WhatsApp as a frontend for your Elixir Phoenix backend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published