|
| 1 | +# Capture Lite - GitHub Copilot Instructions |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +This is the **capture-lite** repository - an Angular/Ionic mobile application that serves as the Capture Cam mobile app for creator-focused content monetization. It's a cross-platform mobile app (iOS and Android) built with Angular 14, Ionic 6, and Capacitor 7. |
| 6 | + |
| 7 | +The app enables users to capture media with provenance tracking, connect to blockchain networks for content verification, and manage digital assets with built-in cryptocurrency wallet functionality. |
| 8 | + |
| 9 | +## Technology Stack |
| 10 | + |
| 11 | +- **Frontend Framework**: Angular 14 with TypeScript |
| 12 | +- **Mobile Framework**: Ionic 6 with Capacitor 7 |
| 13 | +- **State Management**: NgRx Store |
| 14 | +- **UI Components**: Angular Material + Ionic components |
| 15 | +- **Internationalization**: Transloco |
| 16 | +- **Testing**: Karma/Jasmine (unit tests) |
| 17 | +- **Build System**: Angular CLI with Ionic CLI |
| 18 | +- **Package Manager**: NPM with `--legacy-peer-deps` flag required |
| 19 | + |
| 20 | +## Project Structure |
| 21 | + |
| 22 | +### Core Directories |
| 23 | + |
| 24 | +- `src/app/features/`: Feature modules (lazy-loaded) - home, login, settings, wallets, contacts, activities |
| 25 | +- `src/app/shared/`: Shared services, components, and utilities |
| 26 | +- `src/assets/`: Static assets including fonts, i18n files, and images |
| 27 | +- `src/environments/`: Environment-specific configurations |
| 28 | +- `android/`: Android platform files (Capacitor) |
| 29 | +- `ios/`: iOS platform files (Capacitor) |
| 30 | + |
| 31 | +### Key Services Architecture |
| 32 | + |
| 33 | +- `shared/dia-backend/`: Backend API integration services |
| 34 | +- `shared/capture/`: Core media capture and proof generation |
| 35 | +- `shared/collector/`: Metadata collection with facts and signature providers |
| 36 | +- `shared/database/`: Local storage abstraction using Capacitor filesystem |
| 37 | +- `shared/camera/`: Capacitor camera integration |
| 38 | +- `shared/media/`: Media display and storage management |
| 39 | + |
| 40 | +## Development Commands |
| 41 | + |
| 42 | +### Setup and Development |
| 43 | + |
| 44 | +```bash |
| 45 | +npm install --legacy-peer-deps # Required for dependency compatibility |
| 46 | +npm run serve # Start development server |
| 47 | +npm run serve.prod # Start dev server with production config |
| 48 | +``` |
| 49 | + |
| 50 | +### Building |
| 51 | + |
| 52 | +```bash |
| 53 | +npm run build # Build for production |
| 54 | +npm run build.android # Build and sync for Android |
| 55 | +npm run build.ios # Build and sync for iOS |
| 56 | +``` |
| 57 | + |
| 58 | +### Testing and Quality |
| 59 | + |
| 60 | +```bash |
| 61 | +npm run test # Run unit tests |
| 62 | +npm run test.ci # Run tests in headless CI mode |
| 63 | +npm run lint # Run linting (required before commit) |
| 64 | +``` |
| 65 | + |
| 66 | +### Platform Commands |
| 67 | + |
| 68 | +```bash |
| 69 | +npx cap sync android # Sync web assets to Android |
| 70 | +npx cap sync ios # Sync web assets to iOS |
| 71 | +npx cap open android # Open in Android Studio |
| 72 | +npx cap open ios # Open in Xcode |
| 73 | +``` |
| 74 | + |
| 75 | +## Development Guidelines |
| 76 | + |
| 77 | +### Code Quality Standards |
| 78 | + |
| 79 | +- Always run `npm run lint` before committing |
| 80 | +- Use Prettier for code formatting (configured with pre-commit hooks) |
| 81 | +- Follow Angular style guide and conventions |
| 82 | +- Maintain comprehensive test coverage with Karma/Jasmine |
| 83 | +- Use Visual Studio Code with Prettier extension enabled |
| 84 | + |
| 85 | +### TypeScript Patterns |
| 86 | + |
| 87 | +- Prefer `Promise` over `Observable` for single-value emissions |
| 88 | +- Avoid `toPromise()` - use `firstValueFrom()` instead |
| 89 | +- Use strict TypeScript configuration |
| 90 | +- Implement proper type safety throughout |
| 91 | + |
| 92 | +### Architecture Patterns |
| 93 | + |
| 94 | +- **Feature Modules**: Organize code by features with lazy loading |
| 95 | +- **Repository Pattern**: Use for data access abstraction |
| 96 | +- **Provider Pattern**: Implement pluggable components (FactsProvider, SignatureProvider) |
| 97 | +- **Service Layer**: Centralize business logic in services |
| 98 | +- **Component Architecture**: Feature-based modules with shared components |
| 99 | + |
| 100 | +### Mobile Development Considerations |
| 101 | + |
| 102 | +- Use Capacitor plugins for native device APIs |
| 103 | +- Handle platform-specific behavior (especially Android) |
| 104 | +- Implement offline support with local database sync |
| 105 | +- Optimize performance with lazy loading and asset optimization |
| 106 | +- Follow mobile-first responsive design principles |
| 107 | + |
| 108 | +## Configuration Files |
| 109 | + |
| 110 | +- `capacitor.config.json`: Native app configuration and plugin settings |
| 111 | +- `ionic.config.json`: Ionic CLI configuration |
| 112 | +- `angular.json`: Angular build and test configurations |
| 113 | +- `package.json`: Dependencies and scripts |
| 114 | +- Environment files in `src/environments/` |
| 115 | + |
| 116 | +## Testing Strategy |
| 117 | + |
| 118 | +- Unit tests with Karma + Jasmine + ChromeHeadless |
| 119 | +- Mock services available in `shared/capacitor-plugins/` |
| 120 | +- Separate testing modules for shared functionality |
| 121 | +- CI/CD integration with GitHub Actions |
| 122 | + |
| 123 | +## Deployment Notes |
| 124 | + |
| 125 | +- Local development has limited functionality due to missing environment configs |
| 126 | +- Use GitHub Actions for full testing (Android APK Build, Firebase Release) |
| 127 | +- Development workflow: Local changes → GitHub Actions deployment → Device testing |
| 128 | +- Production releases managed through Play Store (alpha) and TestFlight |
| 129 | + |
| 130 | +## Common Issues |
| 131 | + |
| 132 | +- Always use `npm install --legacy-peer-deps` for dependency installation |
| 133 | +- Environment-specific configurations may cause local limitations |
| 134 | +- Performance considerations due to raw file system usage for proofs |
| 135 | +- Platform-specific setup required for Android Studio path on Linux |
| 136 | + |
| 137 | +## Key Dependencies |
| 138 | + |
| 139 | +- Angular 14, Ionic 6, Capacitor 7 |
| 140 | +- NgRx for state management |
| 141 | +- Angular Material for UI components |
| 142 | +- Transloco for internationalization |
| 143 | +- Various Capacitor plugins for native functionality |
0 commit comments