A modern React Native mobile application for scanning and validating QR code tickets using Expo and Supabase.
- QR Code Scanning: Scan QR codes using device camera
- Manual Code Entry: Enter ticket codes manually for validation
- Real-time Validation: Check ticket validity against Supabase database
- Analytics Dashboard: View scanning statistics and insights
- Multi-language Support: Internationalization (i18n) support
- Dark/Light Theme: Adaptive theming system
- Cross-platform: Works on iOS, Android, and Web
- Framework: Expo with React Native
- Language: TypeScript
- Backend: Supabase (PostgreSQL + Real-time)
- Navigation: Expo Router
- Camera: Expo Camera for QR code scanning
- Node.js (v18 or higher)
- npm or yarn
- Expo CLI
- Supabase Account (for backend)
-
Clone and install
git clone https://github.com/Stefan98167/TicketScanner.git cd TicketScanner npm install -
Set up environment variables
Create a
.envfile in the root directory:EXPO_PUBLIC_SUPABASE_URL=your_supabase_project_url EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
Note: A
.envfile with test credentials has been created for development purposes. -
Set up Supabase Database
Create the following tables in your Supabase database:
-- Tickets table for storing ticket information CREATE TABLE tickets ( id TEXT PRIMARY KEY, devalued BOOLEAN DEFAULT FALSE, scanned_at TIMESTAMP WITH TIME ZONE, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Scan logs table for analytics and audit trail CREATE TABLE scan_logs ( id BIGSERIAL PRIMARY KEY, device_id TEXT NOT NULL, action TEXT NOT NULL CHECK (action IN ('check', 'devalue')), ticket_code TEXT NOT NULL, is_valid BOOLEAN, was_devalued BOOLEAN, success BOOLEAN NOT NULL, message TEXT, meta JSONB, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Devices table for tracking scanning devices CREATE TABLE devices ( id TEXT PRIMARY KEY, name TEXT, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() );
-
Start the development server
npx expo start
- iOS Simulator: Press
iin the terminal - Android Emulator: Press
ain the terminal - Web: Press
win the terminal - Physical Device: Scan the QR code with Expo Go
- Never commit
.envfiles to version control - Use environment variables for sensitive configuration
- The app uses
EXPO_PUBLIC_prefix for client-side environment variables
For enhanced security when contributing, consider using GitHub Codespaces to securely manage API keys.
- Enable Row Level Security (RLS) in Supabase
- Implement proper database policies
- Use prepared statements for all queries
We welcome contributions! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Remove console.log statements in production
If you find a bug, please create an issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Device/OS information
This project is licensed under the MIT License - see the LICENSE file for details.
If you need help:
- Create an issue on GitHub
- Check the Expo documentation
- Review the Supabase documentation
Note: This is an open-source project. Please ensure you follow security best practices when deploying to production environments.