Skip to content

SH1W4/kronos-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

440 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

KAIRร˜S OS

KAIRร˜S OS

Enterprise-Grade Tattoo Studio Management Platform
Built with Next.js 15, Prisma, Clerk, and cutting-edge UX design.


๐ŸŽฏ Vision

KAIRร˜S OS (formerly KAIRร˜S OS) is a professional-first SaaS platform designed exclusively for tattoo studios, artists, and administrators. Unlike traditional booking systems, we've architected a sovereign ecosystem where:

  • Professionals (Artists & Admins) have full access to the management dashboard
  • Clients interact through frictionless, guest-first experiences (Kiosk, Marketplace, Forms)
  • Data sovereignty ensures each studio owns its client base without polluting the global user registry

๐Ÿ—๏ธ Architecture Philosophy

The Professional Gate

KAIRร˜S implements a strict invite-only authentication system for professional access:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    AUTHENTICATION FLOW                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                              โ”‚
โ”‚  ๐Ÿ‘ค New User Attempts Login                                 โ”‚
โ”‚         โ”‚                                                    โ”‚
โ”‚         โ”œโ”€โ–บ Has Invite Code? โ”€โ”€โ–บ YES โ”€โ”€โ–บ Create as ARTIST   โ”‚
โ”‚         โ”‚                                                    โ”‚
โ”‚         โ””โ”€โ–บ No Invite Code? โ”€โ”€โ–บ REJECT โ”€โ”€โ–บ Error Message    โ”‚
โ”‚                                                              โ”‚
โ”‚  ๐ŸŽจ Existing Artist/Admin โ”€โ”€โ–บ Direct Access โ”€โ”€โ–บ Dashboard   โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Benefits:

  • โœ… Zero spam or unauthorized access
  • โœ… Clean, focused user base (only team members)
  • โœ… Traceable onboarding (who invited whom)
  • โœ… Automatic role assignment based on invite type

Client Flow: Guest-First Experience

Clients never need to create an account to interact with the studio:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      CLIENT JOURNEY                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                              โ”‚
โ”‚  ๐Ÿ“ฑ Kiosk Check-In                                          โ”‚
โ”‚     โ””โ”€โ–บ Fill form (Name, Phone, Instagram)                  โ”‚
โ”‚     โ””โ”€โ–บ Select barrier (Price, Pain, Style)                 โ”‚
โ”‚     โ””โ”€โ–บ Enter Artist PIN                                    โ”‚
โ”‚     โ””โ”€โ–บ Receive 10% OFF Coupon                              โ”‚
โ”‚     โ””โ”€โ–บ Saved as KioskEntry (Studio's DB)                   โ”‚
โ”‚                                                              โ”‚
โ”‚  ๐Ÿ›๏ธ Marketplace Shopping                                    โ”‚
โ”‚     โ””โ”€โ–บ Browse products                                     โ”‚
โ”‚     โ””โ”€โ–บ Add to cart                                         โ”‚
โ”‚     โ””โ”€โ–บ Checkout (Guest or Logged)                          โ”‚
โ”‚     โ””โ”€โ–บ Order saved to Studio's DB                          โ”‚
โ”‚                                                              โ”‚
โ”‚  ๐Ÿ“‹ Anamnesis Form                                          โ”‚
โ”‚     โ””โ”€โ–บ Fill medical/tattoo questionnaire                   โ”‚
โ”‚     โ””โ”€โ–บ Linked to booking via QR code                       โ”‚
โ”‚     โ””โ”€โ–บ Stored in Booking context                           โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Storage Strategy:

  • KioskEntry โ†’ Lead generation, first-time visitors
  • Booking.client โ†’ Confirmed appointments
  • Order.client โ†’ Marketplace purchases
  • Anamnesis โ†’ Medical/consent forms

All client data is scoped to the workspace, ensuring studios maintain full ownership and LGPD compliance.


๐Ÿš€ Core Features

Professional Dashboard

Studio Management

Kiosk Experience

Kiosk Interface

Marketplace

Marketplace

Scheduling System

Agenda


1. Professional Dashboard

  • ๐Ÿ“Š Real-time studio metrics (revenue, bookings, settlements)
  • ๐ŸŽจ Artist portfolio management
  • ๐Ÿ“… Integrated Google Calendar sync
  • ๐Ÿ’ฐ Financial settlement tracking with AI validation
  • ๐Ÿ‘ฅ Team management with invite system
  • ๐Ÿ“ˆ Personal Earnings & Projections ("Meus Ganhos"): Complete monthly performance view comparing realized earnings against a future projection timeline (OPEN/CONFIRMED bookings).

2. Kiosk Experience

  • ๐ŸŽฏ Lead capture with gamified "INK PASS" system
  • ๐Ÿ“ฑ Public Scheduling Portal (/kiosk): Mobile-first multi-step workflow for client check-ins (contact info, slot/date selection, booking creation without logging in).
  • ๐ŸŽ Automatic coupon generation (10% off first tattoo)
  • ๐Ÿ” Artist PIN validation for fraud prevention
  • ๐Ÿ“Š Real-time sync progress visualization

3. Marketplace

  • ๐Ÿ›’ Product catalog (flash tattoos, merchandise)
  • ๐Ÿ’ณ Integrated payment processing
  • ๐Ÿ“ฆ Order management with artist commission tracking
  • ๐ŸŽจ Artist-specific product listings

4. Financial System & Mathematical Split

  • ๐Ÿ’ธ Unified Settlement Flow (tattoos + marketplace)
  • ๐Ÿ“Š Dynamic Commission Rate:
    • Resident Artists: 30% baseline commission for the studio, dynamically dropping to 20% once the artist accumulates R$ 10.000,00 in monthly earnings.
    • Guest/Associated Artists: Locked at 30% fixed commission rate, matching the initial resident rate.
  • ๐Ÿค– AI-Powered Receipt Validation (Vision Agent simulation)
  • ๐Ÿฆ PIX Integration for instant payment tracking and settlement approvals

5. Booking & Stretcher Management (Studio Capacity)

  • ๐Ÿ“… Multi-Artist Studio Timeline: Slot-based calendar layout checking workspace bounds (max capacity $\le 3$ active stretchers).
  • ๐Ÿ›๏ธ Physical Stretcher Selection (macaId 1-20): Artists can manually choose a physical stretcher when creating appointments via createBooking with synchronous conflict detection.
  • ๐Ÿ”„ Intelligent Auto-Allocation Fallback: Seamless automatic slot selection for clients, finding the first available physical stretcher sequence.
  • ๐Ÿ“‹ Integrated Anamnesis Forms linked to booking context via dynamic QR codes.

6. Guest Lifecycle & Calendar Auto-Sync

  • โฑ๏ธ Cron-Based Guest Deactivation: Vercel Cron-driven cleanup checking daily for expired contracts (plan = GUEST and validUntil < today), deactivating artist profiles, revoking membership, and sending expiration alerts.
  • ๐Ÿ”‘ Google Calendar ACL Automation: Service Account integration dynamically sharing workspace calendars with new guest artists (permisson writer) and automatically revoking sharing upon guest expiration or artist removal.

7. Gamification: Soul Sync Engine

  • ๐Ÿ… Liquid Chrome / Metallic Achievements: 3D high-fidelity metallic badges representing real milestones (FIRST_INK, HIGH_ROLLER, PERFECT_WEEK, LEGENDARY_ARTIST).
  • ๐Ÿ“ˆ RPG Progression Engine: Core square-root level progression model: $$Level = \lfloor\sqrt{XP/100}\rfloor + 1$$
  • ๐Ÿ† Dynamic Custom Ranks (e.g., Iniciado da Tinta, Tecelรฃo do Tempo, Titรฃ do Kronos) with dedicated badge designs in /public/assets/gamification/badges.

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 15 (App Router, Server Components)
  • TypeScript (Strict mode)
  • Tailwind CSS (Custom design system)
  • Framer Motion (Animations)
  • Lucide Icons (UI icons)

Backend & Authentication

  • Prisma ORM (PostgreSQL)
  • Clerk Authentication (SSO-first entry gate)
    • Anti-friction onboarding gate collecting and normalizing artist details without Brazilian carrier SMS barriers.
    • Synchronous custom auth sync to prevent phantom administrative entries.
  • Server Actions (Type-safe API)
  • Resend (Email delivery)

Testing & Quality Assurance

  • Vitest (Unit testing engine)
  • 55 automated unit tests protecting:
    • Financial splits, product markups, and coupon deduction mathematics.
    • Gamification XP scaling, level boundaries, and achievements.
    • Dynamic macaId input integrity and validations on bookingSchema (Zod).

๐Ÿงช Testing and Quality Gates

The core business logic is heavily audited and guarded by Vitest. To run the full test suite in isolation:

# Run unit tests
npx vitest run --root .

All 55 core operations will be checked, including edge-case limits, decimal divisions, and validation schemas.


๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Clerk Account (for auth)
  • Resend API key (for emails)

Setup

  1. Clone the repository

    git clone https://github.com/SH1W4/KAIRร˜S OS.git
    cd KAIRร˜S OS/kronos
  2. Install dependencies

    npm install
  3. Configure environment variables

    cp .env.example .env

    Required variables:

    DATABASE_URL="postgresql://..."
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..."
    CLERK_SECRET_KEY="sk_..."
    
    # Email (Resend)
    RESEND_API_KEY="re_..."
    RESEND_FROM_EMAIL="KAIRร˜S OS <acesso@yourdomain.com>"
  4. Initialize database

    npx prisma generate
    npx prisma db push
  5. Run development server

    npm run dev
  6. Access the application

    • App: http://localhost:3000
    • Kiosk: http://localhost:3000/kiosk

๐Ÿšง Operational Roadmap

Phase 1: Foundation & Sovereignty โ€” Done โœ…

  • Professional Gate: Invitation-only Clerk SSO onboarding bypass.
  • Kiosk Lead Capture System: Gamified "INK PASS" lead entry & coupon generator.
  • Gamification Core (Soul Sync): Square-root progression engine.
  • Liquid Chrome Achievement Assets: Metallic 3D achievements integrated.

Phase 2: Capacity & Financial Control โ€” Done โœ…

  • Studio Capacity Management: Physical stretcher allocation (macaId 1-20) and calendar booking conflict checks.
  • Dynamic Commission Split: Automated resident commission scaling (30% $\rightarrow$ 20% over R$ 10k) and guest fixed 30% rate.
  • Vitest Quality Gate: 55 automated unit tests protecting formulas.
  • AI Vision Simulation: Dynamic settlement validation OCR logic.

Phase 3: Kiosk, Guest Automation & Projections โ€” Done โœ…

  • Public Scheduling Portal: Frictionless /kiosk page with capacity and stretcher allocation validations.
  • Guest Lifecycle Automation: Automated expiration checking, profile deactivation, and workspace removal.
  • Google Calendar Auto-Sync: Automated Service Account ACL share/revoke operations.
  • Personal Future Projections: Detailed "Meus Ganhos" page with dynamic temporal selectors, earnings calculation, and timeline.

Phase 4: Integration & Payments โ€” Active ๐Ÿš€

  • Omnichannel WhatsApp CRM: Trigger automated notifications, coupons, and check-in confirmation dynamically.
  • Sovereign Wallet & Real PIX Split: Instant PIX payout integrations.
  • Extended BI Dashboard: Operational analytics, heatmaps of studio capacity, and artist rankings.

๐Ÿ“„ License

This project is proprietary software. All rights reserved.


๐Ÿ‘ฅ Team

Built by Symbeon Labs

For inquiries: Contact


๐Ÿ™ Acknowledgments

  • Design inspiration: Arrival (2016), Cyberpunk 2077
  • UI/UX: Vercel, Linear, Stripe
  • Community: Next.js, Prisma, Tailwind CSS

About

KAIROS OS: Sovereign gamification and studio sync suite for elite tattoo artists.

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors