nodeguy/content---docs-guides-getting-startedc-9-e-20f.058d1e127795274285bb.js

1 line
11 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{131:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return u}));n(0);var o=n(161);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function r(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var i={sidebar_label:"Getting started",title:"Getting started"},l=[{value:"Developer environment",id:"developer-environment",children:[{value:"Setting up on macOS",id:"setting-up-on-macos",children:[]},{value:"Setting up on Windows",id:"setting-up-on-windows",children:[]},{value:"Setting up on Linux",id:"setting-up-on-linux",children:[]},{value:"A Good Editor",id:"a-good-editor",children:[]},{value:"Hello World",id:"hello-world",children:[]},{value:"Now what?",id:"now-what",children:[]}]}],s={rightToc:l},p="wrapper";function u(e){var t=e.components,n=r(e,["components"]);return Object(o.b)(p,a({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"NodeGui enables you to create desktop applications with JavaScript. You could see it\nas a lightly modified variant of the Node.js runtime that is focused on desktop applications\ninstead of web servers."),Object(o.b)("p",null,"NodeGui is also an efficient JavaScript binding to a cross platform graphical user interface\n(GUI) library ",Object(o.b)("inlineCode",{parentName:"p"},"Qt"),". Qt is one of the most mature and efficient library for building desktop applications.\nThis enabled NodeGui to be extrememly memory and CPU efficient as compared to other popular Javascript Desktop GUI solutions. A hello world app built with NodeGui runs on less than 20Mb of memory."),Object(o.b)("h2",{id:"developer-environment"},"Developer environment"),Object(o.b)("p",null,"To turn your operating system into an environment capable of building desktop apps with NodeGui, you would need Node.js, npm,a code editor of your choice, and a rudimentary understanding of your operating system's command line client."),Object(o.b)("p",null,"Along with these, there are a few operating system dependent instructions that are listed below."),Object(o.b)("h3",{id:"setting-up-on-macos"},"Setting up on macOS"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Requirements:")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"NodeGui supports macOS 10.10 (Yosemite) and up. NodeGui currently only supports 64bit OS."),Object(o.b)("li",{parentName:"ul"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(o.b)("a",a({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(o.b)("li",{parentName:"ul"},"Make, GCC v7"),Object(o.b)("li",{parentName:"ul"},"Currently supported Node.Js versions are 12.x and up.")),Object(o.b)("p",null,"We strongly suggest you use some kind of version manager for Node.Js. This would allow you to switch to any version of nodejs quite easily. We recommend ",Object(o.b)("inlineCode",{parentName:"p"},"nvm"),": ",Object(o.b)("a",a({parentName:"p"},{href:"https://github.com/nvm-sh/nvm"}),"https://github.com/nvm-sh/nvm")),Object(o.b)("p",null,"Confirm that both ",Object(o.b)("inlineCode",{parentName:"p"},"node")," and ",Object(o.b)("inlineCode",{parentName:"p"},"npm")," are available by running:"),Object(o.b)("pre",null,Object(o.b)("code",a({parentName:"pre"},{className:"language-sh"}),"# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\n")),Object(o.b)("p",null,"If both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a ",Object(o.b)("a",a({parentName:"p"},{href:"#a-good-editor"}),"code editor")," suited\nfor JavaScript development."),Object(o.b)("h3",{id:"setting-up-on-windows"},"Setting up on Windows"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"NodeGui supports Windows 7 and later versions  attempting to develop NodeGui\napplications on earlier versions of Windows might not work. NodeGui currently only supports 64bit OS.")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Requirements:")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Visual studio 2017 and up."),Object(o.b)("li",{parentName:"ul"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(o.b)("a",a({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(o.b)("li",{parentName:"ul"},"Currently supported Node.Js versions are 12.x and up.")),Object(o.b)("p",null,"We strongly suggest you use some kind of version manager for Node.Js. This would allow you to switch to any version of nodejs quite easily. We recommend ",Object(o.b)("inlineCode",{parentName:"p"},"nvm"),": ",Object(o.b)("a",a({parentName:"p"},{href:"https://github.com/nvm-sh/nvm"}),"https://github.com/nvm-sh/nvm")),Object(o.b)("p",null,"We strongly recommend Powershell as preferred terminal in Windows."),Object(o.b)("p",null,"Confirm that both ",Object(o.b)("inlineCode",{parentName:"p"},"node")," and ",Object(o.b)("inlineCode",{parentName:"p"},"npm")," are available by running:"),Object(o.b)("pre",null,Object(o.b)("code",a({parentName:"pre"},{className:"language-powershell"}),"# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\n")),Object(o.b)("p",null,"If both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a ",Object(o.b)("a",a({parentName:"p"},{href:"#a-good-editor"}),"code editor")," suited\nfor JavaScript development."),Object(o.b)("h3",{id:"setting-up-on-linux"},"Setting up on Linux"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"NodeGui currently supports Ubuntu 16.04 and Debian 10 and up. Although other Linux distributions can also be easily supported. NodeGui currently only supports 64bit OS.")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Requirements:")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Make, GCC v7"),Object(o.b)("li",{parentName:"ul"},"CMake 3.1 and up (Installation instructions can be found here: ",Object(o.b)("a",a({parentName:"li"},{href:"https://cmake.org/install/"}),"https://cmake.org/install/"),")"),Object(o.b)("li",{parentName:"ul"},"Currently supported Node.Js versions are 12.x and up."),Object(o.b)("li",{parentName:"ul"},"On Ubuntu and Ubuntu-based distros it is advisable to run ",Object(o.b)("inlineCode",{parentName:"li"},"sudo apt-get update"),", followed by ",Object(o.b)("inlineCode",{parentName:"li"},"sudo apt-get install pkg-config build-essential"))),Object(o.b)("p",null,"We strongly suggest you use some kind of version manager for Node.Js. This would allow you to switch to any version of nodejs quite easily. We recommend ",Object(o.b)("inlineCode",{parentName:"p"},"nvm"),": ",Object(o.b)("a",a({parentName:"p"},{href:"https://github.com/nvm-sh/nvm"}),"https://github.com/nvm-sh/nvm")),Object(o.b)("p",null,"Confirm that both ",Object(o.b)("inlineCode",{parentName:"p"},"node")," and ",Object(o.b)("inlineCode",{parentName:"p"},"npm")," are available by running:"),Object(o.b)("pre",null,Object(o.b)("code",a({parentName:"pre"},{className:"language-sh"}),"# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\n")),Object(o.b)("p",null,"If both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a ",Object(o.b)("a",a({parentName:"p"},{href:"#a-good-editor"}),"code editor")," suited\nfor JavaScript development."),Object(o.b)("h3",{id:"a-good-editor"},"A Good Editor"),Object(o.b)("p",null,"We might suggest two free popular editors:\nGitHub's ",Object(o.b)("a",a({parentName:"p"},{href:"https://atom.io/"}),"Atom")," and Microsoft's ",Object(o.b)("a",a({parentName:"p"},{href:"https://code.visualstudio.com/"}),"Visual Studio Code"),". Both of\nthem have excellent JavaScript support."),Object(o.b)("p",null,"If you are one of the many developers with a strong preference, know that\nvirtually all code editors and IDEs these days support JavaScript."),Object(o.b)("h3",{id:"hello-world"},"Hello World"),Object(o.b)("p",null,"Clone and run the code in this tutorial by using the\n",Object(o.b)("a",a({parentName:"p"},{href:"https://github.com/nodegui/nodegui-starter"}),Object(o.b)("inlineCode",{parentName:"a"},"nodegui/nodegui-starter"))," repository."),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Note"),": Running this requires ",Object(o.b)("a",a({parentName:"p"},{href:"https://git-scm.com"}),"Git")," and ",Object(o.b)("a",a({parentName:"p"},{href:"https://www.npmjs.com/"}),"npm"),"."),Object(o.b)("pre",null,Object(o.b)("code",a({parentName:"pre"},{className:"language-sh"}),"# Clone the repository\n$ git clone https://github.com/nodegui/nodegui-starter\n# Go into the repository\n$ cd nodegui-starter\n# Install dependencies\n$ npm install\n# Run the app\n$ npm start\n")),Object(o.b)("p",null,"That's it!"),Object(o.b)("p",null,"Congratulations! You've successfully run and modified your first NodeGui app."),Object(o.b)("h3",{id:"now-what"},"Now what?"),Object(o.b)("p",null,"If you're curious to learn more about NodeGui, continue on to the ",Object(o.b)("a",a({parentName:"p"},{href:"/docs/guides/tutorial"}),"tutorial"),"."))}u.isMDXComponent=!0},161:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return c}));var o=n(0),a=n.n(o),r=a.a.createContext({}),i=function(e){var t=a.a.useContext(r),n=t;return e&&(n="function"==typeof e?e(t):Object.assign({},t,e)),n},l=function(e){var t=i(e.components);return a.a.createElement(r.Provider,{value:t},e.children)};var s="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},u=Object(o.forwardRef)((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,s=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&-1===t.indexOf(o)&&(n[o]=e[o]);return n}(e,["components","mdxType","originalType","parentName"]),u=i(n),c=o,d=u[l+"."+c]||u[c]||p[c]||r;return n?a.a.createElement(d,Object.assign({},{ref:t},s,{components:n})):a.a.createElement(d,Object.assign({},{ref:t},s))}));function c(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[s]="string"==typeof e?e:o,i[1]=l;for(var c=2;c<r;c++)i[c]=n[c];return a.a.createElement.apply(null,i)}return a.a.createElement.apply(null,n)}u.displayName="MDXCreateElement"}}]);