Initial commit
3
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [leon3s]
|
15
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "cargo" # See documentation for possible values
|
||||
directory: "/src-tauri" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
66
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# Build the application
|
||||
|
||||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Cache Rust
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ./src-tauri/target
|
||||
key: ${{matrix.os}}-${{ hashFiles('./src-tauri/Cargo.lock') }}
|
||||
|
||||
# Cache Rust
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo
|
||||
key: ${{matrix.os}}-${{ hashFiles('./src-tauri/Cargo.lock') }}
|
||||
|
||||
# Cache Node
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ./node_modules
|
||||
key: ${{matrix.os}}-${{ hashFiles('./package-lock.json') }}
|
||||
|
||||
# Cache Next.js
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ./src-next/.next
|
||||
key: ${{matrix.os}}
|
||||
|
||||
- name: Install Node.js v20 LTS
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install Rust with Clippy
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install Tauri dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt install --reinstall ca-certificates
|
||||
sudo update-ca-certificates -f
|
||||
sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev -y
|
||||
|
||||
- name: Install node dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build application
|
||||
run: npm run tauri build
|
61
.github/workflows/eslint_clippy.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Run Eslint and Clippy
|
||||
|
||||
name: Eslint & Clippy
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
eslint_and_clippy:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Cache Rust
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ./src-tauri/target
|
||||
key: ${{ hashFiles('./src-tauri/Cargo.lock') }}
|
||||
|
||||
# Cache Rust
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo
|
||||
key: ${{ hashFiles('./src-tauri/Cargo.lock') }}
|
||||
|
||||
# Cache Node
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ./node_modules
|
||||
key: ${{ hashFiles('./package-lock.json') }}
|
||||
|
||||
- name: Install Node.js v16 LTS
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Rust with Clippy
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install Tauri dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -y
|
||||
|
||||
- name: Create empty 'dist' directory for Tauri generate context
|
||||
run: mkdir dist
|
||||
|
||||
- name: Install node dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run Eslint
|
||||
run: npm run lint
|
||||
|
||||
- name: Run Clippy
|
||||
run: npm run clippy
|
||||
|
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
209
README.md
Normal file
@ -0,0 +1,209 @@
|
||||
<div align="center">
|
||||
<h1>Nextauri</h1>
|
||||
<h3>❤️ Next.js + Tauri = Nextauri ❤️</h3>
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
|
||||
[](https://github.com/leon3s/nextauri)
|
||||
[](https://github.com/leon3s/nextauri)
|
||||
[](https://github.com/leon3s/nextauri)
|
||||
[](https://discord.gg/WV4Aac8uZg)
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
[](https://github.com/leon3s/nextauri/actions/workflows/eslint_clippy.yml)
|
||||
[](https://github.com/leon3s/nextauri/actions/workflows/build.yml)
|
||||
|
||||
<p>
|
||||
|
||||
<img src="https://download.next-hat.com/ressources/images/nextauri.png" />
|
||||
|
||||
</div>
|
||||
|
||||
## ❓ What is Nextauri ?
|
||||
|
||||
Nextauri is your favorite template for create cross-platform application using `Tauri` with `Next.js`. <br />
|
||||
It came with minimal best practice setup so you can add anything fit your need. <br />
|
||||
You can it use to develop `Windows`, `Linux` and `Mac` desktop application. <br />
|
||||
But Tauri plan to have a mobile compatibility in the futur !
|
||||
|
||||
## ✨ Key Features
|
||||
Nextauri integrates community-endorsed best practices with powerful tooling out of the box:
|
||||
|
||||
### Code Quality Assurance
|
||||
- Community-recommended ESLint configuration for Next.js projects
|
||||
- Rust best practices enforced through Clippy linter for Tauri
|
||||
|
||||
### Automated CI/CD Pipeline
|
||||
- GitHub Actions workflows that trigger when pushing and creating pull request:
|
||||
- Next.js project linting with ESLint
|
||||
- Tauri project analysis with Clippy
|
||||
- Production builds for all platforms:
|
||||
|
||||
• Linux
|
||||
|
||||
• Windows
|
||||
|
||||
• macOS
|
||||
|
||||
### Maintenance Automation
|
||||
- Automated weekly dependency updates keeping your stack fresh
|
||||
|
||||
## 💪 Motivation
|
||||
|
||||
Tauri is great to make secure cross platform application backed by `Rust` ! <br />
|
||||
It will load an `HTML` page inside a `Webview` and give the ability to do system call with `IPC`. <br />
|
||||
If you are familliar with `electron` or `nextron` you can see it as a very good replacement with smaller bundle size, smaller memory usage and more secure.
|
||||
|
||||
That make Next.js the perfect fit for bundle React application with Tauri since it comes with great Static-Site Generation `SSG` capability that will allow us to generates static files that will be included in the final binary.
|
||||
|
||||
The `benefit` of using Next.js `SSG` mode is pre-rendered React code in static HTML/JavaScript. <br /> This means your app will load faster. <br />
|
||||
React doesn't have to render the `HTML` on the client-side but will hydrate it on the first load if needed.
|
||||
|
||||
The `downside` is that we cannot use `getServerSideProps` or use any type of `data fetching` for rendering our page for a request. <br />
|
||||
Instead we will use `getStaticProps` to generate our page at build time. <br />
|
||||
|
||||
Note that if you still want the power of `Rust` for generate your page you may have a look at [Neon](https://neon-bindings.com). <br />
|
||||
It will allow you to call `Rust` code from Node.js !
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
Be sure you have [NodeJS](https://nodejs.org/en/) and [Rust](https://www.rust-lang.org/) installed on your system
|
||||
|
||||
1. See Tauri [prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites/) to prepare your system to build `Tauri`
|
||||
|
||||
2. Clone or fork this repository
|
||||
```sh
|
||||
git clone https://github.com/leon3s/nextauri
|
||||
cd nextauri
|
||||
```
|
||||
3. Install node dependencies
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
## 🎨 Developing
|
||||
|
||||
To get started you only need one command
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This will start both Tauri and Next.js in development mode.
|
||||
|
||||
> Note that tauri is waiting for an http server to be alive on localhost:3000. <br />
|
||||
> It's the default Next.js `port` while running in development
|
||||
|
||||
You can modify the `port` by updating `src-tauri/tauri.conf.json`. <br />
|
||||
|
||||
```json
|
||||
"beforeDevCommand": "npm run next dev -- -p 8080",
|
||||
"devPath": "http://localhost:8080",
|
||||
```
|
||||
|
||||
### Source structure
|
||||
|
||||
- `src-next/` are where Next.js files are located.
|
||||
- `src-tauri/` contain Tauri source files.
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
To test your application we recommand you to use [Cypress](https://www.cypress.io) using Tauri [mocking technique](https://tauri.app/v1/guides/testing/mocking).
|
||||
|
||||
If you want me to add `Cypress` as part of the template react to this [discussion](https://github.com/leon3s/nextauri/discussions/19).
|
||||
|
||||
You may also want to take a look to pre-alpha [WebDriver Testing](https://tauri.app/v1/guides/testing/webdriver/introduction) from Tauri.
|
||||
|
||||
## ⚡Production
|
||||
|
||||
To build in production you can do it in a single command.
|
||||
This will build and export Next.js and build Tauri for your current environnement.
|
||||
|
||||
```sh
|
||||
npm run tauri build
|
||||
```
|
||||
|
||||
Look into `src-tauri/tauri.conf.json` to tweak the settings,
|
||||
and refer to [Tauri](https://tauri.app/v1/guides/building) building documentation for more information.
|
||||
|
||||
|
||||
## ⚠️ Warning
|
||||
|
||||
If you are new to Next.js beware when working with it in development ! <br />
|
||||
It will start a `Nodejs` server in background in order to have `HMR` (Hot Module Replacement) capability but also `SSR` (Server Side Rendering).
|
||||
That mean your React/Typescript code have two execution context :
|
||||
|
||||
1. On the `Server`
|
||||
- Code is executed by Node.js runtime.
|
||||
- There is no notion of `window` or `navigator` it's part of `Browser API`
|
||||
- You cannot call `Tauri API` in this context since Tauri injection happen in the `Browser` side
|
||||
|
||||
2. On the `Browser`
|
||||
- Code is executed by the Tauri `Webview`
|
||||
- `Tauri API` will work fine and any other `Browser API` package `d3.js` for example
|
||||
|
||||
Note that your production code will alway be running in a `Browser` side context. <br />
|
||||
Since we use the `SSG` feature from Next.js no Node.js server will be packaged in production.
|
||||
|
||||
```
|
||||
referenceError: navigator is not defined
|
||||
```
|
||||
|
||||
This error can orcur when importing `@tauri-apps/api` for example. <br />
|
||||
There is 2 workarounds that you can use :
|
||||
|
||||
1. Dynamic component method
|
||||
|
||||
- Create your component
|
||||
```tsx
|
||||
import React from 'react'
|
||||
|
||||
import { window } from '@tauri-apps/api';
|
||||
|
||||
const { appWindow } = window;
|
||||
|
||||
export default function MyComponent() {
|
||||
<div>
|
||||
{appWindow.label}
|
||||
</div>
|
||||
}
|
||||
```
|
||||
|
||||
- Import your component
|
||||
```tsx
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
const MyComponent = dynamic(() => import("./path/to/my/component"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
1. Is browser method
|
||||
|
||||
```js
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
|
||||
const isBrowser = typeof window !== 'undefined'
|
||||
|
||||
if (isBrowser) {
|
||||
/// Code will only execute on browser side
|
||||
}
|
||||
```
|
||||
|
||||
In general to safely invoke `Tauri API` you should use it in `componentDidMount`, `useEffect` or on user based `events` that will be alway executed in client side.
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
To learn more about Tauri and Next.js, take a look at the following resources:
|
||||
|
||||
- [Tauri Guides](https://tauri.app/v1/guides/) - guide about Tauri.
|
||||
- [Tauri API](https://tauri.app/v1/api/js) - discover javascript Tauri api.
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn more about Next.js.
|
||||
- [Next.js Tutorial](https://nextjs.org/learn) - interactive Next.js tutorial.
|
4595
package-lock.json
generated
Normal file
35
package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "nextauri",
|
||||
"scripts": {
|
||||
"dev": "tauri dev",
|
||||
"tauri": "tauri",
|
||||
"lint": "next lint src-next",
|
||||
"next": "next src-next",
|
||||
"clippy": "cargo clippy --manifest-path ./src-tauri/Cargo.toml",
|
||||
"next-build": "next build src-next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.2.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.2.1",
|
||||
"@tauri-apps/plugin-dialog": "^2.2.0",
|
||||
"@tauri-apps/plugin-fs": "^2.2.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.2.0",
|
||||
"@tauri-apps/plugin-http": "^2.3.0",
|
||||
"@tauri-apps/plugin-notification": "^2.2.1",
|
||||
"@tauri-apps/plugin-os": "^2.2.0",
|
||||
"@tauri-apps/plugin-process": "^2.2.0",
|
||||
"@tauri-apps/plugin-shell": "^2.2.0",
|
||||
"next": "^15.1.7",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2.2.7",
|
||||
"@types/node": "^22.13.4",
|
||||
"@types/react": "^19.0.9",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"eslint": "^9.20.1",
|
||||
"eslint-config-next": "^15.1.7",
|
||||
"typescript": "^5.7.3"
|
||||
}
|
||||
}
|
3
src-next/.eslintrc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "next/core-web-vitals"
|
||||
}
|
1
src-next/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.next
|
18
src-next/app/layout.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import '../css/index.css';
|
||||
import AppLayout from 'components/AppLayout';
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<AppLayout>
|
||||
{children}
|
||||
</AppLayout>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
7
src-next/app/page.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import Home from 'containers/Home';
|
||||
|
||||
export default function Index() {
|
||||
return (
|
||||
<Home />
|
||||
)
|
||||
}
|
13
src-next/components/AppLayout/index.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
|
||||
export type AppLayoutProps = {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function AppLayout(props: AppLayoutProps) {
|
||||
return (
|
||||
<div className='app-layout'>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
6
src-next/components/AppLayout/style.css
Normal file
@ -0,0 +1,6 @@
|
||||
.app-layout {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
18
src-next/components/HomeBlock/index.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
export type HomeBlockProps = {
|
||||
url: string,
|
||||
title: string,
|
||||
description: string,
|
||||
};
|
||||
|
||||
const HomeBlock = (props: HomeBlockProps) => (
|
||||
<a target="_blank" rel="noreferrer" className='home-block-anchor' href={props.url}>
|
||||
<div className='home-block'>
|
||||
<h4 className='home-block-title'>📚 {props.title}</h4>
|
||||
<p>{props.description}</p>
|
||||
</div>
|
||||
</a>
|
||||
)
|
||||
|
||||
export default HomeBlock;
|
28
src-next/components/HomeBlock/style.css
Normal file
@ -0,0 +1,28 @@
|
||||
.home-block-anchor {
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #E9EBEE;
|
||||
padding: 0px 8px;
|
||||
width: 200px;
|
||||
height: fit-content;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.home-block-anchor:hover {
|
||||
transform: scale(1.1);
|
||||
background-color: #E5E7EB;
|
||||
}
|
||||
|
||||
.home-block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.home-block-title {
|
||||
font-size: 18px;
|
||||
margin: 8px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.home-block-description {
|
||||
font-size: 16px;
|
||||
}
|
43
src-next/containers/Home/index.tsx
Normal file
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
|
||||
import HomeBlock from 'components/HomeBlock';
|
||||
|
||||
const homeBlocks = [
|
||||
{
|
||||
id: 0,
|
||||
title: "Nextjs Doc",
|
||||
url: "https://nextjs.org/docs",
|
||||
description: "Find in-depth information about Next.js Features and API.",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
url: "https://tauri.app/v1/guides/",
|
||||
title: "Tauri Doc",
|
||||
description: "Find in-depth information about Tauri Features and API.",
|
||||
},
|
||||
]
|
||||
|
||||
const Home = () => (
|
||||
<div className='home-container'>
|
||||
<div className='home-header'>
|
||||
<h1 className='home-title'>
|
||||
Welcome to <a className='anchor-nextauri' rel="noreferrer" target="_blank" href="https://github.com/leon3s/nextauri">Nextauri</a>
|
||||
</h1>
|
||||
<p className='get-started'>
|
||||
Get started by editing <span className='get-started-span'>src-next/pages/index.tsx</span>
|
||||
</p>
|
||||
</div>
|
||||
<div className='home-blocks'>
|
||||
{homeBlocks.map((homeBlock) => (
|
||||
<HomeBlock
|
||||
key={homeBlock.id}
|
||||
title={homeBlock.title}
|
||||
url={homeBlock.url}
|
||||
description={homeBlock.description}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
export default Home;
|
39
src-next/containers/Home/style.css
Normal file
@ -0,0 +1,39 @@
|
||||
.home-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.home-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.home-title {
|
||||
margin: 40px;
|
||||
}
|
||||
|
||||
.get-started {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.get-started-span {
|
||||
background-color: #E5E7EB;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.anchor-nextauri {
|
||||
text-decoration: none;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.home-blocks {
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
flex: 1 1 150px;
|
||||
gap: 24px;
|
||||
}
|
25
src-next/css/index.css
Normal file
@ -0,0 +1,25 @@
|
||||
@import "../containers/Home/style.css";
|
||||
@import "../components/AppLayout/style.css";
|
||||
@import "../components/HomeBlock/style.css";
|
||||
|
||||
body, html {
|
||||
background: transparent;
|
||||
margin: 0px;
|
||||
min-height: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
|
||||
Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: visible;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#__next {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: transparent;
|
||||
}
|
5
src-next/next-env.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
21
src-next/next.config.mjs
Normal file
@ -0,0 +1,21 @@
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
|
||||
const internalHost = process.env.TAURI_DEV_HOST || 'localhost';
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Ensure Next.js uses SSG instead of SSR
|
||||
// https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
|
||||
output: 'export',
|
||||
// Set the distDir to the parent directory of the Next.js app.
|
||||
distDir: '../dist',
|
||||
// Note: This feature is required to use the Next.js Image component in SSG mode.
|
||||
// See https://nextjs.org/docs/messages/export-image-api for different workarounds.
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
// Configure assetPrefix or else the server won't properly resolve your assets.
|
||||
assetPrefix: isProd ? undefined : `http://${internalHost}:3000`,
|
||||
};
|
||||
|
||||
export default nextConfig;
|
43
src-next/tsconfig.json
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"jsx": "preserve",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2017"
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
"allowJs": true,
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"skipLibCheck": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"removeComments": false,
|
||||
"preserveConstEnums": true,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"../dist/types/**/*.ts",
|
||||
".next/types/**/*.ts"
|
||||
]
|
||||
}
|
4
src-tauri/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
WixTools
|
6182
src-tauri/Cargo.lock
generated
Normal file
38
src-tauri/Cargo.toml
Normal file
@ -0,0 +1,38 @@
|
||||
[package]
|
||||
name = "nextauri"
|
||||
version = "0.0.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
tauri-plugin-shell = "2"
|
||||
tauri-plugin-process = "2"
|
||||
tauri-plugin-clipboard-manager = "2.0.0-alpha.2"
|
||||
tauri-plugin-notification = "2"
|
||||
tauri-plugin-os = "2"
|
||||
tauri-plugin-http = "2"
|
||||
|
||||
[features]
|
||||
# by default Tauri runs in production mode
|
||||
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
||||
default = [ "custom-protocol" ]
|
||||
# this feature is used used for production builds where `devPath` points to the filesystem
|
||||
# DO NOT remove this
|
||||
custom-protocol = [ "tauri/custom-protocol" ]
|
||||
|
||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||
tauri-plugin-global-shortcut = "2"
|
3
src-tauri/build.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
14
src-tauri/capabilities/desktop.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"identifier": "desktop-capability",
|
||||
"platforms": [
|
||||
"macOS",
|
||||
"windows",
|
||||
"linux"
|
||||
],
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"global-shortcut:default"
|
||||
]
|
||||
}
|
89
src-tauri/capabilities/migrated.json
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"identifier": "migrated",
|
||||
"description": "permissions that were migrated from v1",
|
||||
"local": true,
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"fs:allow-read-file",
|
||||
"fs:allow-write-file",
|
||||
"fs:allow-read-dir",
|
||||
"fs:allow-copy-file",
|
||||
"fs:allow-mkdir",
|
||||
"fs:allow-remove",
|
||||
"fs:allow-remove",
|
||||
"fs:allow-rename",
|
||||
"fs:allow-exists",
|
||||
"core:window:allow-create",
|
||||
"core:window:allow-center",
|
||||
"core:window:allow-request-user-attention",
|
||||
"core:window:allow-set-resizable",
|
||||
"core:window:allow-set-maximizable",
|
||||
"core:window:allow-set-minimizable",
|
||||
"core:window:allow-set-closable",
|
||||
"core:window:allow-set-title",
|
||||
"core:window:allow-maximize",
|
||||
"core:window:allow-unmaximize",
|
||||
"core:window:allow-minimize",
|
||||
"core:window:allow-unminimize",
|
||||
"core:window:allow-show",
|
||||
"core:window:allow-hide",
|
||||
"core:window:allow-close",
|
||||
"core:window:allow-set-decorations",
|
||||
"core:window:allow-set-always-on-top",
|
||||
"core:window:allow-set-content-protected",
|
||||
"core:window:allow-set-size",
|
||||
"core:window:allow-set-min-size",
|
||||
"core:window:allow-set-max-size",
|
||||
"core:window:allow-set-position",
|
||||
"core:window:allow-set-fullscreen",
|
||||
"core:window:allow-set-focus",
|
||||
"core:window:allow-set-icon",
|
||||
"core:window:allow-set-skip-taskbar",
|
||||
"core:window:allow-set-cursor-grab",
|
||||
"core:window:allow-set-cursor-visible",
|
||||
"core:window:allow-set-cursor-icon",
|
||||
"core:window:allow-set-cursor-position",
|
||||
"core:window:allow-set-ignore-cursor-events",
|
||||
"core:window:allow-start-dragging",
|
||||
"core:webview:allow-print",
|
||||
"shell:allow-execute",
|
||||
"shell:allow-open",
|
||||
"dialog:allow-open",
|
||||
"dialog:allow-save",
|
||||
"dialog:allow-message",
|
||||
"dialog:allow-ask",
|
||||
"dialog:allow-confirm",
|
||||
"http:default",
|
||||
"notification:default",
|
||||
"global-shortcut:allow-is-registered",
|
||||
"global-shortcut:allow-register",
|
||||
"global-shortcut:allow-register-all",
|
||||
"global-shortcut:allow-unregister",
|
||||
"global-shortcut:allow-unregister-all",
|
||||
"os:allow-platform",
|
||||
"os:allow-version",
|
||||
"os:allow-os-type",
|
||||
"os:allow-family",
|
||||
"os:allow-arch",
|
||||
"os:allow-exe-extension",
|
||||
"os:allow-locale",
|
||||
"os:allow-hostname",
|
||||
"process:allow-restart",
|
||||
"process:allow-exit",
|
||||
"clipboard-manager:allow-read-text",
|
||||
"clipboard-manager:allow-write-text",
|
||||
"core:app:allow-app-show",
|
||||
"core:app:allow-app-hide",
|
||||
"dialog:default",
|
||||
"fs:default",
|
||||
"shell:default",
|
||||
"process:default",
|
||||
"clipboard-manager:default",
|
||||
"notification:default",
|
||||
"os:default",
|
||||
"http:default"
|
||||
]
|
||||
}
|
1
src-tauri/gen/schemas/acl-manifests.json
Normal file
1
src-tauri/gen/schemas/capabilities.json
Normal file
@ -0,0 +1 @@
|
||||
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["global-shortcut:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","dialog:default","fs:default","shell:default","process:default","clipboard-manager:default","notification:default","os:default","http:default"]}}
|
5668
src-tauri/gen/schemas/desktop-schema.json
Normal file
5668
src-tauri/gen/schemas/linux-schema.json
Normal file
BIN
src-tauri/icons/128x128.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
After Width: | Height: | Size: 974 B |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
After Width: | Height: | Size: 903 B |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
src-tauri/icons/icon.png
Normal file
After Width: | Height: | Size: 14 KiB |
19
src-tauri/src/main.rs
Normal file
@ -0,0 +1,19 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_notification::init())
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
.plugin(tauri_plugin_process::init())
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
65
src-tauri/tauri.conf.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"$schema": "..\\node_modules/@tauri-apps/cli\\schema.json",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run next-build",
|
||||
"beforeDevCommand": "npm run next dev",
|
||||
"frontendDist": "../dist",
|
||||
"devUrl": "http://localhost:3000"
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "",
|
||||
"targets": "all",
|
||||
"externalBin": [],
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
},
|
||||
"longDescription": "",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [],
|
||||
"shortDescription": "",
|
||||
"linux": {
|
||||
"deb": {
|
||||
"depends": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"productName": "nextauri",
|
||||
"mainBinaryName": "nextauri",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.nextauri.dev",
|
||||
"plugins": {},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"transparent": false,
|
||||
"decorations": true,
|
||||
"fullscreen": false,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"title": "nextauri",
|
||||
"width": 800,
|
||||
"useHttpsScheme": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
}
|
||||
}
|