Skip to content

EncrEor/JoyJuice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JoyJuice

Backend + Frontend for the Joy Juice delivery assistant.

Built with Claude Sonnet 3.5 (Oct-Dec 2024) as an early experiment in AI-assisted development.


What It Does

An internal tool for Joy Juice (cold-pressed juice company, Tunisia) that:

  • Manages orders & deliveries via Google Sheets as database
  • Chat assistant powered by Claude API — staff can ask questions about clients, orders, stock in natural language
  • Telegram bot integration for delivery notifications
  • Client portal (Next.js frontend) for tracking deliveries

Architecture

JoyJuice/
├── server.js              # Express API server
├── routes/                # REST endpoints
│   ├── chat.js            # Claude-powered assistant
│   ├── clients.js         # Client management
│   ├── commandes.js       # Orders
│   ├── livraisons.js      # Deliveries
│   └── produits.js        # Products
├── Services/
│   ├── claude/             # Claude AI integration
│   │   ├── core/           # Cache manager, context handling
│   │   ├── handlers/       # Chat request handlers
│   │   └── alertManager.js # Delivery alerts
│   ├── googleSheetsService.js  # Google Sheets as DB
│   ├── odooAuth.js         # Odoo ERP integration
│   └── odooSalesService.js # Odoo sales sync
└── frontend/               # Next.js client app
    ├── src/
    │   ├── pages/          # App pages
    │   ├── components/     # React components
    │   │   └── client/     # Client delivery view
    │   └── services/       # API client
    └── package.json

Tech Stack

Layer Tech
Backend Node.js, Express
AI Claude API (Anthropic SDK), OpenAI
Database Google Sheets API, MongoDB
Frontend Next.js, TypeScript, Tailwind CSS
ERP Odoo (XML-RPC)
Notifications Telegram Bot API

Setup

Prerequisites

  • Node.js 18+
  • Google Sheets API credentials
  • Anthropic API key
  • Telegram Bot Token (for notifications)

Backend

cp .env.example .env
# Fill in: ANTHROPIC_API_KEY, GOOGLE_SHEETS_ID, TELEGRAM_BOT_TOKEN, etc.
npm install
npm start

Server runs on http://localhost:3000

Frontend

cd frontend
npm install
npm run dev

Client app runs on http://localhost:3001

Telegram

To receive delivery notifications, create a Telegram bot:

  1. Message @BotFather on Telegram
  2. /newbot → choose a name → get the token
  3. Add TELEGRAM_BOT_TOKEN=your_token to .env
  4. Add TELEGRAM_CHAT_ID=your_chat_id to .env

To get your chat ID, message your bot then visit:

https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates

Context

This was the first Joy Juice project — a delivery management tool for the Tunisia operation. The company has since moved to Odoo 19 for the France launch (Alpes-Maritimes). This repo is kept as a reference.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors