Skip to content

MathisZerbib/twa-ton

Repository files navigation

TON-Eats 🚀

The world's first 0% commission decentralized food delivery network powered by the TON Blockchain. 🍔🍣🍕

🌟 Key Features

  • 0% Commission: Restaurants keep 100% of their earnings.
  • TON Payouts: Secure, instant payments via on-chain escrow smart contracts.
  • Real-time Tracking: Live GPS updates for deliveries via Socket.io.
  • Dynamic Pricing: USDT-based pricing with live TON oracle conversion.
  • Web3 Native: Seamless integration with Telegram Mini Apps and TonConnect.

🛠️ Tech Stack

  • Frontend: React (Vite), TypeScript, Styled Components, TonConnect.
  • Backend: Node.js (Express), Socket.io, Prisma ORM.
  • Database: PostgreSQL (Dockerized).
  • Proxy: Nginx (handling SPA routing and API proxying).

🚀 Getting Started

1. Prerequisites

2. Launch with Docker Compose

You can bring up the entire stack (Database, Backend, Frontend) with a single command:

docker compose up -d --build

The stack includes:

3. Automatic Seeding

The backend is configured to automatically seed the database on startup if it detects the merchant table is empty. It will create 3 premium restaurants:

  • Burger Palace (American)
  • Sushi Zen (Japanese)
  • Pizza Paradiso (Italian)

To manually re-seed or clear the database, run:

docker exec -it twa-ton-backend-1 node seed.js

4. Development & Live Testing (Cloudflare Tunnel)

To test the Telegram Mini App on a real mobile device, you can launch the Cloudflare Tunnel profile:

docker compose --profile dev up -d

Check the logs of the tunnel container to find your temporary public URL:

docker logs twa-ton-tunnel-1 2>&1 | grep "trycloudflare.com"

📂 Project Structure

├── backend/            # Express, Prisma, Socket.io
│   ├── prisma/        # Database schema
│   ├── routes/        # API endpoints
│   ├── store/         # Order state & DB singleton
│   └── seed.js        # Initial data entry
├── public/assets/     # Static assets & Premium food photos
├── src/               # React (Vite) Frontend
│   ├── components/    # Styled components & UI
│   ├── hooks/         # Custom TON / Socket hooks
│   └── pages/         # Shop, Discovery, Onboarding
└── docker-compose.yml # Full stack orchestration

🤝 Partner with TON-Eats

Interested in launching your restaurant? Visit the Merchant Onboarding page to deploy your store directly on the TON network.

Built for the TON Hackathon 💎

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors