Getting Started & Setup
Relevant source files
The following files were used as context for generating this wiki page:
DRX is a modern, privacy-first Point of Sale (POS), CRM, and inventory management system designed for small businesses and regulated retail environments. The system utilizes a local-first data approach, ensuring that business operations can continue offline while automatically syncing with the cloud when internet connectivity is available.
The setup process involves configuring a business profile, establishing privacy presets, and initializing inventory and staff roles. This ensures data isolation between tenants and sets the foundation for secure, role-based access control (RBAC).
Sources: README.md:3-8, scripts/help-center-data.ts:16-25
Development Environment Setup
To begin development on the DRX platform, developers must fulfill specific software prerequisites and configure local environment variables. The project uses pnpm for package management and Supabase for backend services.
Prerequisites and Installation
The system requires Node.js 20+, pnpm 8+, and the Supabase CLI.
- Clone and Install:
git clone <repository-url> cd drx-v2 pnpm install - Environment Configuration:
Copy the.env.exampleto.env.localand populate the required Supabase keys. - Database Initialization:
Start the local Supabase environment and apply migrations to set up the PostgreSQL schema.npx supabase start npx supabase db reset
Sources: README.md:65-98, deploy-inventory-intake.sh:31-35
Environment Variables
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | The API URL for the Supabase instance. |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Anonymous key for client-side Supabase interactions. |
SUPABASE_SERVICE_ROLE_KEY | Service role key for administrative/server-side bypass of RLS. |
FEATUREBASE_API_KEY | Used for syncing Help Center articles to Featurebase. |
Sources: README.md:92-96, scripts/sync-help-center.ts:10-11
Initial Business Configuration
Once the environment is running, the "Owner" role must perform a core setup checklist to prepare the system for transactions.
Setup Checklist
- Business Profile: Enter the business name, address, and logo (under 2MB).
- Privacy Presets: Select a data retention and visibility policy (Standard, Private, or Max Secure).
- Units and Taxes: Configure unit measurements (e.g., grams vs. count) and local tax rates.
- Staff Accounts: Create staff logins and assign roles (Manager, Staff).
- Inventory Initialization: Add initial product catalog.
Sources: scripts/help-center-data.ts:44-53, app/(app)/help/page.tsx:47-52
Privacy Presets
DRX provides four distinct privacy levels that dictate how much data is retained and who can see it.
| Preset | Description |
|---|---|
| Open | Maximum convenience; most data visible to all staff. |
| Balanced | Hides sensitive fields from Staff roles. |
| Private | Minimal data retention and restricted visibility. |
| Max Secure | Aggressive masking and automatic deletion triggers. |
Sources: scripts/help-center-data.ts:517-526, scripts/help-center-data.ts:404-411
System Architecture and Data Flow
DRX is built on a full-stack TypeScript architecture utilizing Next.js 16 and Supabase. It implements Row Level Security (RLS) to ensure multi-tenant data isolation.
Core Data Flow
The following diagram illustrates the flow from a user request through the application layers to the database.
The system ensures that a user in one tenant cannot access data from another tenant via strict business_id checks and RLS policies.
Sources: README.md:164-170, CHANGELOG.md:41-48, scripts/help-center-data.ts:117-119
Versioning and Release Process
The project adheres to the Wrelik Brands Versioning Protocol, where a VERSION file at the repository root serves as the single source of truth.
Version Management Logic
A helper script (scripts/version.ts) automates the versioning process by analyzing the CHANGELOG.md [Unreleased] section.
Summary
Getting started with DRX requires a specific sequence of environment preparation and business configuration. By following the standardized installation steps and completing the owner's setup checklist—including critical privacy and role definitions—users can leverage the platform's local-first architecture for secure and efficient retail operations.
Sources: app/(app)/help/page.tsx:38-42, scripts/help-center-data.ts:23-32