Skip to content

Commit 850597e

Browse files
committed
feat: initialize desktop app with Electron for cross-platform support
1 parent c13b07f commit 850597e

File tree

8 files changed

+402
-7
lines changed

8 files changed

+402
-7
lines changed

README-native-apps.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# PDF Converter Native Apps
22

3-
This repository contains native iOS and Android applications that wrap the PDF Converter PWA (Progressive Web App) in a WebView. These apps provide a native experience for users while leveraging the existing web application.
3+
This repository contains native iOS, Android, and desktop applications that wrap the PDF Converter PWA (Progressive Web App) in a WebView. These apps provide a native experience for users while leveraging the existing web application.
44

55
## Project Structure
66

7-
The repository is organized into two main directories:
7+
The repository is organized into three main directories:
88

99
- `/ios`: Contains the iOS application written in Swift
1010
- `/android`: Contains the Android application written in Kotlin
11+
- `/desktop`: Contains the cross-platform desktop application built with Electron
1112

1213
Each directory has its own README with specific instructions for building and running the respective applications.
1314

@@ -33,9 +34,21 @@ The Android app uses WebView to load the PWA from the production website. It pro
3334

3435
See the [Android README](./android/README.md) for detailed instructions on building and running the Android app.
3536

37+
## Desktop App
38+
39+
The desktop app uses Electron to load the PWA from the production website. It provides a native desktop experience for Windows, macOS, and Linux users with the following features:
40+
41+
- Cross-platform support (Windows, macOS, Linux)
42+
- Native desktop integration
43+
- Custom application menu
44+
- External link handling
45+
- Offline capabilities (when the PWA supports it)
46+
47+
See the [Desktop README](./desktop/README.md) for detailed instructions on building and running the desktop app.
48+
3649
## Customization
3750

38-
Both apps can be easily customized to point to different environments (development, staging, production) by modifying the URL in the respective WebView implementation.
51+
All apps can be easily customized to point to different environments (development, staging, production) by modifying the URL in the respective WebView implementation.
3952

4053
### iOS URL Configuration
4154

@@ -59,14 +72,24 @@ In `android/PDFConverter/app/src/main/java/com/profullstack/pdfconverter/MainAct
5972
private val pwaUrl = "https://profullstack.com/pdf"
6073
```
6174

75+
### Desktop URL Configuration
76+
77+
In `desktop/src/main.js`:
78+
79+
```javascript
80+
// URL of the PWA
81+
const pwaUrl = 'https://profullstack.com/pdf';
82+
```
83+
6284
## Benefits of Native WebView Apps
6385

64-
1. **App Store Presence**: Makes the application discoverable in app stores
86+
1. **App Store/Distribution Presence**: Makes the application discoverable in app stores and software distribution platforms
6587
2. **Native Features**: Access to device capabilities not available to web apps
6688
3. **Offline Support**: Better offline capabilities through native caching
67-
4. **User Experience**: Provides a more integrated experience on mobile devices
89+
4. **User Experience**: Provides a more integrated experience on mobile and desktop devices
6890
5. **Push Notifications**: Native push notification support
69-
6. **Icon on Home Screen**: Automatic placement on the user's home screen
91+
6. **Icon on Home Screen/Desktop**: Automatic placement on the user's home screen or desktop
92+
7. **Desktop Integration**: System tray, dock, and taskbar integration for desktop apps
7093

7194
## Future Enhancements
7295

@@ -76,4 +99,6 @@ Potential future enhancements for these apps include:
7699
2. Implementing push notifications
77100
3. Adding deep linking support
78101
4. Integrating native file pickers for better file handling
79-
5. Adding biometric authentication options
102+
5. Adding biometric authentication options
103+
6. Implementing auto-updates for the desktop app
104+
7. Adding system tray/menu bar functionality for the desktop app

desktop/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Dependency directories
10+
node_modules/
11+
jspm_packages/
12+
13+
# Build output
14+
dist/
15+
out/
16+
17+
# Environment variables
18+
.env
19+
.env.local
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
24+
# OS specific files
25+
.DS_Store
26+
.DS_Store?
27+
._*
28+
.Spotlight-V100
29+
.Trashes
30+
ehthumbs.db
31+
Thumbs.db
32+
33+
# Editor directories and files
34+
.idea
35+
.vscode
36+
*.swp
37+
*.swo

desktop/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# PDF Converter Desktop App
2+
3+
A cross-platform desktop application that wraps the PDF Converter PWA in an Electron shell. This app provides a native desktop experience for Windows, macOS, and Linux users.
4+
5+
## Features
6+
7+
- Loads the PWA from https://profullstack.com/pdf
8+
- Native desktop integration
9+
- Cross-platform support (Windows, macOS, Linux)
10+
- Custom application menu
11+
- External link handling
12+
- Offline capabilities (when the PWA supports it)
13+
14+
## Development Requirements
15+
16+
- Node.js 16.x or later
17+
- npm or yarn
18+
19+
## Getting Started
20+
21+
1. Install dependencies:
22+
```
23+
cd desktop
24+
npm install
25+
```
26+
27+
2. Run the app in development mode:
28+
```
29+
npm start
30+
```
31+
32+
## Building for Production
33+
34+
### All Platforms
35+
36+
To build for all platforms (that your current OS supports):
37+
38+
```
39+
npm run build
40+
```
41+
42+
### Platform-Specific Builds
43+
44+
#### Windows
45+
46+
```
47+
npm run build:win
48+
```
49+
50+
This will generate:
51+
- NSIS installer (.exe)
52+
- Portable executable (.exe)
53+
54+
#### macOS
55+
56+
```
57+
npm run build:mac
58+
```
59+
60+
This will generate:
61+
- DMG installer (.dmg)
62+
- ZIP archive (.zip)
63+
64+
#### Linux
65+
66+
```
67+
npm run build:linux
68+
```
69+
70+
This will generate:
71+
- AppImage (.AppImage)
72+
- Debian package (.deb)
73+
- RPM package (.rpm)
74+
75+
## Customization
76+
77+
### PWA URL
78+
79+
To change the URL of the PWA, modify the `pwaUrl` variable in `src/main.js`:
80+
81+
```javascript
82+
// URL of the PWA
83+
const pwaUrl = 'https://profullstack.com/pdf';
84+
```
85+
86+
### Application Icons
87+
88+
Replace the placeholder icon files in the `assets` directory with your own icons:
89+
- `icon.png` (512x512 PNG for Linux)
90+
- `icon.ico` (Windows icon)
91+
- `icon.icns` (macOS icon)
92+
93+
## Project Structure
94+
95+
- `src/main.js`: Main process script
96+
- `src/preload.js`: Preload script for secure renderer process
97+
- `assets/`: Application icons and resources
98+
- `package.json`: Project configuration and dependencies
99+
100+
## Packaging and Distribution
101+
102+
The app is configured to be packaged using electron-builder. The configuration in `package.json` specifies the build targets for each platform.
103+
104+
## License
105+
106+
MIT

desktop/assets/icon.svg

Loading

desktop/assets/icon.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This is a placeholder for the app icon.
2+
3+
For production use, you should replace this with proper icon files:
4+
- icon.png (512x512 PNG for Linux)
5+
- icon.ico (Windows icon)
6+
- icon.icns (macOS icon)
7+
8+
You can use tools like https://convertio.co/ to convert from PNG to ICO and ICNS formats.

desktop/package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "pdf-converter-desktop",
3+
"version": "1.0.0",
4+
"description": "PDF Converter Desktop App",
5+
"main": "src/main.js",
6+
"scripts": {
7+
"start": "electron .",
8+
"build": "electron-builder",
9+
"build:win": "electron-builder --win",
10+
"build:mac": "electron-builder --mac",
11+
"build:linux": "electron-builder --linux"
12+
},
13+
"author": "ProFullStack",
14+
"license": "MIT",
15+
"devDependencies": {
16+
"electron": "^25.0.0",
17+
"electron-builder": "^24.0.0"
18+
},
19+
"build": {
20+
"appId": "com.profullstack.pdfconverter",
21+
"productName": "PDF Converter",
22+
"directories": {
23+
"output": "dist"
24+
},
25+
"files": [
26+
"src/**/*",
27+
"assets/**/*",
28+
"package.json"
29+
],
30+
"mac": {
31+
"category": "public.app-category.productivity",
32+
"target": [
33+
"dmg",
34+
"zip"
35+
],
36+
"icon": "assets/icon.icns"
37+
},
38+
"win": {
39+
"target": [
40+
"nsis",
41+
"portable"
42+
],
43+
"icon": "assets/icon.ico"
44+
},
45+
"linux": {
46+
"target": [
47+
"AppImage",
48+
"deb",
49+
"rpm"
50+
],
51+
"category": "Office",
52+
"icon": "assets/icon.png"
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)