feat: initial commit — HermesMessages SaaS platform
Backend (FastAPI + Python 3.12):
- Multi-tenant auth with JWT: login, register, refresh, Meta OAuth
- Business & BusinessConfig management
- WhatsApp webhook with HMAC signature verification
- Bot engine powered by Claude AI
- Calendar availability with Redis caching
- Reservations CRUD with status management
- Dashboard analytics (stats, agenda, peak hours)
- Billing & plan management
- Admin panel with platform-wide stats
- Async bcrypt via asyncio.to_thread
- IntegrityError handling for concurrent registration race conditions
Frontend (React 18 + Vite + Tailwind CSS):
- Multi-step guided registration form with helper text on every field
- Login page with show/hide password toggle
- Protected routes with AuthContext
- Dashboard with stats cards, bar chart, and daily agenda
- Reservations list with search, filters, and inline status actions
- Calendar with weekly view, slot availability, and date blocking
- Config page: business info, schedules, bot personality
- Billing page with plan comparison and usage bar
Design system:
- Bricolage Grotesque + DM Sans typography
- Emerald primary palette with semantic color tokens
- scale(0.97) button press feedback, ease-out animations
- Skeleton loaders, stagger animations, prefers-reduced-motion support
- Accessible: aria-labels, visible focus rings, 4.5:1 contrast
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 09:49:41 -05:00
|
|
|
from datetime import date, time
|
|
|
|
|
|
|
|
|
|
from sqlalchemy import (
|
2026-04-29 09:39:56 -05:00
|
|
|
Boolean,
|
feat: initial commit — HermesMessages SaaS platform
Backend (FastAPI + Python 3.12):
- Multi-tenant auth with JWT: login, register, refresh, Meta OAuth
- Business & BusinessConfig management
- WhatsApp webhook with HMAC signature verification
- Bot engine powered by Claude AI
- Calendar availability with Redis caching
- Reservations CRUD with status management
- Dashboard analytics (stats, agenda, peak hours)
- Billing & plan management
- Admin panel with platform-wide stats
- Async bcrypt via asyncio.to_thread
- IntegrityError handling for concurrent registration race conditions
Frontend (React 18 + Vite + Tailwind CSS):
- Multi-step guided registration form with helper text on every field
- Login page with show/hide password toggle
- Protected routes with AuthContext
- Dashboard with stats cards, bar chart, and daily agenda
- Reservations list with search, filters, and inline status actions
- Calendar with weekly view, slot availability, and date blocking
- Config page: business info, schedules, bot personality
- Billing page with plan comparison and usage bar
Design system:
- Bricolage Grotesque + DM Sans typography
- Emerald primary palette with semantic color tokens
- scale(0.97) button press feedback, ease-out animations
- Skeleton loaders, stagger animations, prefers-reduced-motion support
- Accessible: aria-labels, visible focus rings, 4.5:1 contrast
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 09:49:41 -05:00
|
|
|
Column,
|
|
|
|
|
Date,
|
|
|
|
|
Enum,
|
|
|
|
|
ForeignKey,
|
|
|
|
|
Integer,
|
2026-04-29 09:39:56 -05:00
|
|
|
Numeric,
|
feat: initial commit — HermesMessages SaaS platform
Backend (FastAPI + Python 3.12):
- Multi-tenant auth with JWT: login, register, refresh, Meta OAuth
- Business & BusinessConfig management
- WhatsApp webhook with HMAC signature verification
- Bot engine powered by Claude AI
- Calendar availability with Redis caching
- Reservations CRUD with status management
- Dashboard analytics (stats, agenda, peak hours)
- Billing & plan management
- Admin panel with platform-wide stats
- Async bcrypt via asyncio.to_thread
- IntegrityError handling for concurrent registration race conditions
Frontend (React 18 + Vite + Tailwind CSS):
- Multi-step guided registration form with helper text on every field
- Login page with show/hide password toggle
- Protected routes with AuthContext
- Dashboard with stats cards, bar chart, and daily agenda
- Reservations list with search, filters, and inline status actions
- Calendar with weekly view, slot availability, and date blocking
- Config page: business info, schedules, bot personality
- Billing page with plan comparison and usage bar
Design system:
- Bricolage Grotesque + DM Sans typography
- Emerald primary palette with semantic color tokens
- scale(0.97) button press feedback, ease-out animations
- Skeleton loaders, stagger animations, prefers-reduced-motion support
- Accessible: aria-labels, visible focus rings, 4.5:1 contrast
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 09:49:41 -05:00
|
|
|
String,
|
|
|
|
|
Time,
|
|
|
|
|
func,
|
|
|
|
|
)
|
|
|
|
|
from sqlalchemy.dialects.postgresql import ARRAY
|
|
|
|
|
from sqlalchemy.orm import relationship
|
|
|
|
|
|
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Business(Base):
|
|
|
|
|
__tablename__ = "businesses"
|
|
|
|
|
|
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
|
|
|
name = Column(String, nullable=False)
|
|
|
|
|
type = Column(String, nullable=False)
|
|
|
|
|
timezone = Column(String, nullable=False, default="UTC")
|
|
|
|
|
status = Column(
|
|
|
|
|
Enum("trial", "active", "suspended", name="business_status"),
|
|
|
|
|
nullable=False,
|
|
|
|
|
default="trial",
|
|
|
|
|
)
|
|
|
|
|
plan = Column(
|
|
|
|
|
Enum("free", "basic", "pro", name="business_plan"),
|
|
|
|
|
nullable=False,
|
|
|
|
|
default="free",
|
|
|
|
|
)
|
|
|
|
|
meta_business_id = Column(String, nullable=True)
|
|
|
|
|
whatsapp_phone_number_id = Column(String, nullable=True, unique=True)
|
|
|
|
|
whatsapp_access_token = Column(String, nullable=True)
|
|
|
|
|
created_at = Column(Date, server_default=func.current_date())
|
|
|
|
|
|
|
|
|
|
users = relationship("User", back_populates="business", cascade="all, delete-orphan")
|
|
|
|
|
config = relationship("BusinessConfig", back_populates="business", uselist=False)
|
|
|
|
|
reservations = relationship("Reservation", back_populates="business")
|
2026-04-29 09:39:56 -05:00
|
|
|
table_types = relationship("TableType", back_populates="business", cascade="all, delete-orphan")
|
|
|
|
|
services = relationship("Service", back_populates="business", cascade="all, delete-orphan")
|
feat: initial commit — HermesMessages SaaS platform
Backend (FastAPI + Python 3.12):
- Multi-tenant auth with JWT: login, register, refresh, Meta OAuth
- Business & BusinessConfig management
- WhatsApp webhook with HMAC signature verification
- Bot engine powered by Claude AI
- Calendar availability with Redis caching
- Reservations CRUD with status management
- Dashboard analytics (stats, agenda, peak hours)
- Billing & plan management
- Admin panel with platform-wide stats
- Async bcrypt via asyncio.to_thread
- IntegrityError handling for concurrent registration race conditions
Frontend (React 18 + Vite + Tailwind CSS):
- Multi-step guided registration form with helper text on every field
- Login page with show/hide password toggle
- Protected routes with AuthContext
- Dashboard with stats cards, bar chart, and daily agenda
- Reservations list with search, filters, and inline status actions
- Calendar with weekly view, slot availability, and date blocking
- Config page: business info, schedules, bot personality
- Billing page with plan comparison and usage bar
Design system:
- Bricolage Grotesque + DM Sans typography
- Emerald primary palette with semantic color tokens
- scale(0.97) button press feedback, ease-out animations
- Skeleton loaders, stagger animations, prefers-reduced-motion support
- Accessible: aria-labels, visible focus rings, 4.5:1 contrast
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 09:49:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class BusinessConfig(Base):
|
|
|
|
|
__tablename__ = "business_configs"
|
|
|
|
|
|
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
|
|
|
business_id = Column(
|
|
|
|
|
Integer, ForeignKey("businesses.id", ondelete="CASCADE"), nullable=False, unique=True
|
|
|
|
|
)
|
|
|
|
|
open_days = Column(ARRAY(Integer), nullable=False, default=list)
|
|
|
|
|
open_time = Column(Time, nullable=False, default=time(9, 0))
|
|
|
|
|
close_time = Column(Time, nullable=False, default=time(18, 0))
|
|
|
|
|
slot_duration = Column(Integer, nullable=False, default=60)
|
|
|
|
|
max_per_slot = Column(Integer, nullable=False, default=1)
|
|
|
|
|
blocked_dates = Column(ARRAY(Date), nullable=False, default=list)
|
|
|
|
|
assistant_name = Column(String, nullable=False, default="Hermes")
|
|
|
|
|
tone = Column(
|
|
|
|
|
Enum("formal", "casual", name="assistant_tone"), nullable=False, default="formal"
|
|
|
|
|
)
|
|
|
|
|
welcome_message = Column(String, nullable=True)
|
|
|
|
|
|
|
|
|
|
business = relationship("Business", back_populates="config")
|
2026-04-29 09:39:56 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TableType(Base):
|
|
|
|
|
__tablename__ = "table_types"
|
|
|
|
|
|
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
|
|
|
business_id = Column(
|
|
|
|
|
Integer, ForeignKey("businesses.id", ondelete="CASCADE"), nullable=False, index=True
|
|
|
|
|
)
|
|
|
|
|
capacity = Column(Integer, nullable=False)
|
|
|
|
|
quantity = Column(Integer, nullable=False)
|
|
|
|
|
label = Column(String, nullable=True)
|
|
|
|
|
|
|
|
|
|
business = relationship("Business", back_populates="table_types")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Service(Base):
|
|
|
|
|
__tablename__ = "services"
|
|
|
|
|
|
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
|
|
|
business_id = Column(
|
|
|
|
|
Integer, ForeignKey("businesses.id", ondelete="CASCADE"), nullable=False, index=True
|
|
|
|
|
)
|
|
|
|
|
name = Column(String, nullable=False)
|
|
|
|
|
description = Column(String, nullable=True)
|
|
|
|
|
price = Column(Numeric(10, 2), nullable=True)
|
|
|
|
|
duration_minutes = Column(Integer, nullable=True)
|
|
|
|
|
is_active = Column(Boolean, nullable=False, default=True)
|
|
|
|
|
|
|
|
|
|
business = relationship("Business", back_populates="services")
|