Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

2skydev/electron-vite-react-ts-template

Repository files navigation

electron-vite-template-github-card

Electron + Vite + React + TypeScript Template

A template for using electron quickly.
Please understand that the code and explanation are mainly written in Korean. ๐Ÿฅฒ


โš ๏ธ ์ด ํ…œํ”Œ๋ฆฟ์€ ๋” ์ด์ƒ ์œ ์ง€๋ณด์ˆ˜๋ฅผ ์ง„ํ–‰ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์•„๋ž˜ ๋งํฌ์— ์žˆ๋Š” nestjs๋กœ ์ƒˆ๋กญ๊ฒŒ ์ƒ์„ฑํ•œ ํ…œํ”Œ๋ฆฟ์„ ์ด์šฉํ•ด์ฃผ์„ธ์š”!

์ฐจ์ด์ 

  • nestjs + ipc decorator๋กœ ํ†ต์‹ 
  • ํ…œํ”Œ๋ฆฟ UI ๋ฐ ์˜์กด์„ฑ ํŒจํ‚ค์ง€ ์ œ๊ฑฐ
  • ์—…๋ฐ์ดํŠธ ๋กœ๋”ฉ ํ™”๋ฉด ์ถ”๊ฐ€
  • yarn์—์„œ pnpm์œผ๋กœ ๋ณ€๊ฒฝ
  • ์ž๋™ ์—…๋ฐ์ดํŠธ ๋ฐ ๋ฐฐํฌ Github Action ์‚ฌ์ „ ๊ตฌ์„ฑ

https://github.com/2skydev/electron-nestjs-react-vite-template


ํŠน์ง•๋“ค ๋‘˜๋Ÿฌ๋ณด๊ธฐ

  • electron & vite๋ฅผ ์‚ฌ์šฉํ•ด ๋น ๋ฅธ ๊ฐœ๋ฐœ, ๋นŒ๋“œ๊ฐ€ ๊ฐ€๋Šฅํ•œ TypeScript ํ™˜๊ฒฝ
  • ์•ฑ์— ํ•„์ˆ˜์ ์ธ ์š”์†Œ ์ž๋™ ์—…๋ฐ์ดํŠธ, ์ €์žฅ์†Œ, ๋กœ๊ทธ ๋“ฑ ์‚ฌ์ „๊ตฌ์„ฑ
  • ํŒŒ์ผ ์‹œ์Šคํ…œ ๋ผ์šฐํŒ… ๊ธฐ๋Šฅ (Next.js์—์„œ ์‚ฌ์šฉํ•˜๋˜ ๋ฐฉ์‹)
  • electron ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ์‹œ modules๋กœ ๋ถ„๋ฆฌ ๊ฐœ๋ฐœ ๊ฐ€๋Šฅํ•˜๋„๋ก ๊ตฌ์„ฑ (๊ด€์‹ฌ์‚ฌ ๋ถ„๋ฆฌ ๋ฐ ์•ฑ์˜ ์—ฌ๋Ÿฌ ์ƒํƒœ๋“ค์„ ๊ณต์œ ํ•˜๊ธฐ ์œ„ํ•ด modules๋กœ ์ฒ˜๋ฆฌ) (autoload ์ฒ˜๋ฆฌ)
  • deeplink ์ฒ˜๋ฆฌ (modules/deepLink/resolvers ์˜ˆ์‹œ) (autoload ์ฒ˜๋ฆฌ)
  • ๋น ๋ฅธ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ํŒŒ์ผ ์ƒ์„ฑ๊ธฐ (yarn g ๋ช…๋ น์–ด๋กœ ์‚ฌ์šฉ๊ฐ€๋Šฅ)
  • Windows, MacOS ํฌ๋กœ์Šคํ”Œ๋žซํผ์„ ๊ณ ๋ คํ•œ ๊ฐœ๋ฐœ

์‚ฌ์šฉํ•œ ํ”„๋ ˆ์ž„์›Œํฌ, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ


์‹œ์ž‘ํ•˜๊ธฐ

์‚ฌ์šฉํ•˜๊ธฐ ์ „ ๋ ˆ์ด์•„์›ƒ์ด๋‚˜ ํŠน์ • ํŒจํ‚ค์ง€๋“ค์ด ํ•„์š”์—†๋‹ค๋ฉด ์ œ๊ฑฐํ•˜๊ณ  ์‹œ์ž‘ํ•˜์…”๋„ ๋ฉ๋‹ˆ๋‹ค.

dev mode

yarn dev

vite & electron build (ํ˜„์žฌ OS๊ธฐ์ค€)

yarn build

vite & electron build (๋ชจ๋“  OS๊ธฐ์ค€)

yarn build:all

์Šคํฌ๋ฆฐ์ƒท๋“ค

image

image

image