![Issues][issues-shield]
![Contributor Shield][contributor-shield]
[issues-shield]:https://img.shields.io/github/issues/sailpoint-oss/electron-identitynow-starter?label=Issues
[contributor-shield]:https://img.shields.io/github/contributors/sailpoint-oss/electron-identitynow-starter?label=Contributors
[product-screenshot]: ./assets/images/electron-identitynow-starter-output.png
- [About the project](#about-the-project)
- [Project Structure](#project-structure)
- [Sveltekit-App](#sveltekit-app)
- [Sveltekit-Build](#sveltekit-build)
- [Electron-App](#electron-app)
- [Using the starter](#using-the-starter)
- [Local Development](#local-development)
- [Svletekit](#svletekit)
- [Electron](#electron)
- [Build the application from source](#build-the-application-from-source)
- [Contribute](#contribute)
- [License](#license)
- [Discuss](#discuss)
## About the project
This Electron IdentityNow starter is a template for a desktop application you can use build out GUI applications that integrate with IdentityNow.
(back to top)
## Project Structure
The current implementation of this app has three main folders:
- `Sveltekit-App`
- `Sveltekit-Build`
- `Electron-App`
The purpose of each of these folders is to hold a different portion of the total app, or rather different stages of the application.
(back to top)
### Sveltekit-App
The `Sveltekit-App` folder contains the main content of the application, this is where you will likely be doing 90% of your development.
SvelteKit is a framework that allows easy development of applications utilizing both frontend and backend components and modern security standards, and when you are ready to build it allows you to compile your code into numerous different deployment methods using different adapters (static html, node server, edge or lambda functions).
[SvelteKit can be explored more here](https://kit.svelte.dev).
If you use this starter to build on top of, you will get a number of things implemented right out of the box:
- an OAuth Flow
- the SailPoint SDK
- a Desktop build of your app
- TypeScript
- SvelteKit
- TailwindCSS
(back to top)
### Sveltekit-Build
When you are ready to build your application, running the build command in the `Sveltekit-App` folder, will build the application using the node adapter for SvelteKit, and the build will be placed in the folder `Sveltekit-Build/src`
(back to top)
### Electron-App
The `Electron-App` folder contains the code relevant to the electron portion of the application, this is where you determine the window theme, size, shape, and behavior as well as the startup logic for the application.
Currently when running the electron application, the `handler` that is generated from the sveltekit build is imported and passed to an express server that runs the application, an electron window is then opened pointing at that local express server, so once the app is running you can even open the app directly in a web browser if you prefer.
(back to top)
## Using the starter
### Local Development
#### Svletekit
To start the sveltekit dev server, navigate to the `./Sveltekit-App` folder and run `npm run dev`.
This will start the local dev server and you can access the application at `http://localhost:3000`.
#### Electron
> Note: You will need to have the sveltekit app built already in order to start the electron app.
To start the electron app, navigate to the `./Electron-App` folder and run `npm run start`.
### Build the application from source
Prerequisites:
* To build the application from source you will need NPM installed. You can find instructions on how to install NPM [here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
Once you have NPM installed, you can clone this repository and run the following commands in the specified order and folders:
Go to the folder: `./Sveltekit-App`
First, run this command:
```bash
npm install
```
Then run this command:
```bash
npm run build
```
Next, go to the folder: `./Electron-App`
First, run this command:
```bash
npm install
```
Then, run this command:
```bash
npm run build
```
As long as there are no errors during the build process, the built application binaries will then be located in the `./Electron-App/out` folder.
## Contribute
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion to improve this project, please fork the repo and create a pull request. You can also make a suggestion by opening an issue with the tag `enhancement`.
Don't forget to give the project a star! Thanks again!
Follow these steps to make contributions:
1. Fork the project.
2. Create your feature branch: `git checkout -b feature/AmazingFeature`
3. Commit your changes: `git commit -m 'Add some AmazingFeature'`
4. Push to the branch: `git push origin feature/AmazingFeature`
5. Open a pull request.
(back to top)
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
(back to top)
## Discuss
You can go to the [SailPoint Developer Community Forum](https://developer.sailpoint.com/discuss/tag/electron-identitynow-starter) to discuss this tool with other users!
(back to top)