Welcome to Temzone Desktop, a cross-platform desktop application built with Electron and Next.js from Temtem Interactive Map.
This guide will help you get up and running the application in just a few minutes.
Before getting started, make sure you have the following tools installed on your development machine:
- Node.js (version 18.13.0)
- npm (the Node.js package manager, which should be installed with Node.js)
To install the dependencies for a Nextron project, you'll need to use the npm install command
. This command reads the dependencies
and devDependencies
sections of the package.json file and installs the packages listed there.
For example, to install all of the dependencies you can run the following command in the project directory:
npm install
You can also use npm install
to install a specific package by providing the package name as an argument. For example:
npm install next
This will install the next
package and add it to the dependencies section of the package.json file.
To start the application, the environment variables must be set. In a Nextron project, you should create a file called .env.development
and .env.production
at the rendered directory. In this file, you can define environment variables in the following format:
NEXT_PUBLIC_VARIABLE_NAME=value
In order to expose a variable to the browser you have to prefix the variable with NEXT_PUBLIC
. These environment variables will be available to the application through the process.env object in Node.js.
The Temzone application requires certain environment variables to be set, specifically several related to Firebase such as Firebase API key, Firebase project ID and Firebase Auth Domain. These are the credentials necessary for the application to access Firebase services and the Temzone's backend:
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_TEMZONE_BASE_URL=
Navigate to the project directory and run the following command to start the development server:
npm run dev
This will start the Next.js development server, as well as the Electron application. As you make changes to the code, the development server will automatically reload the Electron window to reflect the changes.
To build the application for production, run the following command:
npm run build
This will build the Next.js app and package it with Electron, creating a production ready build in the dist directory.
In addition to the npm run build
command, Nextron provides several other commands for building the application for specific platforms. These commands are:
npm run build:all
: This command will build the application for all platforms (Windows, Mac and Linux).npm run build:win32
: This command will build the application for 32-bit Windows.npm run build:win64
: This command will build the application for 64-bit Windows.npm run build:mac
: This command will build the application for Mac.npm run build:linux
: This command will build the application for Linux.
Each of these commands will create a production ready build of the application in the dist directory, with the specific platform as a subdirectory.
Note that these commands are only available if you have the necessary tools and dependencies installed on your development machine for the specified platform. For example, to build for Mac or Linux, you'll need to have the relevant tools and dependencies installed on a Mac or Linux machine.
To run the tests for the application, you can use the following command:
npm run test
The tests use the Jest testing framework, which is included as a devDependency in the project's package.json file. By default, Jest will look for files with a .test.js
or .test.jsx
extension in the project directory.
This project is licensed under the terms of the MIT license.