GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pnstack/template-electron

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
public
public
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
postcss.config.js
postcss.config.js
 
 
tailwind.config.js
tailwind.config.js
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.node.json
tsconfig.node.json
 
 
vite.config.ts
vite.config.ts
 
 

Repository files navigation

Template Electron

CI Release Code Quality License: MIT

A modern, production-ready Electron application template built with TypeScript, React, and TailwindCSS.

šŸš€ Features

  • ⚔ Vite - Lightning fast HMR and build tool
  • āš›ļø React 19 - Latest React with hooks
  • šŸ”· TypeScript - Type safety and better DX
  • šŸŽØ Tailwind CSS - Utility-first CSS framework
  • šŸ“¦ Electron Builder - Package and distribute your app
  • šŸ”’ Secure - Context isolation and secure IPC

šŸ“‹ Prerequisites

  • Node.js 18+ and npm

šŸ› ļø Installation

# Clone the repository
git clone https://github.com/pnstack/template-electron.git

# Navigate to the project directory
cd template-electron

# Install dependencies
npm install

šŸ’» Development

# Start the development server
npm run dev

This will start the Vite dev server and launch the Electron application with hot-reload enabled.

šŸ—ļø Building

# Build for production
npm run build

# Build and package for your current platform
npm run electron:build

# Build for specific platforms
npm run electron:build:win    # Windows
npm run electron:build:mac    # macOS
npm run electron:build:linux  # Linux

The packaged application will be in the release directory.

šŸ“ Project Structure

template-electron/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ main/           # Electron main process
│   │   └── main.ts     # Main process entry
│   ā”œā”€ā”€ preload/        # Preload scripts
│   │   └── preload.ts  # Secure IPC bridge
│   └── renderer/       # React application
│       ā”œā”€ā”€ App.tsx     # Main React component
│       ā”œā”€ā”€ main.tsx    # React entry point
│       ā”œā”€ā”€ index.css   # Tailwind directives
│       └── electron.d.ts # TypeScript definitions
ā”œā”€ā”€ index.html          # HTML template
ā”œā”€ā”€ vite.config.ts      # Vite configuration
ā”œā”€ā”€ tailwind.config.js  # Tailwind configuration
ā”œā”€ā”€ tsconfig.json       # TypeScript config (renderer)
ā”œā”€ā”€ tsconfig.node.json  # TypeScript config (main/preload)
└── package.json        # Project dependencies

šŸ”§ Configuration

Vite

The Vite configuration (vite.config.ts) includes:

  • React plugin for JSX/TSX support
  • Electron plugin for main and preload scripts
  • Path aliases for cleaner imports

Electron

The main process (src/main/main.ts) creates the browser window and handles:

  • Window creation and management
  • Loading the renderer in dev/prod mode
  • IPC communication with renderer

Tailwind CSS

Configure Tailwind by editing tailwind.config.js. The template includes:

  • Configured content paths for tree-shaking
  • Ready for custom themes and plugins

šŸ”’ Security

This template follows Electron security best practices:

  • Context isolation enabled
  • Node integration disabled
  • Secure IPC via preload script
  • No direct Node.js access in renderer

šŸ”„ CI/CD

This project includes comprehensive CI/CD workflows using GitHub Actions:

Workflows

  • CI (ci.yml) - Runs on every push and PR

    • Tests across multiple OS (Ubuntu, Windows, macOS)
    • Tests across multiple Node.js versions (18.x, 20.x)
    • Type checking with TypeScript
    • Build verification
    • Automatic artifact uploads
  • Release (release.yml) - Automated releases

    • Triggers on version tags (e.g., v1.0.0)
    • Triggers on pushes to main branch (auto-creates release with package.json version)
    • Builds for all platforms (Windows, macOS, Linux)
    • Creates GitHub releases with binaries
    • Manual trigger option available
  • PR Check (pr-check.yml) - Pull request validation

    • Type checking
    • Build verification
    • PR size warnings
  • Code Quality (quality.yml) - Code quality checks

    • TypeScript validation
    • Security audits
    • Bundle size analysis
    • Weekly scheduled runs

Creating a Release

Releases are automatically created in two ways:

1. Automatic release on main branch

  • Every push to the main branch automatically creates a release
  • Uses the version from package.json (e.g., if package.json has "version": "1.0.0", it creates release v1.0.0)
  • Builds and publishes binaries for all platforms

2. Manual release with version tag

# Create and push a version tag
git tag v1.0.0
git push origin v1.0.0

The release workflow will automatically build and publish binaries for all platforms.

Dependencies

Dependabot is configured to automatically check for:

  • npm package updates (weekly)
  • GitHub Actions updates (weekly)

šŸ¤ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

šŸ“„ License

MIT License - feel free to use this template for any project!

šŸ™ Acknowledgments

Built with:

  • Electron
  • React
  • Vite
  • Tailwind CSS
  • TypeScript

About

No description, website, or topics provided.

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.