You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 week ago | |
---|---|---|
.. | ||
src | 1 week ago | |
.eslintrc.cjs | 1 week ago | |
.gitignore | 1 month ago | |
GRADLE_TROUBLESHOOTING.md | 1 month ago | |
README.md | 1 week ago | |
capacitor.config.ts | 1 week ago | |
env.d.ts | 1 week ago | |
index.html | 1 week ago | |
package-lock.json | 1 month ago | |
package.json | 1 week ago | |
tsconfig.json | 1 week ago | |
vite.config.ts | 1 week ago | |
webpack.config.js | 1 month ago |
README.md
Daily Notification Test App - Vue 3
A modern Vue 3 + Vite + Capacitor test application for the Daily Notification Plugin, built with vue-facing-decorator for TypeScript class-based components.
๐ Features
- Vue 3 with Composition API and TypeScript
- Vite for fast development and building
- vue-facing-decorator for class-based components
- Pinia for state management
- Vue Router for navigation
- Capacitor for native Android functionality
- Modern UI with glassmorphism design
- Responsive design for mobile and desktop
๐ฑ App Structure
src/
โโโ components/ # Reusable Vue components
โ โโโ cards/ # Card components (ActionCard, StatusCard, etc.)
โ โโโ items/ # List item components
โ โโโ layout/ # Layout components (Header, Footer)
โ โโโ ui/ # UI components (Loading, Error, etc.)
โโโ stores/ # Pinia stores
โ โโโ app.ts # Global app state
โ โโโ notifications.ts # Notification management
โโโ views/ # Page components
โ โโโ HomeView.vue # Dashboard
โ โโโ ScheduleView.vue # Schedule notifications
โ โโโ NotificationsView.vue # Manage notifications
โ โโโ StatusView.vue # System status
โ โโโ HistoryView.vue # Notification history
โ โโโ SettingsView.vue # App settings
โโโ router/ # Vue Router configuration
โโโ types/ # TypeScript type definitions
โโโ utils/ # Utility functions
๐ ๏ธ Development
Prerequisites
- Node.js 18+
- npm or yarn
- Android Studio (for Android development)
- Capacitor CLI
Installation
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Type checking
npm run type-check
# Linting
npm run lint
Android Development
# Sync with Capacitor
npm run sync
# Open Android Studio
npm run open
# Run on Android device/emulator
npm run android
๐จ UI Components
Class-Based Components
All components use vue-facing-decorator for TypeScript class-based syntax:
@Component({
components: {
ChildComponent
}
})
export default class MyComponent extends Vue {
@Prop() title!: string
private data = ref('')
get computedValue(): string {
return this.data.value.toUpperCase()
}
private handleClick(): void {
// Handle click
}
}
State Management
Uses Pinia stores for reactive state management:
// stores/notifications.ts
export const useNotificationsStore = defineStore('notifications', () => {
const scheduledNotifications = ref<ScheduledNotification[]>([])
async function scheduleNotification(options: ScheduleOptions): Promise<void> {
// Schedule logic
}
return {
scheduledNotifications,
scheduleNotification
}
})
๐ Features
Dashboard (Home)
- Quick action cards
- System status overview
- Next scheduled notification
- Recent activity feed
Schedule Notifications
- Time picker
- Title and message inputs
- Sound and priority options
- URL support for deep linking
- Quick schedule presets
Notification Management
- View all scheduled notifications
- Cancel notifications
- Status indicators
System Status
- Permission checks
- Channel status
- Exact alarm settings
- Platform information
- Test notification functionality
History
- Delivered notification history
- Click and dismiss tracking
- Time-based filtering
๐ง Configuration
Capacitor Config
// capacitor.config.ts
const config: CapacitorConfig = {
appId: 'com.timesafari.dailynotification.androidtest',
appName: 'Daily Notification Test - Vue 3',
webDir: 'dist',
plugins: {
DailyNotification: {
storage: 'shared',
ttlSeconds: 1800,
prefetchLeadMinutes: 15,
enableETagSupport: true,
enableErrorHandling: true,
enablePerformanceOptimization: true
}
}
}
Vite Config
// vite.config.ts
export default defineConfig({
plugins: [vue()],
build: {
outDir: 'dist',
sourcemap: true
},
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
}
})
๐ฏ Testing the Plugin
-
Start Development Server
npm run dev
-
Build and Sync
npm run build npm run sync
-
Run on Android
npm run android
-
Test Features
- Schedule notifications
- Check system status
- View notification history
- Test clickable notifications
๐ฑ Native Features
- Notification Scheduling - Schedule daily notifications
- Permission Management - Check and request permissions
- Status Monitoring - Real-time system status
- Deep Linking - URL support in notifications
- Background Processing - WorkManager integration
๐จ Design System
Colors
- Primary: Linear gradient (purple to blue)
- Success: #4caf50
- Warning: #ff9800
- Error: #f44336
- Info: #2196f3
Typography
- Headers: Bold, white with text-shadow
- Body: Regular, rgba white
- Code: Courier New monospace
Components
- Glassmorphism design with backdrop-filter
- Rounded corners (8px, 12px, 16px)
- Smooth transitions and hover effects
- Responsive grid layouts
๐ Production Build
# Build for production
npm run build
# Preview production build
npm run preview
# Sync with Capacitor
npm run sync
# Build Android APK
npm run android
๐ Scripts
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run android
- Run on Androidnpm run sync
- Sync with Capacitornpm run open
- Open Android Studionpm run lint
- Run ESLintnpm run type-check
- TypeScript type checking
๐ Debugging
Vue DevTools
Install Vue DevTools browser extension for component inspection.
Capacitor Logs
# Android logs
adb logcat | grep -i "daily\|notification"
# Capacitor logs
npx cap run android --livereload --external
TypeScript
Enable strict mode in tsconfig.json
for better type checking.
๐ Dependencies
Core
- Vue 3.4+
- Vite 5.0+
- TypeScript 5.3+
- Capacitor 5.0+
UI & State
- vue-facing-decorator 3.0+
- Pinia 2.1+
- Vue Router 4.2+
Development
- ESLint + TypeScript configs
- Vue TSC for type checking
- Modern module resolution
๐ค Contributing
- Follow Vue 3 + TypeScript best practices
- Use vue-facing-decorator for class components
- Maintain responsive design
- Add proper TypeScript types
- Test on both web and Android
๐ License
MIT License - see LICENSE file for details.
Built with โค๏ธ using Vue 3 + Vite + Capacitor