Skip to content

Commit f2d431e

Browse files
authored
Merge pull request #3343 from numbersprotocol/docs-improve-development-documentation
docs: improve development documentation - Add CLAUDE.md with comprehensive development guide for AI assistants - Add DEPLOYMENT.md with detailed deployment workflow documentation - Add .github/copilot-instructions.md for GitHub Copilot guidance - Update README.md with improved setup instructions and realistic development flow - Modernize GitHub Actions workflows: - Replace tag-based triggers with workflow_dispatch for better UX - Add platform selection options for firebase-release (Android/iOS) - Remove deprecated Slack notifications from build and pre-release workflows - Streamline build-apks.yml with manual trigger support - Update Android build configuration for improved compatibility
2 parents e67063a + f32bbc3 commit f2d431e

File tree

10 files changed

+658
-121
lines changed

10 files changed

+658
-121
lines changed

.github/copilot-instructions.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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

.github/workflows/build-apks.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Build APKs
22

33
on:
4-
push:
5-
tags:
6-
- 'android-*'
4+
workflow_dispatch:
5+
inputs:
6+
description:
7+
description: 'Build description (optional)'
8+
required: false
9+
type: string
710

811
jobs:
912
build-apks-upload-google-drive:

.github/workflows/build.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -117,33 +117,3 @@ jobs:
117117
sed -i '' "s/\$(GOOGLE_IOS_URL_SCHEME)/${GOOGLE_IOS_URL_SCHEME}/g" ios/App/App/info.plist
118118
npx cap sync ios
119119
xcodebuild archive -workspace ios/App/App.xcworkspace -scheme App -sdk iphoneos -configuration Debug -archivePath build/App.xcarchive -showBuildTimingSummary -allowProvisioningUpdates archive
120-
121-
notification-success:
122-
runs-on: ubuntu-latest
123-
if: github.actor != 'dependabot[bot]'
124-
needs: [android, ios]
125-
126-
steps:
127-
- uses: actions/checkout@v4
128-
129-
- name: Slack Notification
130-
uses: rtCamp/action-slack-notify@v2
131-
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'}}
132-
env:
133-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
134-
SLACK_COLOR: 'success'
135-
136-
notification-failure:
137-
runs-on: ubuntu-latest
138-
needs: [android, ios]
139-
if: ${{ failure() && github.actor != 'dependabot[bot]'}}
140-
141-
steps:
142-
- uses: actions/checkout@v4
143-
144-
- name: Slack Notification
145-
uses: rtCamp/action-slack-notify@v2
146-
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'}}
147-
env:
148-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
149-
SLACK_COLOR: 'failure'

.github/workflows/firebase-release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
name: firebase-release
22

33
on:
4-
push:
5-
tags:
6-
- 'firebase-*'
4+
workflow_dispatch:
5+
inputs:
6+
android:
7+
description: 'Build Android'
8+
required: false
9+
default: true
10+
type: boolean
11+
ios:
12+
description: 'Build iOS'
13+
required: false
14+
default: true
15+
type: boolean
16+
description:
17+
description: 'Build description (optional)'
18+
required: false
19+
type: string
720

821
jobs:
922
distribute-android:
1023
runs-on: ubuntu-latest
1124
timeout-minutes: 120
25+
if: ${{ inputs.android }}
1226

1327
steps:
1428
- uses: actions/checkout@v4
@@ -73,6 +87,7 @@ jobs:
7387
distribute-ios:
7488
runs-on: macos-15
7589
timeout-minutes: 120
90+
if: ${{ inputs.ios }}
7691

7792
steps:
7893
- uses: actions/checkout@v4

.github/workflows/pre-release.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -313,31 +313,3 @@ jobs:
313313
with:
314314
body: Thanks for following along! For more information check out the [CHANGELOG](https://github.com/numbersprotocol/capture-lite/blob/main/CHANGELOG.md).
315315
prerelease: true
316-
317-
- name: Send Slack notification
318-
uses: rtCamp/action-slack-notify@master
319-
env:
320-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
321-
SLACK_CHANNEL: reminder-releases
322-
SLACK_COLOR: '#6EE4D3'
323-
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
324-
SLACK_MESSAGE: |
325-
Version: ${{ steps.version_check.outputs.version }}
326-
<https://github.com/numbersprotocol/capture-lite/releases/tag/${{ steps.version_check.outputs.version }}|GitHub Release Note>
327-
328-
APKs
329-
330-
- <https://drive.google.com/drive/folders/1NH-4mruBBubxHMfXF6VXaKRCQ76Ldg_n?usp=sharing|Google Drive>
331-
- <https://play.google.com/apps/testing/io.numbersprotocol.capturelite|Google Play Closed Alpha Testing (release)>
332-
333-
iOS Testflight
334-
335-
Build: ${{ env.ios_build_number }}
336-
A push notification will be sent to the device with TestFlight installed when the build is ready.
337-
338-
Notes
339-
340-
- Publishing process usually requires some time to complete, and thus the link provided above might still display the old version of the app. Please check the app version before download and install the app.
341-
- This message is automatically sent from GitHub Action.
342-
SLACK_TITLE: Capture Lite QA Release
343-
SLACK_USERNAME: GitHub Action

0 commit comments

Comments
 (0)