Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liuliu/electron app #244

Closed
wants to merge 20 commits into from
Closed

Liuliu/electron app #244

wants to merge 20 commits into from

Conversation

liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Sep 5, 2024

To run in dev mode: run yarn dev in the root directory.

Changes:

  1. add package.json in root directory, put web and graphql-server in workspaces.

  2. In main:

  • background.ts starts the main process, creates the app window and loads the built files.
  • createGraphqlSeverProcess executes a child process to spawn the GraphQL server.
  • preload.ts establishes the IPC handler for communication between the renderer and the main process.
  1. In web:
  • Most changes happen in pages, commented getServerSideProps because server side rendering is not allowed.
  • In serverConfig.tsx, use ipc to get the api/config, since api route is not allowed in nextron build.
  1. In graphql-server:
    After the app is built, writing schema.gql file in the app is not allowed since the app is readonly. We will write the file to the user's application data folder specified by process.env.SCHEMA_PATH. This path is set in background.ts as follows: const schemaPath = path.join(userDataPath, "schema.gql");

Existing issues:
Distributing the built macOS application have an issue due to the "com.apple.Quarantine" attribute applied when the app is not downloaded from an Apple-sanctioned source. A temporary workaround involves disabling Gatekeeper for the app with the command:
xattr -c <path/to/application.app>

A more permanent solution requires getting an Apple Developer account, a Team ID for our developer team, and add this ID into the build configuration:

"notarize": {
        "teamId": "id"
      },

@liuliu-dev liuliu-dev closed this Sep 13, 2024
@liuliu-dev liuliu-dev deleted the liuliu/electron-app branch January 23, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant