mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 12:24:26 +00:00
- Update TASKS.md with complete Aperture implementation plan (7 phases) - Define critical, high, medium, and low priority tasks - Add timeline estimates: ~136-171 hours total (~17-21 business days) - Add sprint structure (6 sprints) - Create APERTURE_SQUARE_UI.md: Complete Square UI style guide - Color palette, typography, borders, shadows - Layout patterns, component states - Accessibility guidelines - Responsive adaptations - Create DESIGN_SYSTEM.md: Comprehensive design system for AnchorOS - Resolve color inconsistency between site_requirements.md and globals.css - Document both systems (anchor23.mx and Aperture) - Component documentation checklist - Implementation guidelines - Update API.md with undocumented implemented routes: - GET /api/availability/blocks - GET /api/public/availability - POST /api/availability/staff - POST /api/kiosk/walkin - PATCH /api/bookings/[id] - Update README.md with current project state: - Fase 1-3: 100% completed - Fase 4: 0% completed (redefined with full specifications) - Add missing feature details (POS, multiple cashiers, etc.) Based on technical specifications received, Aperture now includes: - Dashboard Home (KPI cards, performance charts, top performers, activity feed) - Master Calendar (drag & drop, resize blocks, dynamic filters, visual indicators) - Team & Payroll (staff CRUD, commissions, payroll calculation, shift management) - Clients & Loyalty (CRM, VIP gallery, memberships, points system) - Sales, Payments & Invoicing (POS, daily cash close, finance) - Marketing & Configuration (campaigns, dynamic pricing, integration placeholders) Tech stack: Radix UI + Tailwind CSS + Square UI custom styling
5.6 KiB
5.6 KiB
AnchorOS API Documentation
Overview
AnchorOS is a comprehensive salon management system built with Next.js, Supabase, and Stripe integration.
Authentication
- Client Authentication: Magic link via Supabase Auth
- Staff/Admin Authentication: Supabase Auth with role-based access
- Kiosk Authentication: API key based
API Endpoints
Public APIs
Services
GET /api/services- List all available servicesPOST /api/services- Create new service (Admin only)
Locations
GET /api/locations- List all salon locations
Availability
GET /api/availability/time-slots- Get available time slots for bookingPOST /api/availability/staff-unavailable- Mark staff unavailable (Staff auth required)GET /api/availability/blocks- Get manual availability blocksGET /api/public/availability- Get public availability information (no auth required)POST /api/availability/staff- Set staff availability
Customers
GET /api/customers- Search customer by email or phonePOST /api/customers- Register new customer
Bookings (Public)
POST /api/bookings- Create new booking (supports customer_id or customer info)GET /api/bookings/[id]- Get booking detailsPATCH /api/bookings/[id]- Update booking (partial update)PUT /api/bookings/[id]- Update booking (full replacement)
Staff/Admin APIs (Aperture)
Dashboard
GET /api/aperture/dashboard- Dashboard dataGET /api/aperture/stats- Statistics
Staff Management
GET /api/aperture/staff- List staff membersPOST /api/aperture/staff- Create/Update staff
Resources
GET /api/aperture/resources- List resourcesPOST /api/aperture/resources- Manage resources
Reports
GET /api/aperture/reports/sales- Sales reportsGET /api/aperture/reports/payments- Payment reportsGET /api/aperture/reports/payroll- Payroll reports
Permissions
GET /api/aperture/permissions- Get role permissionsPOST /api/aperture/permissions- Update permissions
Kiosk APIs
POST /api/kiosk/authenticate- Authenticate kioskGET /api/kiosk/resources/available- Get available resources for kioskPOST /api/kiosk/bookings- Create walk-in bookingPOST /api/kiosk/walkin- Create walk-in booking without reservationPUT /api/kiosk/bookings/[shortId]/confirm- Confirm booking
Payment APIs
POST /api/create-payment-intent- Create Stripe payment intent
Admin APIs
GET /api/admin/locations- List locations (Admin key required)POST /api/admin/users- Create staff/userPOST /api/admin/kiosks- Create kiosk
Data Models
User Roles
customer- End customersstaff- Salon staffartist- Service providersmanager- Location managersadmin- System administratorskiosk- Kiosk devices
Key Tables
locations- Salon locations with business hours (JSONB)staff- Staff membersservices- Available services with categoryresources- Physical resources (stations)customers- Customer profilesbookings- Service bookingskiosks- Kiosk devicesaudit_logs- System audit trail
Business Hours Structure
Locations table includes business_hours JSONB column with format:
{
"monday": {"open": "10:00", "close": "19:00", "is_closed": false},
"tuesday": {"open": "10:00", "close": "19:00", "is_closed": false},
"wednesday": {"open": "10:00", "close": "19:00", "is_closed": false},
"thursday": {"open": "10:00", "close": "19:00", "is_closed": false},
"friday": {"open": "10:00", "close": "19:00", "is_closed": false},
"saturday": {"open": "10:00", "close": "18:00", "is_closed": false},
"sunday": {"is_closed": true}
}
Default business hours (updated via migration):
- Monday-Friday: 10:00 AM - 7:00 PM
- Saturday: 10:00 AM - 6:00 PM
- Sunday: Closed
Environment Variables
Required
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYSTRIPE_SECRET_KEY
Optional
ADMIN_ENROLLMENT_KEY- For staff enrollmentGOOGLE_SERVICE_ACCOUNT_KEY- For Calendar sync
Deployment
Prerequisites
- Node.js 18+
- Supabase account
- Stripe account
- Google Cloud (for Calendar)
Setup Steps
- Clone repository
- Install dependencies:
npm install - Configure environment variables
- Run database migrations:
npm run db:migrate - Seed data:
npm run db:seed - Build:
npm run build - Start:
npm start
Features
Core Functionality
- Multi-location salon management
- Real-time availability system with business hours
- Customer registration and lookup by email/phone
- Location-specific opening/closing times
- Automated payment processing (currently mock)
- Staff scheduling and payroll
- Customer relationship management
- Kiosk system for walk-ins
Booking Flow
- Customer selects service and location
- Customer chooses date and time slot
- Customer searches by email or phone:
- If found: Pre-fill data and proceed
- If not found: Redirect to registration
- Customer completes registration if needed
- Customer confirms personal details
- Customer pays deposit (mock currently)
- Booking confirmed with email confirmation
Advanced Features
- Role-based access control
- Audit logging
- Automated no-show handling
- Commission-based payroll
- Sales analytics and reporting
- Permission management
Security
- Row Level Security (RLS) in Supabase
- API key authentication for kiosks
- Magic link authentication for customers
- Encrypted payment processing
Support
For API issues or feature requests, please check the TASKS.md for current priorities or create an issue in the repository.