Skip to content

This project is built to facilitate diet tracking without the need to open a separate app. Simply chat "Ate fried rice", and the AI will estimate the calories for you.

Notifications You must be signed in to change notification settings

eeryyy282/double-a-calorie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A2Bot Logo

🥑 Double A Calorie (A2Bot)

A2Bot is an AI-powered WhatsApp assistant that helps track daily calories automatically through natural conversation in group chats.

This project is built to facilitate diet tracking without the need to open a separate app. Simply chat "Ate fried rice", and the AI will estimate the calories for you.


✨ Key Features

  • 🧠 AI-Powered Tracking: Uses Google Gemini 2.5 Flash to recognize food types and estimate calories from everyday language.
  • 💬 WhatsApp Integration: Runs directly in WhatsApp Groups or Personal Chats.
  • 👥 Multi-User Support: Distinguishes tracking for each group member (e.g., You and your Partner).
  • 📊 Real-time Database: Stores daily progress using a simple local JSON database.
  • 🔒 Secure Configuration: Uses .env to protect your API keys (Security Best Practice).
  • ⚡ Fast Response: Lightweight and fast using the @whiskeysockets/baileys library.

🛠️ Technology Used

🚀 Installation & Running

Follow these steps to run the bot on your local computer or server.

Prerequisites

  1. Node.js installed on your computer.
  2. API Key from Google AI Studio.

Steps

1. Clone Repository

git clone https://github.com/eeryyy282/double-a-calorie.git
cd double-a-calorie

2. Install Dependencies

npm install

3. Configure Environment Variables

Create a new file named .env in the root directory and add your API Key inside it. This keeps your key safe and out of the code.

API_KEY=your_actual_gemini_api_key_here

Note: The .env file is ignored by Git to prevent accidental leakage of your secrets.

4. Run Bot

node index.js

5. Scan QR Code

The terminal will display a QR Code. Open WhatsApp on your phone (a dedicated bot number is recommended), go to Linked Devices, and scan the QR code.

📱 Usage

Once the bot is connected (✅ A2Bot successfully connected!), you can start using it immediately.

  1. Start: Send any message (e.g., "Hello") to the bot number. The bot will automatically create your profile with a default target.
  2. Input Food:
    • "Lunch with chicken soup and half a portion of rice"
    • "Just drank iced coffee with brown sugar"
    • "Snacking on one fried banana"
  3. Response: A2Bot will reply with the calorie estimation and your remaining calorie allowance for the day.

⚠️ Disclaimer

This project uses an Unofficial WhatsApp library (Baileys). Use wisely. There is a risk of the WhatsApp number being banned if used for spamming. Using a secondary number is recommended. Communication and UI messages use Bahasa Indonesia.

About

This project is built to facilitate diet tracking without the need to open a separate app. Simply chat "Ate fried rice", and the AI will estimate the calories for you.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published