A starter project for building modern cross-platform desktop apps in Go, HTML, Typescript and React.
A starter project for building modern cross-platform desktop apps in Go, HTML, Typescript and React.
This is really nothing more than a Typescript-flavoured "Create React App"-bootstrapped app combined with a modified example from the fine "Lorca" project.
Check out those projects for how to use each component.
Either just clone this repo and start coding, or repeat the simple steps taken to create it yourself to get that warm fuzzy feeling of having done it all "by hand".
Since this project builds on Lorca, you need Chrome installed to develop and run your app. You also need recent enough versions of Go (1.12), Node.js (v8.X) and npm (v5.2) installed.
git clone --depth=1 https://github.com/erkkah/lorca-ts-react-starter.git <NEWPROJECTNAME>
cd <NEWPROJECTNAME>
npm install
npm start
npx create-react-app <NEWPROJECTNAME> --typescript
cd <NEWPROJECTNAME>
go mod init <APPNAME>
scripts
part from package.json
to your project./app
in browser.js
to <APPNAME>
from abovenpm-run-all
since the scripts need it: npm install --save-dev npm-run-all
npm start
In the project directory, you can run:
npm start
Runs the app in the development mode. The "backend" Go part will launch Chrome to display the HTML content.
The page will reload if you make edits to the React parts. You will also see any lint errors in the console.
npm run build
Builds the app for production, creating a single executable will all assets bundled. It correctly bundles React in production mode and optimizes the build for the best performance.
npm test
Runs the test suites for both Go and React parts.
To launch React tests in watch mode, run npm run react:test -- --watchAll=true