POS Adapters
The POS Adapters service integrates SMACKZ with point-of-sale systems. Currently, it supports Clover POS, enabling restaurants to sync menus, orders, and payments between SMACKZ and their physical Clover terminals.
Tech Stack
| Component | Technology |
|---|---|
| Backend | Node.js 20+, TypeScript, Fastify |
| Database | PostgreSQL 16 via Drizzle ORM |
| Validation | Zod |
| Frontend | React 18, Tailwind CSS, React Query |
| Deployment | Docker Compose / Control Plane |
Features
- OAuth integration with Clover for multi-tenant merchant connections
- Menu sync -- Pull categories and items from Clover into SMACKZ
- Order sync -- Push SMACKZ orders to Clover POS
- Payment processing with PCI compliance
- Credit card storage for future payments
- Webhook support for real-time Clover updates
Multi-Tenant Connection Flow
- Restaurant owner enters their SMACKZ Restaurant ID and Clover Merchant ID
- System generates a Clover OAuth URL targeting the specific merchant (
getAuthorizationUrl(merchantId?)appendsmerchant_idto OAuth params if supplied) - Owner completes OAuth authorization
- System fetches merchant details from Clover API automatically —
POST complete-onboardingcallscloverApiService.getMerchantDetails(accessToken)to pull the merchant name from/v3/merchants/selfifmerchantNameis omitted (falls back to "Unknown Merchant") - Mapping is created linking the SMACKZ restaurant to the Clover merchant
Each SMACKZ restaurant connects to a specific Clover merchant, supporting true multi-tenancy with reduced manual input and accurate Clover-sourced data.
Key Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/clover/auth/connect |
GET | Generate Clover OAuth URL |
/api/v1/clover/auth/callback |
GET | Handle OAuth callback |
/api/v1/clover/restaurants/sync |
POST | Sync restaurant data |
/api/v1/clover/restaurants/{id}/menu/sync |
POST | Sync full menu |
/api/v1/clover/restaurants/{id}/orders |
POST | Create order in Clover |
/api/v1/clover/webhooks |
POST | Handle Clover webhooks |
Project Structure
clover-adapter/
├── src/ # Backend source
│ ├── api/ # REST routes and schemas
│ ├── config/ # App configuration
│ ├── db/ # Database schemas
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ └── types/ # TypeScript definitions
├── frontend/ # React frontend
├── drizzle/ # Database migrations
├── docker-compose.yml # Docker setup
└── Dockerfile # Backend container
Local Development
cd clover-adapter
npm install
cp env.example .env
# Edit .env with Clover credentials
npm run dev # Backend at http://localhost:3000
cd frontend && npm start # Frontend at http://localhost:3000
Key Files
Smackz-POS-Adapters/CLAUDE.md-- Branch and commit rulesSmackz-POS-Adapters/env.example-- Required environment variablesSmackz-POS-Adapters/docker-compose.yml-- Docker setup