-
Notifications
You must be signed in to change notification settings - Fork 13
Setup the Development Environment
The GCentral Package Website & API is currently written in PHP with Symfony with website frontend developed with VueJS. A LabVIEW wrapper for the APIs is in development with other languages planned for the future.
We recommend you start by setting up a Virtual Machine (VM) first. While using virtual machines isn't required, Sam Taggart, CLA and LabVIEW Champion of SAS presents some good reasons you should:
Setup depends on the Virtualization software you choose. As Sam stated the two major virtualization technologies are:
-
- VMWare Workstation Player
- ''The free version is available for non-commercial, personal and home use. We also encourage students and non-profit organizations to benefit from this offering.''
-
- VirtualBox
- ''VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. VirtualBox is free, open source software.''
From Sam's blog:
"There are basically 2 ways to create the initial VM to use for your base VM. One way is to create a VM from scratch and install Windows using an iso. In VMWare, it is pretty straightforward and there are plenty of tutorials online if you get stuck. A quicker way is if you already have a physical machine is to use a free tool from VMWare. It takes a physical machine and converts it into a virtual machine. "
For instructions on using VirtualBox to set up your first VM, see the online manual here. After you have one VM up and running, you can clone it using the Clone Virtual Machine wizard. (See the online manual here).
Again quoting Sam:
"Whichever one you use, you want to be conscious of the size of the hard drive. You want to make it as small as possible and yet have enough space to do whatever development you need to do. Somewhere in the 50-100Gb range seems to work well. NOTE: You can expand it later. Also there may be an option to preallocate the entire harddrive space. Don’t do that. We want it to grow as we fill it to save space on the host."
Be sure to consider what software you want installed on your base VM. It is recommended that once you get an empty Windows installation completed that you clone the VM before you add additional software to it. You may also want to include common software in this base VM such as your web browser of choice, fancier text editors, Git tools, etc. This way if you need to change software versions you can start cleanly without all the gremlins that get left behind when uninstalling software or having to sit through setting up a VM from scratch again.
Also note that this guide will be focused on Windows development but the web development can be performed in a Linux environment just as well. We won't hold your hand for getting that setup though some of the additional tooling created for the Windows environment will obvious not be available or work slightly differently in Linux.
We'll also be posting videos to YouTube to help guide you through the setup process, so stay tuned for those!
-
Git for Windows
- You may also want to use a graphical interface for Git such as SourceTree, GitKraken, TortoiseGit, etc.
-
VS Code or your text editor / IDE of choice
- VS Code is a full-featured lightweight IDE for working with a variety of languages and also provides a plethora of plugins to make development easier.
- If using VS Code you'll want the following extensions for working with this project:
-
nadim-vscode.symfony-extension-pack
- PHP Intellisense and basic features for Symfony -
tmrdh.symfony-helper
- Additional tools for Symfony development -
whatwedo.twig
- Twig template engine formatting & tools -
octref.vetur
- VueJS development tools, particularly for single-file components
-
Note: The webserver and associated tooling for testing the website locally during development is now managed by our automated setup script described below!
These downloads are necessary to help contribute to the various wrappers for the GCentral APIs
-
LabVIEW Community Edition - NI's free version of their development environments that our official API wrappers are developed in.
- Community Editions of LabVIEW are free for non-commercial and non-academic uses!
GCentral uses the Forking workflow which is similar to the Gitflow workflow but feature branches are developed in your own forked repository and you setup a secondary remote for your local copy that's typically named "upstream" to merge in updates that took place while you were working on your new feature. Developers can also collaborate on features in development by pulling/pushing each others' forks in addition to the upstream official repository.
Open the GCentral GitHub repo in a browser. The repository is located on GitHub at: https://github.com/gcentral/Website where you can get your own fork of the repository. Read this GitHub article to understand the importance of forking a branch.
Select File
--->Clone / New...
- Enter the Clone URL
- Set your local directory on your hard drive
- Click
Clone
To enable generating the Vue and JavaScript assets as well as run a webserver locally for testing all you need to do is run the setup-dev.bat
file in the web
folder of the repository. Once that's done run the serve.bat
file to start the web server for local testing. Here's an example of forking, cloning, and setting up the development environment: