Skip to content

leobpoba/tag-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AI Tag Request Assistant - Complete Package

Everything you need to deploy your AI assistant!


πŸ“¦ What's Inside This Package

tag-assistant/
β”œβ”€β”€ backend/                    ← Server code
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── platforms.json      ← Your 86 Scope3 platforms
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ ai-agent.js         ← AI processing
β”‚   β”‚   β”œβ”€β”€ file-storage.js     ← Stores tickets
β”‚   β”‚   β”œβ”€β”€ history.js          ← Audit trail
β”‚   β”‚   └── platform-matcher.js ← Platform recognition
β”‚   β”œβ”€β”€ data/                   ← Tickets stored here
β”‚   β”œβ”€β”€ package.json            ← Dependencies list
β”‚   β”œβ”€β”€ .env.example            ← Configuration template
β”‚   └── server.js               ← Main server
β”‚
β”œβ”€β”€ frontend.html               ← Chat interface (single file!)
└── README.md                   ← This file


πŸš€ Quick Start (3 Steps!)

Step 1: Upload to GitHub

  1. Create a new repository on GitHub
  2. Upload all files from the backend/ folder
  3. Push to GitHub

Step 2: Deploy to Vercel

  1. Go to vercel.com
  2. Import your GitHub repository
  3. Add environment variables (see below)
  4. Deploy!

Step 3: Use the Frontend

  1. Open frontend.html in a text editor
  2. Replace REPLACE_WITH_YOUR_VERCEL_URL with your actual URL
  3. Save and open in browser
  4. Start creating tag requests!

Detailed guide: See ULTIMATE_BEGINNER_GUIDE.md in the chat


πŸ”‘ Environment Variables

When deploying to Vercel, add these:

GEMINI_API_KEY=your_gemini_key_here
NODE_ENV=production
API_SECRET_KEY=scope3_secret_2024
ALLOWED_ORIGINS=*
PORT=3000

Get your Gemini API key: https://aistudio.google.com/app/apikey (FREE!)


🎯 How It Works

User Types:

"urgent Nike tag for Meta"

AI Understands:

  • βœ“ Client: Nike
  • βœ“ Platform: Meta
  • βœ“ Tag Type: (will ask)
  • βœ“ Priority: High

Creates Ticket:

  • Saved in backend/data/tickets.json
  • Full history in backend/data/history.json
  • Can export to CSV anytime!

πŸ“‹ Your 86 Platforms

Already configured in backend/config/platforms.json:

Top platforms:

  • Meta (Facebook, Meta Ads)
  • Google DV360 (20+ variations)
  • Google Ad Manager (GAM/DFP)
  • The Trade Desk (TTD)
  • Xandr (AppNexus)
  • Amazon Advertising
  • And 80 more!

Client-specific variations included:

  • Cofidis: dv360_cofidis, gam_cofidis, etc.
  • SNCF: adventori_sncf, etc.
  • Solocal: adnxs_solocal, etc.

πŸ“± API Endpoints

Your backend provides these endpoints:

Chat & Tickets:

  • POST /api/chat - Send message to AI
  • POST /api/tickets/create - Create new ticket
  • GET /api/tickets - List all tickets
  • GET /api/tickets/:id - Get single ticket

Analytics:

  • GET /api/analytics - Get usage stats
  • GET /api/analytics/turnaround - Response times
  • GET /api/storage/stats - Storage info

Export:

  • GET /api/export/tickets - Download tickets CSV
  • GET /api/export/history - Download history CSV

Other:

  • GET /api/health - Health check
  • GET /api/platforms - List platforms

πŸ§ͺ Testing

Test Backend:

# Health check
curl https://your-app.vercel.app/api/health

# Should return:
{
  "status": "ok",
  "storage": "file",
  "services": {
    "ai": true,
    "storage": true,
    "platforms": 86
  }
}

Test Frontend:

  1. Open frontend.html in browser
  2. Type: "urgent Nike tag for Meta"
  3. AI should respond and extract data
  4. Click "Create Ticket"
  5. Success! πŸŽ‰

πŸ“Š Where Data is Stored

File-based storage (no Notion required!):

backend/data/
β”œβ”€β”€ tickets.json    ← All tag requests
└── history.json    ← Complete audit trail

Export anytime:

  • Download CSV from API
  • Open in Excel/Google Sheets
  • Share with team!

Switching to Notion later? Just add these environment variables and it switches automatically:

NOTION_TOKEN=secret_xxx
NOTION_TICKETS_DB_ID=xxx
NOTION_HISTORY_DB_ID=xxx

πŸ’° Cost

EVERYTHING IS FREE!

  • βœ… Gemini API: FREE (1,500 requests/day)
  • βœ… Vercel Hosting: FREE (hobby plan)
  • βœ… File Storage: FREE (included)
  • βœ… GitHub: FREE

Total: $0/month πŸŽ‰


πŸ› οΈ Customization

Add More Platforms:

  1. Open backend/config/platforms.json
  2. Add new platform:
{
  "id": "new-platform",
  "name": "New Platform Name",
  "aliases": ["Alias 1", "Alias 2"],
  "active": true,
  "priority": 87
}
  1. Redeploy!

Change Styling:

  1. Open frontend.html
  2. Edit the <style> section at the top
  3. Change colors, fonts, etc.
  4. Save and refresh!

Add More Clients:

Currently: Nike, SAP, Cofidis, SNCF Connect, eltordlic

To add more, just type them! The AI will learn.


πŸ†˜ Troubleshooting

"API not configured"

  • Make sure you updated API_BASE_URL in frontend.html
  • Should look like: https://your-app.vercel.app/api

"Build failed on Vercel"

  • Check that package.json is in the backend folder
  • Make sure Node.js version is set to 18+
  • Check Vercel logs for specific error

"AI not responding"

  • Verify GEMINI_API_KEY is set in Vercel
  • Check it's the correct key (starts with AIza...)
  • Make sure you didn't hit the free tier limit

"Platform not recognized"

  • Check backend/config/platforms.json has the platform
  • Add aliases if needed
  • The AI uses fuzzy matching, so typos should still work!

"Can't see tickets"

  • Tickets are stored in backend/data/tickets.json
  • Use API endpoint: GET /api/tickets
  • Or export CSV: GET /api/export/tickets

πŸ“š Documentation

In the chat, you'll find:

  • ULTIMATE_BEGINNER_GUIDE.md - Complete step-by-step
  • QUICK_START_FILE_STORAGE.md - Quick reference
  • FILE_STORAGE_SOLUTION.md - Technical details
  • SCOPE3_CUSTOMIZATION.md - Platform info

πŸŽ“ Training Your Team

For Users (2 minutes):

  1. Show them the URL
  2. Demo: "urgent Nike tag for Meta"
  3. Let them try!

For Admins (10 minutes):

  1. How to access API
  2. How to export CSV
  3. How to view analytics
  4. How to add platforms

πŸ” Security Notes

Keep these SECRET:

  • βœ… Gemini API Key
  • βœ… API Secret Key

Safe to share:

  • βœ… Your Vercel URL
  • βœ… Frontend HTML file
  • βœ… Ticket data (it's yours!)

Note: The API_SECRET_KEY in your .env prevents unauthorized access.


πŸ“ˆ Next Steps

Week 1:

  • Deploy backend βœ“
  • Set up frontend βœ“
  • Test with 3 team members
  • Export first CSV report

Week 2-4:

  • Train full team
  • Monitor usage
  • Add custom platforms if needed
  • Celebrate success! πŸŽ‰

Month 2+:

  • Consider Notion upgrade
  • Add JS Tag Generation API
  • Build analytics dashboard
  • Automate weekly reports

πŸ’¬ Support

Need help?

Ask in the Claude chat:

  • "I'm stuck on [step]"
  • "This error appeared: [error message]"
  • "How do I [do something]?"

I'm here to help! πŸ™‚


πŸŽ‰ Congratulations!

You have everything you need to deploy your AI Tag Request Assistant!

What you're getting:

  • βœ… AI-powered natural language understanding
  • βœ… 86 Scope3 platforms pre-configured
  • βœ… Automatic ticket creation
  • βœ… Complete audit trail
  • βœ… CSV export capability
  • βœ… Free forever!

Time to deploy: 30-45 minutes Time saved per request: ~2-3 minutes ROI: Immediate! πŸš€


Ready? Follow the ULTIMATE_BEGINNER_GUIDE.md!

About

AI Tag Request Assistant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors