Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Create .env file
run: |
Expand All @@ -29,11 +32,11 @@ jobs:

- name: Build Windows (unsigned)
if: vars.ENABLE_CODE_SIGNING != 'true'
run: npm run build:win
run: pnpm run build:win

- name: Build Windows (signed)
if: vars.ENABLE_CODE_SIGNING == 'true'
run: npm run build:win
run: pnpm run build:win
env:
CSC_LINK: ${{ secrets.WINDOWS_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
Expand All @@ -53,14 +56,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Create .env file
run: |
Expand All @@ -69,11 +75,11 @@ jobs:

- name: Build macOS (unsigned)
if: vars.ENABLE_CODE_SIGNING != 'true'
run: npm run build:mac
run: pnpm run build:mac

- name: Build macOS (signed)
if: vars.ENABLE_CODE_SIGNING == 'true'
run: npm run build:mac
run: pnpm run build:mac
env:
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
Expand All @@ -96,22 +102,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Create .env file
run: |
echo "GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}" > .env
echo "GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}" >> .env

- name: Build Linux
run: npm run build:linux
run: pnpm run build:linux

- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint
run: npm run lint
run: pnpm run lint

- name: Format check
run: npm run format:check
run: pnpm run format:check

- name: Typecheck
run: npm run typecheck
run: pnpm run typecheck

- name: Tests
run: pnpm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Dependencies
node_modules/
package-lock.json

# Build outputs
dist/
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
npx lint-staged
npm run typecheck
pnpm exec lint-staged
pnpm run typecheck
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function run() {
### Prerequisites

- **Node.js** 18 or higher
- **npm** or **yarn**
- **pnpm** (`npm install -g pnpm`)
- A **Firebase project**

### Installation
Expand Down Expand Up @@ -157,10 +157,10 @@ git clone https://github.com/Flowdesktech/firestudio.git
cd firestudio

# Install dependencies
npm install
pnpm install

# Start the application
npm run dev
pnpm run dev
```

### Connecting to Your Firebase Project
Expand Down Expand Up @@ -196,26 +196,26 @@ See detailed OAuth setup guide in the [Google Sign-In Setup](#google-sign-in-set

### Development

| Command | Description |
| ------------------ | ------------------------------------------- |
| `npm run dev` | Start the full Electron app with hot reload |
| `npm run dev:vite` | Start browser-only mode (limited features) |
| `npm run build` | Build the React app for production |
| Command | Description |
| ------------------- | ------------------------------------------- |
| `pnpm run dev` | Start the full Electron app with hot reload |
| `pnpm run dev:vite` | Start browser-only mode (limited features) |
| `pnpm run build` | Build the React app for production |

### Building Releases

| Command | Description |
| --------------------- | -------------------------------------------------- |
| `npm run build:win` | Build for Windows (`.exe` installer + portable) |
| `npm run build:mac` | Build for macOS (`.dmg` + `.zip`) |
| `npm run build:linux` | Build for Linux (`.AppImage` + `.deb` + `.tar.gz`) |
| `npm run build:all` | Build for all platforms |
| Command | Description |
| ---------------------- | -------------------------------------------------- |
| `pnpm run build:win` | Build for Windows (`.exe` installer + portable) |
| `pnpm run build:mac` | Build for macOS (`.dmg` + `.zip`) |
| `pnpm run build:linux` | Build for Linux (`.AppImage` + `.deb` + `.tar.gz`) |
| `pnpm run build:all` | Build for all platforms |

### Utilities

| Command | Description |
| ----------------------- | ----------------------------- |
| `npm run generate-icon` | Regenerate app icons from SVG |
| Command | Description |
| ------------------------ | ----------------------------- |
| `pnpm run generate-icon` | Regenerate app icons from SVG |

---

Expand All @@ -225,16 +225,16 @@ See detailed OAuth setup guide in the [Google Sign-In Setup](#google-sign-in-set

```bash
# Windows
npm run build:win
pnpm run build:win

# macOS
npm run build:mac
pnpm run build:mac

# Linux
npm run build:linux
pnpm run build:linux

# All platforms (requires cross-compilation setup)
npm run build:all
pnpm run build:all
```

**Output files are saved to the `release/` directory:**
Expand Down Expand Up @@ -269,7 +269,7 @@ npm run build:all

4. **Build and publish:**
```bash
npm run release
pnpm run release
```

### Cross-Platform Building Notes
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ Security patches will be released as soon as possible after a vulnerability is c

## Third-Party Dependencies

This project depends on several npm packages. We recommend:
This project depends on several packages. We recommend:

- Running `npm audit` regularly to check for vulnerabilities
- Running `pnpm audit` regularly to check for vulnerabilities
- Keeping dependencies updated
- Reviewing dependency changes before updating

Expand Down
12 changes: 10 additions & 2 deletions electron/controllers/firebaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ function setConnectionChangeCallback(callback) {
*/
function registerHandlers() {
// Connect to Firebase with service account
ipcMain.handle('firebase:connect', async (event, serviceAccountPath) => {
ipcMain.handle('firebase:connect', async (event, params) => {
try {
// Support both object params and legacy string path
const serviceAccountPath = typeof params === 'string' ? params : params.serviceAccountPath;
const databaseId = typeof params === 'string' ? undefined : params.databaseId;

if (admin) {
await admin.app().delete();
}
Expand All @@ -44,12 +48,16 @@ function registerHandlers() {

db = admin.firestore();

if (databaseId) {
db.settings({ databaseId });
}

// Notify other controllers about the connection change
if (onConnectionChange) {
onConnectionChange(admin, db);
}

return { success: true, projectId: serviceAccount.project_id };
return { success: true, projectId: serviceAccount.project_id, databaseId };
} catch (error) {
return { success: false, error: error.message };
}
Expand Down
Loading