Skip to content

Commit c7d9655

Browse files
Merge pull request #257 from gridaco/desktop
Desktop TP
2 parents d53d976 + 3a925f4 commit c7d9655

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1837
-813
lines changed

desktop/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.14.0

desktop/CONTRIBUTING.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Contributing to Grida Desktop on macOS
2+
3+
Thank you for your interest in contributing to Grida Desktop! We appreciate your contributions and welcome improvements, bug fixes, and new ideas. This guide is tailored specifically for macOS users.
4+
5+
## Table of Contents
6+
- [Prerequisites](#prerequisites)
7+
- [Setting Up Your Environment](#setting-up-your-environment)
8+
- [Development Workflow](#development-workflow)
9+
10+
## Prerequisites
11+
12+
Before you start, ensure you have the following installed on your Mac:
13+
14+
- **Homebrew**
15+
[Installation instructions](https://brew.sh/)
16+
17+
- **Node.js**
18+
We recommend using Node.js 18 or later. Install via Homebrew or [nvm](https://github.com/nvm-sh/nvm).
19+
20+
- **pnpm**
21+
This project uses pnpm for package management.
22+
23+
- **Mono and Wine** (only if you plan to build Windows binaries)
24+
Install these via Homebrew:
25+
```sh
26+
brew install mono
27+
brew install --cask wine-stable
28+
29+
30+
## Setting Up Your Environment
31+
32+
33+
1. Clone the Repository
34+
35+
```bash
36+
git clone https://github.com/gridaco/grida.git
37+
cd grida/desktop
38+
```
39+
40+
2. Install Dependencies
41+
42+
```bash
43+
pnpm install
44+
```
45+
46+
3. Configure Environment Variables
47+
48+
Create a .env file in the project root (if required) using the provided .env.example as a guide.
49+
50+
51+
## Development Workflow
52+
53+
```bash
54+
pnpm run dev
55+
```
56+
57+
58+
## Troubleshooting Mono and Wine Installation
59+
60+
If you still see:
61+
```
62+
Error: You must install both Mono and Wine on non-Windows
63+
```
64+
65+
after installing both, try the following steps:
66+
67+
1. **Verify Installation**
68+
```sh
69+
mono --version
70+
wine --version
71+
```
72+
73+
You might see `“Wine Stable.app” Not Opened`. Go to System Preferences > Security & Privacy and allow the app to open.
74+
75+
Check if you have Rosetta installed. If not, you can install it by running:
76+
```sh
77+
softwareupdate --install-rosetta
78+
```
79+
80+
81+
## Linux Build on macOS using Docker
82+
83+
If you're on macOS and want to build Linux packages for Grida Desktop, you can use Docker to simulate a Linux environment.
84+
85+
### Prerequisites
86+
87+
- **Docker Desktop for Mac:**
88+
Install Docker from [Docker's website](https://www.docker.com/products/docker-desktop).
89+
90+
- **Project Dependencies:**
91+
Ensure your project uses Node.js and pnpm (or npm) as specified in the repository.
92+
93+
### Steps to Build Linux Packages
94+
95+
1. **Pull a Linux Docker Image:**
96+
Use an image that matches your build environment, for example, Node 18 on Debian Bullseye.
97+
```sh
98+
docker pull node:22-bullseye

desktop/Info.plist

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<string>Grida</string>
99
<key>CFBundleIdentifier</key>
1010
<string>co.grida.desktop</string>
11+
<key>CFBundleURLName</key>
12+
<string>co.grida.desktop</string>
13+
<key>CFBundleURLSchemes</key>
14+
<array>
15+
<string>grida</string>
16+
</array>
1117
<key>CFBundleDocumentTypes</key>
1218
<array>
1319
<dict>
@@ -22,7 +28,7 @@
2228
<key>LSHandlerRank</key>
2329
<string>Owner</string>
2430
<key>CFBundleTypeIconFile</key>
25-
<string>CFBundleTypeIconFile.icns</string>
31+
<string>dotgrida.icns</string>
2632
</dict>
2733
</array>
2834
</dict>

desktop/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Grida Desktop App
2+
3+
https://github.com/gridaco/grida/releases/latest
4+
5+
6+
# Building locally
7+
8+
See the [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions on how to build and run the project locally.

desktop/forge.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dotenv.config();
1111

1212
const config: ForgeConfig = {
1313
packagerConfig: {
14-
extraResource: ["mac/CFBundleTypeIconFile.icns"],
14+
extraResource: ["mac/dotgrida.icns"],
1515
name: "Grida",
1616
asar: true,
1717
appBundleId: "co.grida.desktop",
@@ -51,7 +51,7 @@ const config: ForgeConfig = {
5151
renderer: [
5252
{
5353
name: "main_window",
54-
config: "vite.renderer.config.ts",
54+
config: "vite.renderer.config.mjs",
5555
},
5656
],
5757
}),
@@ -70,6 +70,7 @@ const config: ForgeConfig = {
7070
publishers: [
7171
{
7272
name: "@electron-forge/publisher-github",
73+
platforms: ["darwin", "win32", "linux"],
7374
config: {
7475
repository: {
7576
owner: "gridaco",

desktop/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<title>Desktop</title>
66
</head>
77
<body>
8-
<script type="module" src="/src/renderer.ts"></script>
8+
<script type="module" src="/src/renderers/login.ts"></script>
99
</body>
1010
</html>
File renamed without changes.

desktop/package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@grida/desktop",
33
"productName": "Grida",
4-
"version": "0.0.0",
4+
"version": "0.0.1",
55
"packageManager": "[email protected]",
66
"description": "My Electron application description",
77
"main": ".vite/build/main.js",
@@ -10,7 +10,7 @@
1010
"dev": "electron-forge start",
1111
"package": "electron-forge package",
1212
"make": "electron-forge make",
13-
"publish": "electron-forge publish",
13+
"forge:publish": "electron-forge publish",
1414
"lint": "eslint --ext .ts,.tsx ."
1515
},
1616
"devDependencies": {
@@ -25,25 +25,36 @@
2525
"@electron-forge/publisher-github": "^7.6.1",
2626
"@electron-forge/shared-types": "^7.6.1",
2727
"@electron/fuses": "^1.8.0",
28+
"@tailwindcss/vite": "^4.0.7",
2829
"@types/electron-squirrel-startup": "^1.0.2",
30+
"@types/react": "18.2.58",
31+
"@types/react-dom": "18.2.19",
2932
"@typescript-eslint/eslint-plugin": "^5.0.0",
3033
"@typescript-eslint/parser": "^5.0.0",
34+
"@vitejs/plugin-react": "^4.3.4",
3135
"dotenv": "^16.4.7",
3236
"electron": "34.2.0",
3337
"eslint": "^8.0.1",
3438
"eslint-plugin-import": "^2.25.0",
3539
"ts-node": "^10.0.0",
3640
"typescript": "~4.5.4",
37-
"vite": "^5.0.12"
41+
"vite": "^6.1.1"
3842
},
3943
"keywords": [],
4044
"author": {
41-
"name": "Universe",
42-
"email": "universe@grida.co"
45+
"name": "Grida",
46+
"email": "hello@grida.co"
4347
},
4448
"license": "MIT",
4549
"dependencies": {
50+
"clsx": "^2.1.1",
4651
"electron-squirrel-startup": "^1.0.1",
52+
"keytar": "^7.9.0",
53+
"react": "^18.2.0",
54+
"react-dom": "^18.2.0",
55+
"scheduler": "^0.25.0",
56+
"tailwind-merge": "^2.2.2",
57+
"tailwindcss": "^4.0.7",
4758
"update-electron-app": "^3.1.1"
4859
}
4960
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import clsx from "clsx";
2+
3+
export const GridaLogo = ({
4+
className,
5+
size = 24,
6+
}: {
7+
className?: string;
8+
size?: number;
9+
}) => {
10+
return (
11+
<svg
12+
width={size}
13+
height={size}
14+
viewBox="0 0 42 42"
15+
className={clsx("fill-foreground", className)}
16+
xmlns="http://www.w3.org/2000/svg"
17+
>
18+
<path
19+
fillRule="evenodd"
20+
clipRule="evenodd"
21+
d="M27.6584 13.8687L27.5796 28.2889L41.5271 41.9212V27.7373V27.5009L41.525 27.4989C41.3978 19.9495 35.2382 13.8687 27.6584 13.8687Z"
22+
/>
23+
<path
24+
fillRule="evenodd"
25+
clipRule="evenodd"
26+
d="M26.02 7.17866C19.0948 7.95373 13.7111 13.8284 13.7111 20.9606V27.5797L13.9475 42L0 28.3677V13.8687V13.7899L0.000217973 13.7901C0.042516 6.16679 6.23543 0 13.8687 0C19.1022 0 23.6587 2.89894 26.02 7.17866Z"
27+
/>
28+
</svg>
29+
);
30+
};

desktop/src/index.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
body {
2-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
3-
Arial, sans-serif;
4-
margin: auto;
5-
max-width: 38rem;
6-
padding: 2rem;
7-
}
1+
@import "tailwindcss";
2+
3+
4+
.draggable{
5+
app-region: drag;
6+
}

0 commit comments

Comments
 (0)