Skip to content

๐Ÿ’… A modern Electron app boilerplate with React v19, TypeScript v5, TailwindCSS v3, Ant Design v5, SQLite3 database, and automated GitHub releases.

License

Notifications You must be signed in to change notification settings

wuchuheng/electron-app-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

52 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Electron App Template

๐Ÿ’… A modern Electron app boilerplate with React v19, TypeScript v5, TailwindCSS v3, Ant Design v5, SQLite3 database, and automated GitHub releases.

npm version ๐Ÿš€ Release ๐Ÿงช Tests โš–๏ธ License

Electron App Template

โœจ Features

๐Ÿš€ Core Features

๐Ÿ”ฅ Fast and Ready-to-go with a well-thought-out structure
๐Ÿš€ Hot reload for main process and Fast Refresh for renderer
๐ŸŽ‰ React Router DOM for seamless navigation
๐Ÿ˜Ž Preload (context bridge) already configured
๐Ÿ”ฎ Automated GitHub releases for Windows, Mac and Linux
๐Ÿ—„๏ธ SQLite3 database with TypeORM integration
๐ŸŒ Internationalization (i18n) with react-i18next
๐ŸŽจ Modern UI with Ant Design components

๐Ÿ› ๏ธ Technologies

๐Ÿ”‹ Electron v36.3.2
โš›๏ธ React v19.1.0
๐ŸŒŽ React Router DOM v7.6.1
๐Ÿ’™ TypeScript v5.8.3
๐Ÿ“ฆ Electron Forge v7.8.1
โœจ TailwindCSS v3.4.17
๐ŸŽจ Ant Design v5.25.4
๐Ÿ—„๏ธ better-sqlite3 v11.10.0 + TypeORM v0.3.24
๐ŸŒ i18next v25.2.1 + react-i18next v15.5.2
๐Ÿ’ซ ESLint + Prettier with TailwindCSS plugin
๐Ÿ”ฎ GitHub Actions for automated releases

๐Ÿ—๏ธ Project Architecture

This project follows a well-structured layered architecture pattern:

Windows Layer โ†’ IPC Layer โ†’ IPC Layout โ†’ Service Layout โ†’ Repository Layout

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ main/
โ”‚   โ”œโ”€โ”€ database/          # Database configuration and entities
โ”‚   โ”œโ”€โ”€ ipc/              # Inter-Process Communication handlers
โ”‚   โ”œโ”€โ”€ main.ts           # Main process entry point
โ”‚   โ”œโ”€โ”€ services/         # Business logic and service layer
โ”‚   โ”œโ”€โ”€ utils/            # Utility functions and helpers
โ”‚   โ””โ”€โ”€ windows/          # Window management and creation
โ”œโ”€โ”€ preload/
โ”‚   โ””โ”€โ”€ preload.ts        # Preload scripts for secure context bridge
โ”œโ”€โ”€ renderer/
โ”‚   โ”œโ”€โ”€ App.tsx           # Main React application component
โ”‚   โ”œโ”€โ”€ assets/           # Static assets (images, icons, etc.)
โ”‚   โ”œโ”€โ”€ config/           # Frontend configuration
โ”‚   โ”œโ”€โ”€ i18n/             # Internationalization files
โ”‚   โ”œโ”€โ”€ layout/           # UI layout components
โ”‚   โ”œโ”€โ”€ pages/            # Application pages/screens
โ”‚   โ”œโ”€โ”€ renderer.css      # Global styles
โ”‚   โ”œโ”€โ”€ renderer.html     # HTML template
โ”‚   โ”œโ”€โ”€ renderer.ts       # Renderer process entry point
โ”‚   โ””โ”€โ”€ styles/           # CSS/SCSS style files
โ”œโ”€โ”€ shared/
โ”‚   โ”œโ”€โ”€ config-utils.ts   # Shared configuration utilities
โ”‚   โ”œโ”€โ”€ config.ts         # Application configuration
โ”‚   โ”œโ”€โ”€ ipc-channel.ts    # IPC channel definitions
โ”‚   โ””โ”€โ”€ ipc-subscription.ts # IPC event subscriptions
โ””โ”€โ”€ types/
    โ”œโ”€โ”€ custom.d.ts       # Custom type definitions
    โ””โ”€โ”€ electron.d.ts     # Electron-specific types

๐Ÿ”„ Architecture Flow

  1. ๐ŸชŸ Windows Layer: Manages application windows and their lifecycle
  2. ๐Ÿ“ก IPC Layer: Handles communication between main and renderer processes
  3. ๐ŸŽจ IPC Layout: Organizes IPC communication patterns and data flow
  4. โš™๏ธ Service Layer: Contains business logic and application services
  5. ๐Ÿ—„๏ธ Repository Layer: Manages data access and database operations

โš™๏ธ Requirements

  • Node.js 20+
  • npm 10+

๐Ÿš€ Quick Start

# Create a new project
npx @wuchuheng/electron my-app
cd my-app

# Install dependencies
npm install

# Start development
npm run start

Note: After creating your project, update the package.json file with your project details (name, description, author, etc.).

๐Ÿ› ๏ธ Development

# Start development server
npm run start

# Format code
npm run format

# Lint code
npm run lint

# Generate app icons
npm run gen:logo

๐Ÿ“ฆ Distribution

Note: Check Electron Forge docs for more information

Build for all platforms

npm run make

Build for specific platform

# Windows
npm run make --platform=win32

# macOS
npm run make --platform=darwin

# Linux
npm run make --platform=linux

Package without distribution

npm run package

The built applications will be available in the out folder.

๐Ÿค Contributing

Note: contributions are always welcome, but always ask first, โ€” please โ€” before work on a PR.

That said, there's a bunch of ways you can contribute to this project, like by:

๐Ÿชฒ Reporting a bug
๐Ÿ“„ Improving this documentation
๐Ÿšจ Sharing this project and recommending it to your friends
๐Ÿ’ต Supporting this project on GitHub Sponsors
๐ŸŒŸ Giving a star on this repository

๐Ÿ“ License

MIT ยฉ Wuchuheng

๐Ÿ‘ค Author

Wuchuheng

๐Ÿ™ Show your support

Give a โญ๏ธ if this project helped you!

About

๐Ÿ’… A modern Electron app boilerplate with React v19, TypeScript v5, TailwindCSS v3, Ant Design v5, SQLite3 database, and automated GitHub releases.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published