Skip to content

abeerpathela/AiTextra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

🤖 AiTextra — Turn Your Phone Number into an AI Chatbot

Convert your own mobile number into an AI assistant that replies via SMS.

AiTextra is a system that allows your phone number to behave like an AI chatbot. Anyone can send an SMS to your number, and your phone will automatically reply using AI.

image

🌍 What This Project Actually Does

This project does NOT give you a shared AI service.

👉 Instead, it helps you build:

YOUR PHONE NUMBER = YOUR PERSONAL AI BOT
  • Your phone receives SMS
  • Your backend processes it using AI
  • Your phone sends back the reply

⚠️ IMPORTANT (READ BEFORE STARTING)

This is a self-hosted system.

👉 You MUST:

  • Clone this repository
  • Run your own backend
  • Use your own API keys
  • Connect your own phone

🧠 System Overview

User sends SMS
   ↓
Your Phone (SimAPI App)
   ↓
Webhook → Your Backend
   ↓
AI (Gemini)
   ↓
SimAPI
   ↓
Your Phone sends reply

📦 Project Structure

AiTextra/
│
├── backend/        ← 🔥 THIS IS THE MAIN PART
│   ├── index.js
│   ├── aiService.js
│   ├── smsService.js
│   ├── memoryService.js
│   └── package.json
│
└── mobile-app/     ← Android APK (SimAPI)

👉 Everything important is inside the backend/ folder


🚀 Step-by-Step Setup


📥 STEP 1 — Clone the Repository

git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git
cd YOUR_REPO/backend

📦 STEP 2 — Install Dependencies

npm install

🔐 STEP 3 — Create Your .env File

Inside the backend/ folder, create a .env file:

GEMINI_API_KEY=your_gemini_api_key
SIMAPI_KEY=your_simapi_key
PORT=3000

🔑 Where to get keys?

  • Gemini API → Google AI Studio
  • SimAPI Key → SimAPI Dashboard

▶️ STEP 4 — Run Backend

node index.js

Expected output:

Server running on http://localhost:3000

🌐 STEP 5 — Expose Backend (for testing)

Use ngrok:

ngrok http 3000

Copy URL like:

https://xxxxx.ngrok-free.dev

📱 STEP 6 — Install SimAPI App

👉 Download APK:

https://github.com/YOUR_USERNAME/YOUR_REPO/releases/download/v1.0/simapi.apk

🔐 STEP 7 — Give Permissions

Allow:

  • Send SMS
  • Read Phone State
  • Internet
  • Background activity

🔋 STEP 8 — Disable Battery Optimization (VERY IMPORTANT)

Settings → Apps → SimAPI → Battery → Unrestricted

🔑 STEP 9 — Connect Your Phone

  1. Open SimAPI app
  2. Paste your API key
  3. Click Connect

✅ Expected:

Device Status: Online

📡 STEP 10 — Setup SMS Forwarding

Configure your SMS forwarder:


Webhook URL:

https://xxxxx.ngrok-free.dev/webhook

JSON Payload:

{
  "sender": "%from%",
  "text": "%text%"
}

Headers:

{
  "Content-Type": "application/json"
}

🧪 STEP 11 — Test

Send SMS to your phone:

Hello AI

🎉 Expected Reply:

Hello! How can I assist you today?

🚀 Deployment (Optional)

You can deploy backend on:

  • Render
  • Railway

After deployment:

https://your-app.onrender.com/webhook

Replace ngrok URL in SMS forwarder.


🔐 How API Key Works

The API key connects:

Your Phone ↔ Your SimAPI Backend

👉 Important:

  • The backend uses YOUR API key
  • Only YOUR phone will send SMS
  • This is a single-device AI bot

⚠️ Common Mistakes


❌ Expecting it to work without cloning

This will NOT work.

👉 You must run your own backend.


❌ Wrong API key

Make sure:

Same API key in:
- .env
- SimAPI app

❌ No SMS received

Check:

  • Device online
  • Permissions granted
  • Battery unrestricted

❌ Slow response

Cause:

  • ngrok delay
  • free hosting cold start

🎯 Final Result

After setup:

Your phone number becomes an AI chatbot

Anyone can message your number → AI replies.


💡 Use Cases

  • Personal AI assistant
  • Rural AI access
  • Offline chatbot
  • Emergency response systems

👨‍💻 Author

Abeer Pathela


⭐ Support

If this project helped you, give it a ⭐

About

AI-powered SMS chatbot that lets any user interact with an LLM using simple text messages — no internet or app required.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors