Skip to content

Commit 516de74

Browse files
committed
chore: remove main process unit tests documentation
The main process unit tests documentation has been removed as it is no longer needed. Additionally, a new comprehensive guide for unit testing the Electron main process has been added, covering modular architectures, dependency injection, IPC handlers, and best practices. Closes #123
1 parent 47f3d66 commit 516de74

File tree

4 files changed

+1455
-277
lines changed

4 files changed

+1455
-277
lines changed

.github/workflows/build.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: App build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- "README.md"
9+
- "package.json"
10+
- "docs/**"
11+
- ".vscode/**"
12+
- ".gitignore"
13+
pull_request:
14+
branches:
15+
- main
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
build-macos:
22+
runs-on: macos-latest
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
34+
- name: Setup dependencies
35+
run: npm install
36+
37+
- name: Run unit tests
38+
run: npm run test:unit:renderer && npm run test:unit:main
39+
40+
- name: Run Build for macOS
41+
run: npm run build:mac:publish
42+
43+
build-windows:
44+
runs-on: windows-latest
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 22
55+
56+
- name: Setup dependencies
57+
run: npm install
58+
59+
- name: Run unit tests
60+
run: npm run test:unit:renderer && npm run test:unit:main
61+
62+
- name: Run Build for Windows
63+
run: npm run build:win:publish

README.md

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +0,0 @@
1-
# � Electron React Auth Updater
2-
3-
A professional-grade, modular boilerplate for building secure and scalable cross-platform desktop applications using **Electron**, **React 19**, and **Tailwind CSS**.
4-
5-
---
6-
7-
## 📋 Features
8-
9-
### 🔐 Secure Authentication
10-
11-
- **Integrated Auth Domain**: Robust authentication flow with a dedicated background process and window.
12-
- **OAuth Providers**: Out-of-the-box support for **Google**, **Facebook**, and **GitHub**.
13-
- **Context Bridge Security**: Strict IPC communication with sender validation and sanitized API exposure.
14-
15-
### 🔄 Auto-Updates
16-
17-
- **Cross-Platform**: Built-in update service optimized for both **Windows** and **macOS**.
18-
- **Status Tracking**: Real-time update progress, download percentages, and status notifications in the UI.
19-
20-
### 🎨 Modern UI & Styling
21-
22-
- **React 19 & Tailwind CSS**: Leveraging the latest React features and utility-first styling for high performance.
23-
- **Custom UI Kit**: A comprehensive library of reusable components (Buttons, Inputs, Popovers, Cards, etc.) with full **Light/Dark Mode** support.
24-
- **Virtualization**: Efficient rendering of large datasets using `react-window` and `react-virtualized-auto-sizer`.
25-
- **Lucide Icons**: Clean and lightweight icon set with `lucide-react`.
26-
27-
### 🏗️ Architecture & DX
28-
29-
- **Modular Main Process**: Clean separation of concerns with feature-based modules (auth, updater, user, etc.).
30-
- **Subscription Pattern**: High-performance state management using `useSyncExternalStore` and a custom context pattern.
31-
- **Robust Testing**:
32-
- **Unit Testing**: Pre-configured with **Vitest** for both Main and Renderer processes.
33-
- **E2E Testing**: Integrated **Playwright** for end-to-end application testing.
34-
- **Logging & Storage**: Integrated `electron-log` for debugging and `electron-store` for persistent data storage.
35-
36-
---
37-
38-
## 🛠️ Technologies Used
39-
40-
- **Core**: Electron, React 19, TypeScript, Vite
41-
- **Styling**: Tailwind CSS, clsx, tailwind-merge
42-
- **State/Navigation**: React Router 7, useSyncExternalStore
43-
- **Desktop Utils**: electron-updater, electron-store, electron-log
44-
- **Network**: Axios, jsonwebtoken
45-
- **Icons**: lucide-react
46-
- **Testing**: Vitest, Playwright, Testing Library
47-
48-
---
49-
50-
## 🚀 Getting Started
51-
52-
### Prerequisites
53-
54-
- Node.js (Latest LTS recommended)
55-
- npm or yarn
56-
57-
### Installation
58-
59-
```bash
60-
npm install
61-
```
62-
63-
### Development
64-
65-
Run the development environment (Main and Renderer in parallel):
66-
67-
```bash
68-
npm run dev
69-
```
70-
71-
### Building & Packaging
72-
73-
Build and package the application for your OS:
74-
75-
```bash
76-
# Windows
77-
npm run build:win
78-
79-
# macOS
80-
npm run build:mac
81-
82-
# Linux
83-
npm run build:linux
84-
```
85-
86-
---
87-
88-
## 📂 Project Structure
89-
90-
- `src/main`: Main process logic (IPC, Windows, Services, Feature Modules).
91-
- `src/renderer`: React application (Components, Hooks, Domains, Windows).
92-
- `types`: Shared TypeScript definitions for IPC and domain objects.
93-
- `docs`: Detailed architecture guides and coding instructions.

0 commit comments

Comments
 (0)