Skip to content

Commit

Permalink
🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
saulotarsobc committed Apr 22, 2024
1 parent 1a9a45c commit fc61ef9
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 49 deletions.
50 changes: 14 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,27 @@
# Electron + Typescript + Next
# SC - OBS Control LS

<div align="center">
<!-- <img alt="Build Status" src="https://img.shields.io/travis/saulotarsobc/scripts.svg"> -->
<!-- <img alt="Test Coverage" src="https://img.shields.io/codecov/c/github/saulotarsobc/scripts.svg"> -->
<img alt="Version" src="https://img.shields.io/github/v/release/saulotarsobc/electronjs-with-nextjs.svg">
<img alt="Version" src="https://img.shields.io/github/v/release/saulotarsobc/sc-obs-control-ls.svg">
<!-- <img alt="Downloads" src="https://img.shields.io/npm/dt/package-name.svg"> -->
<img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg">
<img alt="Contributors" src="https://img.shields.io/github/contributors/saulotarsobc/electronjs-with-nextjs.svg">
<img alt="Last Commit" src="https://img.shields.io/github/last-commit/saulotarsobc/electronjs-with-nextjs.svg">
<img alt="Stars" src="https://img.shields.io/github/stars/saulotarsobc/electronjs-with-nextjs.svg">
<img alt="Contributors" src="https://img.shields.io/github/contributors/saulotarsobc/sc-obs-control-ls.svg">
<img alt="Last Commit" src="https://img.shields.io/github/last-commit/saulotarsobc/sc-obs-control-ls.svg">
<img alt="Stars" src="https://img.shields.io/github/stars/saulotarsobc/sc-obs-control-ls.svg">
</div>

---

## Use
> Electron + Typescript + Next
```sh
git clone https://github.com/saulotarsobc/electron-next-ts.git;
cd electron-next-ts;
bun install;
bun start;
```

## Help

- [Electronjs - documentation](https://www.electronjs.org/pt/docs/latest/)
- [What is CODE SIGNING | Importance of code sign | Code sing in electron js](https://youtu.be/a27EtDuUGYg)
- [Electron Builder Tutorial: How to Sign Your Electron App's Code](https://youtu.be/WnipZaYslRc)
- [Electron AutoUpdater Tutorial: How to Ship Updates to Your Electron App on Mac](https://youtu.be/CtuV6hho2U0)
- [Electron Mini Tutorials](https://youtube.com/playlist?list=PL_2VhOvlMk4XLzvGgqbmjF9PkVgUGMDcJ&si=7r5qeWiby_1d6vCr)
- [Hacking Electron Applications](https://youtu.be/jkJWA_CWrQs)
- [Any Linux Target](https://www.electron.build/configuration/linux)
---

### NPM Commands
## Download

- **dev:** Initiates the application, first building it with `npm run build-electron` and then running it with Electron.
- **clean:** Removes output and build directories, including `dist`, `main`, `frontend/out`, and `frontend/.next`, using the `rimraf` package.
- **build-frontend:** Compiles frontend code using Next.js and generates build artifacts.
- **build-electron:** Compiles backend code using TypeScript (`tsc -p backend`).
- **build:** Executes the cleaning process (`npm run clean`) and then builds both frontend and backend.
- **pack-app:** Packages the application for distribution, building frontend, backend, and the overall package using Electron Builder with the `--dir` option.
- **dist:** Performs the cleaning and building process, then creates distribution artifacts using Electron Builder.
- **type-check:** Performs type checking for TypeScript code in both frontend and backend.
- **publish:** Publishes the application for the Windows platform using Electron Builder.
- **publish-linux:** Publishes the application for the Linux platform using Electron Builder.
- **postinstall:** Executes the `electron-builder install-app-deps` command after dependency installation to ensure correct application dependencies.
- **release:** Initiates the process of creating a release package for the application using Electron Builder.
- **libs-update:** Updates project dependencies using `ncu` (npm-check-updates) and then reinstalls dependencies using `npm install`.
```sh
git clone https://github.com/saulotarsobc/sc-obs-control-ls;
cd sc-obs-control-ls;
npm install;
npm run dev;
```
10 changes: 4 additions & 6 deletions backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { initLogs } from "./utils/initLogs";

function createWindow() {
const win = new BrowserWindow({
// width: 700,
// height: 400,
width: 900,
height: 900,
maxWidth: 900,
maxHeight: 900,
width: 700,
height: 400,
minWidth: 700,
minHeight: 400,
webPreferences: {
nodeIntegration: false,
contextIsolation: false,
Expand Down
8 changes: 4 additions & 4 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ win:
icon: ./build/icon.png
publisherName: Saulo INC
artifactName: ${productName}-Setup-${version}.${ext}
signAndEditExecutable: true
verifyUpdateCodeSignature: true
signingHashAlgorithms:
- sha256
# signAndEditExecutable: true
# verifyUpdateCodeSignature: true
# signingHashAlgorithms:
# - sha256

# Mac
mac:
Expand Down
18 changes: 18 additions & 0 deletions frontend/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ReactNode } from "react";
import Head from "next/head";

import { displayName, version, description } from "../../package.json";
const pageTitle = `${displayName} - v${version}`;

export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<Head>
<title>{pageTitle}</title>
<meta name="description" content={description} />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
{children}
</>
);
}
7 changes: 6 additions & 1 deletion frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import Layout from "@/components/Layout";
import "@/styles/globals.css";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
}
2 changes: 1 addition & 1 deletion frontend/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from "next/document";

export default function Document() {
return (
<Html lang="en">
<Html lang="pt-br">
<Head />
<body>
<Main />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sc-obs-control-ls",
"displayName": "SC - OBS Conctorl LS - 1.0.0",
"displayName": "SC - OBS Conctorl LS",
"version": "1.0.1",
"description": "Conrola o obs studio via api websocket",
"icon": "build/icon.png",
Expand Down

0 comments on commit fc61ef9

Please sign in to comment.