A comprehensive artwork management system built with Electron, React, and TypeScript, featuring NFC tag integration for artwork tracking and authentication.
Patunay Admin is a desktop application designed for art galleries, museums, and collectors to manage artwork collections, track provenance, and utilize NFC technology for artwork authentication and information access.
- Complete artwork registration with detailed metadata
- Image upload and management
- Artwork editing and deletion
- Advanced search and filtering capabilities
- Detailed artwork views with full history
- NFC tag reading and writing capabilities
- Attach/detach NFC tags to artworks
- Real-time NFC status monitoring
- NFC tag management dashboard
- Create and manage artwork appraisals
- Track appraisal history
- Multiple appraiser support
- Appraisal data visualization
- Multi-tenant role-based access control (RBAC)
- 6 user roles: super_user, admin, issuer, appraiser, staff, viewer
- Organization and location-based access control
- Cross-organizational permissions
- User authentication via Supabase
- Profile management with avatar support
- Multi-organization support
- Location/branch management
- Organization-specific settings
- Member management and invitations
- Real-time statistics and metrics
- Organization and location-based analytics
- Activity feed
- System health monitoring
- Data visualization with charts
- Export capabilities
- React 19 with TypeScript
- Vite for development and building
- Redux Toolkit for state management
- RTK Query for API data fetching
- Tailwind CSS + DaisyUI for styling
- React Router for navigation
- Electron for cross-platform desktop app
- NFC-PCSC for NFC tag communication
- electron-updater for auto-updates
- Supabase for authentication and database
- PostgreSQL with Row Level Security (RLS)
- Real-time subscriptions
- File storage for artwork images
src/
βββ electron/ # Electron main process
β βββ main.ts # Application entry point
β βββ nfc/ # NFC service integration
β βββ logging/ # Electron logging
βββ ui/ # React frontend
β βββ components/ # Reusable UI components
β βββ pages/ # Application pages
β βββ store/ # Redux store and API
β βββ hooks/ # Custom React hooks
β βββ supabase/ # Database operations
βββ shared/ # Shared code between processes
- Node.js 18+ and npm
- NFC reader hardware (for NFC functionality)
- Supabase project with proper configuration
- Clone the repository
git clone <repository-url>
cd patunay-admin
- Install dependencies
npm install
- Set up environment variables
cp .env.example .env.development
# Edit .env.development with your Supabase credentials
- Start development server
npm run dev
This will start both the React dev server (port 5173) and Electron application.
npm run dev
- Start both React and Electron in development modenpm run dev:react
- Start only React dev servernpm run dev:electron
- Start only Electron (requires transpiled code)npm run dev:devtools
- Start with DevTools explicitly enabled
npm run build
- Full production buildnpm run build:react
- Build React frontend onlynpm run build:electron
- Build Electron app onlynpm run build:validate
- Run validation before building
npm run dist:mac
- Package for macOS ARM64npm run dist:win
- Package for Windows x64npm run dist:linux
- Package for Linux x64
npm run test
- Run tests in watch modenpm run test:run
- Run tests oncenpm run test:coverage
- Generate coverage reportnpm run test:e2e
- Run E2E tests with Playwright
npm run lint
- Run ESLintnpm run lint:fix
- Fix linting issuesnpm run format
- Format with Prettiernpm run type-check
- TypeScript type checkingnpm run validate
- Run all checksnpm run clean
- Remove build artifacts
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
NODE_ENV=development|production
DISABLE_DEVTOOLS=true # Disable DevTools in development
ENABLE_DEVTOOLS=true # Force enable DevTools
- Main Process: Handles system integration, NFC communication, and application lifecycle
- Renderer Process: React-based UI with full artwork management capabilities
- Redux Toolkit for predictable state management
- RTK Query for efficient data fetching and caching
- Component composition with reusable UI components
- Hook-based architecture for logic reuse
- RPC pattern for Supabase database operations
- Read existing NFC tags to identify artworks
- Write artwork IDs to blank NFC tags
- Monitor NFC reader status and connectivity
- Support for various NFC tag types
- Basic artwork information entry
- Image upload and management
- Size and technical specifications
- Bibliography and provenance
- Collector information
- NFC tag attachment
- Final review and submission
- Row Level Security (RLS) in Supabase
- Role-based access control
- Organization-scoped data access
- Secure file upload handling
- Data sanitization and validation
- Follow the existing code style and patterns
- Use TypeScript for all new code
- Add appropriate tests for new features
- Update documentation as needed
- Follow the logging best practices outlined in
docs/LOGGING_BEST_PRACTICES.md
- CLAUDE.md - Development guide for Claude Code
- Build Process
- Logging Best Practices
- Multi-Tenant RBAC Implementation
- Locations Feature
- Edge Function Setup
- RBAC Test Scenarios
- Security Review
-
NFC Reader Not Detected
- Ensure NFC reader is properly connected
- Check system permissions for USB devices
- Restart the application
-
Login Issues
- Verify Supabase credentials
- Check network connectivity
- Clear local storage and try again
-
Build Failures
- Run
npm run clean
and rebuild - Ensure all dependencies are installed
- Check Node.js version compatibility
- Run
Application logs can be found in:
- macOS:
~/Library/Logs/patunay-app/
- Windows:
%USERPROFILE%\AppData\Roaming\patunay-app\logs\
- Linux:
~/.config/patunay-app/logs/
See license.md for licensing information.