Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MesaChain revolutionizes the restaurant and café industry by seamlessly integrating comprehensive management tools with the Stellar blockchain. Our platform addresses critical challenges facing food service establishments while leveraging blockchain technology.

License

MesaChain/MesaChain

Repository files navigation

MesaChain 🍽️ 💫

Restaurant Management Platform Integrated with Stellar Blockchain

c62168b7-bc5a-49da-ad4e-2d50bb2a4acf

🚀 Overview

MesaChain revolutionizes the restaurant and café industry by seamlessly integrating comprehensive management tools with the Stellar blockchain. Our platform addresses critical challenges facing food service establishments while leveraging blockchain technology to reduce costs and enhance customer experiences.

🎯 Problem We Solve

The restaurant industry currently faces multiple pain points that impact profitability and growth:

  • 💸 High payment processing fees (2-4% per transaction)
  • 🧩 Fragmented management systems (inventory, staff, sales)
  • 🎁 Ineffective and costly loyalty programs
  • ⏱️ Slow financial processes (settlements, payments to employees/suppliers)
  • 📊 Limited data visibility for decision-making

👥 Target Users

  • 🍕 Independent restaurant, bar, and café owners and managers
  • 🏢 Medium-sized establishment chains (5-50 locations)
  • 👨‍🍳 Service staff (waiters, cashiers, chefs)
  • 🧑‍💼 Frequent customers of these establishments
  • 🚚 Suppliers for the food service sector

⚙️ Tech Stack

Core Technology

  • Backend:

    • 🖥️ Node.js/Deno.js
    • 🌐 Express
    • 🗄️ PostgreSQL
    • ⚡ Redis
  • Frontend:

    • ⚛️ React (Web/Desktop)
    • 📱 React Native (Mobile)
  • Blockchain:

    • 🌟 Stellar SDK
    • 🔄 Horizon API
    • 🔒 Stellar Consensus Protocol
  • Security:

    • 🛡️ HSM for key custody
    • 🔐 Multi-factor authentication
  • Data Analysis:

    • 🧠 TensorFlow for predictions
    • 📈 Tableau for visualizations
  • Infrastructure:

    • ☁️ AWS/Azure
    • 🐳 Docker
    • ⛵ Kubernetes

🏗️ Architecture

MesaChain's architecture consists of three main components:

1. Core Management Application (Backend)

  • REST API for communication between components
  • Microservices for different functionalities (inventory, payments, etc.)
  • Direct integration with the Stellar network via Horizon API

2. User Interfaces (Frontend)

  • Responsive web/desktop application for administrators
  • Mobile application for customers (Android/iOS)
  • Simplified POS terminal for staff

3. Blockchain Infrastructure

  • Stellar private key custodian
  • Custom token issuance and management
  • Anchoring system for fiat-crypto conversion

✨ Key Features

  • 🔄 Integrated Payment System: Process payments with minimal fees (<$0.001) via Stellar
  • 📱 Customer Mobile App: Order, pay, and manage loyalty points
  • 📦 Inventory Management: Track stock levels and predict future needs
  • 👥 Staff Management: Scheduling, payroll, and performance analytics
  • 🎁 Tokenized Loyalty Program: Create and manage custom loyalty tokens
  • 📊 Advanced Analytics: Make informed decisions with data visualizations
  • 🌐 Multi-location Support: Manage multiple establishments from one dashboard
  • 🔌 Supplier Integration: Streamline ordering and payment processes

🌍 Environment Setup

Required Environment Variables

Create a .env file in the root directory with the following variables:

# Stellar Network Configuration
STELLAR_NETWORK=testnet  # Options: testnet | mainnet
HORIZON_URL=https://horizon-testnet.stellar.org  # Testnet URL
API_BASE_URL_BACKEND=http://localhost:3000
API_BASE_URL_FRONTEND=http://localhost:5173

For the frontend, create a .env file in the apps/frontend directory with the same variables:

NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_API_BASE_URL_BACKEND=http://localhost:3000
NEXT_PUBLIC_API_BASE_URL_FRONTEND=http://localhost:5173

Environment Variable Validation

The application uses Zod for environment variable validation. Missing or malformed variables will cause the application to fail fast with descriptive error messages.

Switching Between Networks

To switch between testnet and mainnet:

  1. Update STELLAR_NETWORK to either testnet or mainnet
  2. Update HORIZON_URL accordingly:
    • Testnet: https://horizon-testnet.stellar.org
    • Mainnet: https://horizon.stellar.org

Security Notes

  • Never commit real .env files to version control
  • Store production secrets in GitHub Secrets & Variables
  • Use .env.example as a template for required variables

🚀 Running the Application

Frontend (FE)

To run the frontend application:

# Navigate to the frontend directory
cd MesaChain-FE

# Install dependencies (if not already done)
pnpm install

# Start the development server
pnpm run dev

The frontend will be available at http://localhost:3000 by default.

Backend (BE)

To run the backend application:

# Navigate to the backend directory
cd MesaChain-BE

# Install dependencies (if not already done)
pnpm install

# Start the development server
pnpm run dev

The backend API will be available at http://localhost:4000 by default.

Running Both Frontend and Backend

For full application functionality, you'll need both services running. Open two terminal windows and follow these steps:

Terminal 1 (Backend):

cd MesaChain-BE
pnpm run dev

Terminal 2 (Frontend):

cd MesaChain-FE
pnpm run dev

Make sure you have all the required environment variables set up as described in the Environment Setup section above.

🎯 Reservation MVP

Prerequisites

  • Node.js 18 or higher
  • pnpm
  • Docker and Docker Compose

Setup Steps

  1. Start PostgreSQL database:
pnpm docker:up
  1. Install dependencies:
pnpm install
  1. Generate Prisma client:
cd packages/database
pnpm prisma generate
cd ../..
  1. Apply migrations:
cd packages/database
pnpm prisma migrate deploy
cd ../..
  1. Start development server:
pnpm dev

API Endpoints

Reservations

  • GET /reservations/availability?startTime&endTime&partySize

    • Get available tables for a specific time slot and party size
    • Parameters:
      • startTime: Start date and time (ISO string)
      • endTime: End date and time (ISO string)
      • partySize: Number of people
  • POST /reservations

    • Create a new reservation
    • Body:
      {
        "userId": "uuid",
        "tableId": "uuid",
        "startTime": "ISO string",
        "endTime": "ISO string",
        "partySize": number
      }
  • PATCH /reservations/:id/cancel

    • Cancel an existing reservation
    • Parameters:
      • id: Reservation ID

Development

Run tests:

pnpm test

Run tests in watch mode:

pnpm test:watch

View test coverage:

pnpm test:cov

Start DB

🚀 Development Workflow

After the initial setup, you can use the following commands for development:

  • npm run dev - Start the application in development mode with hot reloading
  • npm run test - Run the test suite
  • npm run lint - Run the linter to check code quality

❓ Troubleshooting

If you encounter any dependency issues, try deleting the node_modules folder and the pnpm-lock.yaml file, then run pnpm install again.

Make sure you have the correct versions of Node.js and pnpm installed.

Check the project documentation for any specific environment variables that need to be set.

📊 Monitoring & Logging

MesaChain uses Prometheus, Grafana, and the ELK stack for comprehensive monitoring and centralized logging. See MONITORING.md for full onboarding and playbook details.

To onboard a new service or respond to alerts, see the quick reference in README_MONITORING_SNIPPET.md and the full guide in MONITORING.md.

About

MesaChain revolutionizes the restaurant and café industry by seamlessly integrating comprehensive management tools with the Stellar blockchain. Our platform addresses critical challenges facing food service establishments while leveraging blockchain technology.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 22

Languages