Skip to main content

Introduction

Bar Galileo provides a RESTful API built with Django for managing restaurant operations, including tables, orders, products, and intelligent document-based chat using RAG (Retrieval-Augmented Generation).

Base URL

All API endpoints are relative to your Bar Galileo installation:
https://your-domain.com/

API Structure

The Bar Galileo API is organized into several functional modules:

Core Modules

RAG Chat

Upload documents, query with AI, and manage document collections

Tables & Orders

Manage restaurant tables, orders, and billing

Products

Product catalog, categories, and inventory management

Authentication

User authentication using Django Allauth

HTTP Methods

The API uses standard HTTP methods:
MethodDescription
GETRetrieve resources
POSTCreate new resources
PUT / PATCHUpdate existing resources
DELETERemove resources

Response Format

All API responses are returned in JSON format:

Success Response

{
  "collection_id": 1,
  "title": "User Manual",
  "status": "indexed",
  "chunk_count": 45,
  "page_count": 12
}

Error Response

{
  "error": "Description of the error"
}

Status Codes

CodeDescription
200Success
201Created successfully
400Bad request - invalid parameters
401Unauthorized - authentication required
403Forbidden - insufficient permissions
404Resource not found
500Internal server error

Authentication

Most API endpoints require authentication. Bar Galileo uses Django’s session-based authentication powered by django-allauth.
See the Authentication page for detailed authentication flows.

CSRF Protection

Most POST/PUT/DELETE endpoints are decorated with @csrf_exempt for API usage. However, for web-based forms, CSRF tokens are still required.

Rate Limiting

Currently, Bar Galileo does not implement rate limiting. Consider implementing rate limiting in production environments.

Content Type

All POST/PUT requests should include:
Content-Type: application/json
For file uploads (e.g., document uploads), use:
Content-Type: multipart/form-data

URL Namespaces

Bar Galileo uses Django’s URL namespacing:
  • products: - Product-related endpoints
  • tables: - Table and order management
  • rag_chat: - RAG chat and document endpoints
  • core: - Core application views
  • admin_dashboard: - Admin dashboard endpoints

External Integrations

Google Gemini API

RAG chat functionality uses Google’s Gemini 2.0 Flash model for generating contextual responses.
GOOGLE_API_KEY
string
required
Environment variable required for AI-powered responses

Next Steps

Authentication

Learn about user authentication

RAG Chat API

Explore the intelligent document chat API

Build docs developers (and LLMs) love