74 | );
75 | }
76 |
--------------------------------------------------------------------------------
/eslint.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig, globalIgnores } from 'eslint/config';
2 | import pluginJs from '@eslint/js';
3 | import pluginTypeScriptESLint from 'typescript-eslint';
4 | import pluginReact from 'eslint-plugin-react';
5 | import pluginReactHooks from 'eslint-plugin-react-hooks';
6 | import pluginNode from 'eslint-plugin-n';
7 | import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
8 | import parserTypeScript from '@typescript-eslint/parser';
9 | import pluginImport from 'eslint-plugin-import';
10 | import pluginPrettier from 'eslint-plugin-prettier/recommended';
11 |
12 | import globals from 'globals';
13 |
14 | export default defineConfig(
15 | pluginPrettier,
16 | pluginReact.configs.flat.recommended,
17 | pluginJs.configs.recommended,
18 | pluginReactHooks.configs.flat.recommended,
19 | pluginTypeScriptESLint.configs.recommended,
20 | pluginImport.flatConfigs.electron,
21 | pluginJsxA11y.flatConfigs.recommended,
22 | pluginNode.configs['flat/recommended-script'],
23 | globalIgnores([
24 | '**/node_modules',
25 | '**/dist',
26 | '**/release',
27 | '**/.idea',
28 | '**/.vscode',
29 | '**/.github',
30 | '**/buildAssets/builder',
31 | '**/tests/results',
32 | '**/package-lock.json',
33 | ]),
34 | {
35 | files: ['**/*.{js,mjs,cjs,jsx,tsx,ts}'],
36 | settings: {
37 | react: {
38 | version: 'detect',
39 | },
40 | },
41 | languageOptions: {
42 | ecmaVersion: 'latest',
43 | sourceType: 'module',
44 | globals: {
45 | ...globals.browser,
46 | ...globals.node,
47 | },
48 | parserOptions: {
49 | parser: parserTypeScript,
50 | ecmaVersion: 2022,
51 | ecmaFeatures: {
52 | jsx: true,
53 | },
54 | requireConfigFile: false,
55 | },
56 | },
57 | rules: {
58 | eqeqeq: 'error',
59 | 'no-unused-vars': 'off',
60 | 'no-underscore-dangle': 'warn',
61 | 'no-case-declarations': 'off',
62 | 'no-trailing-spaces': 'error',
63 | 'no-unsafe-optional-chaining': 'off',
64 | 'no-control-regex': 'off',
65 | 'n/no-missing-import': 'off',
66 | 'n/no-unsupported-features/node-builtins': 'off',
67 | 'react/require-default-props': [
68 | 'error',
69 | {
70 | forbidDefaultForRequired: true,
71 | functions: 'defaultArguments',
72 | },
73 | ],
74 | 'react-hooks/exhaustive-deps': 'off',
75 | 'react/react-in-jsx-scope': 'off',
76 | 'react/jsx-props-no-spreading': 'off',
77 | 'react/no-unknown-property': ['error', { ignore: ['css'] }],
78 | 'react/jsx-filename-extension': [
79 | 2,
80 | {
81 | extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.mts'],
82 | },
83 | ],
84 | 'jsx-a11y/anchor-is-valid': 0,
85 | 'jsx-a11y/label-has-associated-control': 1,
86 | 'jsx-a11y/no-noninteractive-element-interactions': 0,
87 | 'jsx-a11y/click-events-have-key-events': 0,
88 | 'jsx-a11y/no-static-element-interactions': 0,
89 | '@typescript-eslint/no-unused-vars': [
90 | 'error',
91 | {
92 | argsIgnorePattern: '^_',
93 | varsIgnorePattern: '^_',
94 | caughtErrorsIgnorePattern: '^_',
95 | },
96 | ],
97 | '@typescript-eslint/no-explicit-any': 'off',
98 | },
99 | },
100 | );
101 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retron",
3 | "appId": "com.retron.retron",
4 | "version": "1.0.0",
5 | "description": "ViteJS + Electron + React + Material-UI Template",
6 | "homepage": "https://github.com/jooy2/retron",
7 | "author": "CDGet ",
8 | "license": "MIT",
9 | "main": "dist/main/index.js",
10 | "private": true,
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/jooy2/retron.git"
14 | },
15 | "bugs": {
16 | "url": "https://github.com/jooy2/retron/issues"
17 | },
18 | "debug": {
19 | "env": {
20 | "VITE_DEV_SERVER_URL": "http://localhost:5173"
21 | }
22 | },
23 | "engines": {
24 | "node": ">=18.0.0"
25 | },
26 | "scripts": {
27 | "dev": "vite",
28 | "dev:debug": "vite -d",
29 | "dev:debug:force": "vite -d --force",
30 | "build": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js",
31 | "build:pre": "tsc && vite build",
32 | "build:all": "npm run build:pre && electron-builder -wml --config=buildAssets/builder/config.js",
33 | "build:dir": "npm run build:pre && electron-builder --dir --config=buildAssets/builder/config.js",
34 | "build:win": "npm run build:pre && electron-builder --windows --config=buildAssets/builder/config.js",
35 | "build:win:portable": "npm run build:pre && electron-builder --windows nsis:ia32 portable --config=buildAssets/builder/config.js",
36 | "build:mac": "npm run build:pre && electron-builder --mac --config=buildAssets/builder/config.js",
37 | "build:linux": "npm run build:pre && electron-builder --linux --config=buildAssets/builder/config.js",
38 | "lint": "eslint . --ext .js,.ts,.tsx,.jsx .",
39 | "lint:fix": "eslint . --ext .js,.ts,.tsx,.jsx --fix .",
40 | "format": "prettier .",
41 | "format:fix": "prettier . --write",
42 | "test": "npm run build:pre && playwright test",
43 | "test:linux": "npm run build:pre && xvfb-run --auto-servernum --server-args='-screen 0, 1280x960x24' -- playwright test"
44 | },
45 | "dependencies": {
46 | "@emotion/react": "^11.14.0",
47 | "@emotion/styled": "^11.14.1",
48 | "@mui/material": "^7.3.6",
49 | "@reduxjs/toolkit": "^2.11.2",
50 | "i18next": "^25.7.3",
51 | "i18next-browser-languagedetector": "^8.2.0",
52 | "i18next-http-backend": "^3.0.2",
53 | "react": "^19.2.3",
54 | "react-dom": "^19.2.3",
55 | "react-i18next": "^16.5.0",
56 | "react-redux": "^9.2.0",
57 | "react-router-dom": "^7.10.1"
58 | },
59 | "devDependencies": {
60 | "@eslint/js": "^9.39.2",
61 | "@playwright/test": "^1.57.0",
62 | "@types/react": "^19.2.7",
63 | "@types/react-dom": "^19.2.3",
64 | "@typescript-eslint/parser": "^8.50.0",
65 | "@vitejs/plugin-react-swc": "^4.2.2",
66 | "dotenv": "^17.2.3",
67 | "electron": "^39.2.7",
68 | "electron-builder": "^26.0.14",
69 | "electron-extension-installer": "^2.0.1",
70 | "eslint": "^9.39.2",
71 | "eslint-config-prettier": "^10.1.8",
72 | "eslint-plugin-import": "^2.32.0",
73 | "eslint-plugin-jsx-a11y": "^6.10.2",
74 | "eslint-plugin-n": "^17.23.1",
75 | "eslint-plugin-prettier": "^5.5.4",
76 | "eslint-plugin-react": "^7.37.5",
77 | "eslint-plugin-react-hooks": "^7.0.1",
78 | "globals": "^16.5.0",
79 | "jiti": "^2.6.1",
80 | "playwright": "^1.57.0",
81 | "prettier": "^3.7.4",
82 | "typescript": "^5.9.3",
83 | "typescript-eslint": "^8.50.0",
84 | "vite": "^7.3.0",
85 | "vite-plugin-electron": "^0.29.0",
86 | "vite-plugin-electron-renderer": "^0.14.6",
87 | "vite-plugin-eslint": "^1.8.1"
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Project
2 |
3 | Thank you for contributing to the project. Your contributions will help us take the project to the next level.
4 |
5 | This project adheres to the Contributor Covenant code of conduct. Your contribution implies that you have read and agree to this policy. Any behavior that undermines the quality of the project community, including this policy, will be warned or restricted by the maintainers.
6 |
7 | ## Issues
8 |
9 | Issues can be created on the following page: https://github.com/jooy2/retron/issues
10 |
11 | Alternatively, you can email the package maintainer. However, we prefer to track progress via GitHub Issues.
12 |
13 | When creating an issue, keep the following in mind:
14 |
15 | - Please specify the correct category selection based on the format of the issue (e.g., bug report, feature request).
16 | - Check to see if there are duplicate issues.
17 | - Describe in detail what is happening and what needs to be fixed. You may need additional materials such as images or video.
18 | - Use appropriate keyword titles to make it easy for others to search and understand.
19 | - Please use English in all content.
20 | - You may need to describe the environment in which the issue occurs.
21 |
22 | ## How to contribute (Pull Requests)
23 |
24 | ### Write the code you want to change
25 |
26 | Here's the process for contributing to the project:
27 |
28 | 1. Clone the project (or rebase to the latest commit in the main branch)
29 | 2. Install the package (if the package manager exists)
30 | 3. Setting up lint or code formatter in the IDE (if your project includes a linter) and installing the relevant plugins. Some projects may use specific commands to check rules and perform formatting after module installation and before committing.
31 | 4. Write the code that needs to be fixed
32 | 5. Update the documentation (if it exists) or create a new one. If your project supports multilingual documentation, update the documentation for all languages. You can fill in the content in your own language and not translate it.
33 | 6. Add or modify tests as needed (if test code exists). You should also verify that existing tests pass.
34 |
35 | ### Write a commit message
36 |
37 | While we don't have strict restrictions on commit messages, we recommend that you follow the recommendations below whenever possible:
38 |
39 | - Write in English.
40 | - Use the ` symbol to name functions, variables, or folders and files.
41 | - Use a format like `xxx: message (fixes #1)`. The content in parentheses is optional.
42 | - The message includes a summary of what was modified.
43 | - It's a good idea to separate multiple modifications into their own commit messages.
44 |
45 | It is recommended that you include a tag at the beginning of the commit message. Between the tag and the message, use `: ` between the tag and the message.
46 |
47 | tags conform to the ["Udacity Git Commit Message Style Guide"](https://udacity.github.io/git-styleguide). However, you are welcome to use tags not listed here for additional situations.
48 |
49 | - `feat`: A new feature
50 | - `fix`: A bug fix
51 | - `docs`: Changes to documentation
52 | - `style`: Formatting, missing semicolons, etc.; no code change
53 | - `refactor`: Refactoring production code
54 | - `test`: Adding tests, refactoring test; no production code change
55 | - `chore`: Updating build tasks, package manager configs, etc.; no production code change
56 |
57 | Informal tags:
58 |
59 | - `package`: Modifications to package settings, modules, or GitHub projects
60 | - `typo`: Fix typos
61 |
62 | ### Create a pull request
63 |
64 | When creating a pull request, keep the following in mind:
65 |
66 | - Include a specific description of what the modification is, why it needs to be made, and how it works.
67 | - Check to see if there are duplicate pull requests.
68 | - Please use English in all content.
69 |
70 | Typically, a project maintainer will review and test your code before merging it into the project. This process can take some time, and they may ask you for further edits or clarifications in the comments.
71 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 | ## Vite + Electron + React + Material-UI Template
6 |
7 | > [](https://github.com/jooy2/retron/blob/main/LICENSE)     [](https://github.com/jooy2) 
8 |
9 | This is a skeleton template for easily creating React-based Electron projects.
10 |
11 | It is configured to experience fast development and build speed using **[Vite](https://vitejs.dev)** bundler. As a bonus, it includes several React utilities and layout configurations.
12 |
13 |
14 |
15 | ## Advantages of use
16 |
17 | - ✅ You can build immediately without any presets, so you can develop quickly.
18 | - ✅ It is being maintained quickly to be compatible with the latest `React` and `Electron`, as well as many modules.
19 | - ✅ There is no need to worry about layout and data management by using various additional templates.
20 |
21 | ## Features
22 |
23 | - ⚡️ Rapid development through hot-reload
24 | - ⚡️ Cross-platform development and build support
25 | - ⚡️ Support for automated application testing
26 | - ⚡️ TypeScript support
27 | - ⚡️ Multilingual support
28 | - ⚡️ Support for themes (dark & light)
29 | - ⚡️ Basic layout manager
30 | - ⚡️ Global state management through the Redux store
31 | - ⚡️ Quick support through the GitHub community
32 |
33 | ## Components
34 |
35 | - **For compile & build**
36 |
37 | - `vite`
38 | - `electron`
39 | - `electron-builder` (Package builder)
40 |
41 | - **For web development framework**
42 |
43 | - `react`
44 | - `react-dom`
45 | - `react-router-dom`
46 | - `@redux/toolkit` & `react-redux` (Global state management)
47 | - `typescript`
48 |
49 | - **For CSS Design**
50 |
51 | - `@mui/material` (Material Design CSS Framework)
52 | - `@emotion/react`
53 |
54 | - **For Multilingual language support**
55 |
56 | - `i18next` (Multilingual translation)
57 |
58 | - **For development utils**
59 |
60 | - `eslint` (Code syntax checking)
61 | - `eslint-plugin-react-hooks`
62 | - `prettier`
63 |
64 | - **For testing**
65 |
66 | - `playwright`
67 |
68 | ## Installation
69 |
70 | You can easily clone a repository with just the npm command. (Recommend)
71 |
72 | ```shell
73 | $ npm init retron
74 | ```
75 |
76 | OR, Click **[Use this template](https://github.com/jooy2/retron/generate)** to instantly create your own project.
77 |
78 | OR, Clone this repo using below command.
79 |
80 | ```shell
81 | $ git clone https://github.com/jooy2/retron
82 | ```
83 |
84 | Then, install the dependency module.
85 |
86 | ```shell
87 | # via npm
88 | $ npm i
89 |
90 | # via yarn (https://yarnpkg.com)
91 | $ yarn install
92 |
93 | # via pnpm (https://pnpm.io)
94 | $ pnpm i
95 | ```
96 |
97 | You can test your project in the development environment using the following command:
98 |
99 | ```shell
100 | $ npm run dev
101 | ```
102 |
103 | ## Build
104 |
105 | **Retron** can build targeting Windows 10 or later, macOS 14.x or later, and major Linux distributions.
106 |
107 | ```shell
108 | # For Windows (.exe, .appx)
109 | $ npm run build:win
110 |
111 | # For macOS (.dmg)
112 | $ npm run build:mac
113 |
114 | # For Linux (.rpm, .deb, .snap)
115 | $ npm run build:linux
116 | ```
117 |
118 | The built packages can be found in `release/{version}` location.
119 |
120 | ### Build settings for projects that use Native Node modules
121 |
122 | For projects that use the **Native Node Module**, add the following script to your `package.json`: When installing dependencies, `electron-builder` will take care of any modules that require rebuilding.
123 |
124 | ```json
125 | {
126 | "scripts": {
127 | "postinstall": "electron-builder install-app-deps"
128 | }
129 | }
130 | ```
131 |
132 | ### What do I need to do for a multi-platform build?
133 |
134 | **macOS** is recommended if you want to build multiple platforms simultaneously on one platform. Because it can be configured with just a few very simple settings.
135 |
136 | You can perform multi-platform builds at once with the following command. Alternatively, you can just do it for the OS you want via the individual build commands above.
137 |
138 | ```shell
139 | $ npm run build
140 | ```
141 |
142 | ## Looking for Electron templates made with Vue?
143 |
144 | Also check out the `Vutron` project, which consists of Vite + Vue 3 + Vuetify + Electron.
145 |
146 | https://github.com/jooy2/vutron
147 |
148 | ## Contributing
149 |
150 | Anyone can contribute to the project by reporting new issues or submitting a pull request. For more information, please see [CONTRIBUTING.md](CONTRIBUTING.md).
151 |
152 | ## License
153 |
154 | Please see the [LICENSE](LICENSE) file for more information about project owners, usage rights, and more.
155 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8 |
9 | ## Our Standards
10 |
11 | Examples of behavior that contributes to a positive environment for our community include:
12 |
13 | - Demonstrating empathy and kindness toward other people
14 | - Being respectful of differing opinions, viewpoints, and experiences
15 | - Giving and gracefully accepting constructive feedback
16 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17 | - Focusing on what is best not just for us as individuals, but for the overall community
18 |
19 | Examples of unacceptable behavior include:
20 |
21 | - The use of sexualized language or imagery, and sexual attention or advances of any kind
22 | - Trolling, insulting or derogatory comments, and personal or political attacks
23 | - Public or private harassment
24 | - Publishing others' private information, such as a physical or email address, without their explicit permission
25 | - Other conduct which could reasonably be considered inappropriate in a professional setting
26 |
27 | ## Enforcement Responsibilities
28 |
29 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32 |
33 | ## Scope
34 |
35 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36 |
37 | ## Enforcement
38 |
39 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at https://cdget.com/contact. All complaints will be reviewed and investigated promptly and fairly.
40 |
41 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42 |
43 | ## Enforcement Guidelines
44 |
45 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46 |
47 | ### 1. Correction
48 |
49 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50 |
51 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52 |
53 | ### 2. Warning
54 |
55 | **Community Impact**: A violation through a single incident or series of actions.
56 |
57 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58 |
59 | ### 3. Temporary Ban
60 |
61 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62 |
63 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64 |
65 | ### 4. Permanent Ban
66 |
67 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68 |
69 | **Consequence**: A permanent ban from any sort of public interaction within the community.
70 |
71 | ## Attribution
72 |
73 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
74 |
75 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
76 |
77 | [homepage]: https://www.contributor-covenant.org
78 |
79 | For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
80 |
--------------------------------------------------------------------------------