Building the hive of education
Menu:
Wisply can be downloaded using the git
command through Go
- Open a terminal window
- Type
go get github.com/cristian-sima/Wisply
- In case you have problems with this step, it means you do not have Git.
- DigitalOcean has a very good tutorial about how to install Git on Ubuntu here.
- Now, you have Wisply. Check the next steps to see how to install it.
We tested Wisply and we ensure you that it works on two main operating systems: Microsoft Windows (10) and Ubuntu. We provide bellow the details of how to set up and install Wisply on your system. Until you can start Wisply you need to install the language, framework and the server for database. Please follow the next steps.
Wisply comes with special tools which help you to quickly set up and run the application.
Wisply is created in Go (or Golang). You can find a lot of information about this language on the official web page. Google even provides a virtual tour for the language here
- Open a terminal window
- Type
sudo apt-get install golang
- Type
Y
and press enter
GOROOT
is the path where Go is installed. You do not have to change it, but in case you want typeexport GOROOT=/usr/local/go
GOPATH
is the path to the Go workspace. Here Go will download Wisply. So, typeexport GOPATH=$HOME/path
wherepath
is the path where you want to store Wisply- You have to save the changes. Type
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
Wisply is using beego framework. This framework provides a tool which simplifies the process of maintaining Wisply. In order to install it:
- Open a terminal window
- Type
go get github.com/beego/bee
. If the script ends and there is nothing displayed, it means it is working - For more information about this tool, please go to official beego tool website
Wisply needs a SQL database in order to store its data. We will show you the steps to set up a database.
If you already have a MySQL server, skip this step.
- Connect to your hosting server
- Open a terminal window
- In order to get the package, type
sudo apt-get install mysql-server
- Type
Y
to confirm - You will be asked to enter a password for root user (administrator). Write down or remember the password. I strongly recommend you to enter a strong password (at least 8 characters and to contain at least one number or a special character). If you want to generate a strong password, you can use a password generator like this.
- Repeat the password and wait for the system to install MySQL. When it stops, you can see
start/running, process 28412
- Once the installation is completed, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:
sudo netstat -tap | grep mysql
You will see a list of details regarding the service such as port and process id.
It's very quick to do it.
Wisply comes with a special installer which helps you to quickly set up and run the application. In order to use the installer, make sure you have a MySQL server (see above)
How to use the installer?
- Open a terminal window
- Type
cd /the/path/to/Wisply/directory/
where path/to/Wisply/directory is the path on your server to the Wisply directory - We need to allow the installer to execute. Type
chmod u+x util/ubuntu/install/installer.sh
and typechmod u+x util/ubuntu/install
- In order to run the installer, type
bash /util/ubuntu/installer.sh
- Follow the steps shown by installer:
In order to start Wisply, go to Wisply directory and type bash util/ubuntu/start.sh
. You will see the wizard for running. This script detects if there was any previous version of Wisply started and it tells you.
If you want to stop Wisply, go to Wisply directory and type bash util/ubuntu/stop.sh
.
Wisply provides several utilities which you can use during the development process. You can find these utilities in the directory util/windows/Utilities
.
- Format Wisply - It can be used to format the code of all the packages. It closes itself after formatting.
- Start bee go tool - this script runs the Wisply server and displays a command prompt. Also, it re-builds Wisply after each file has been modified.
- Test Wisply - It shows a command promt with the result of testing Wisply. In case the tests were not good, the user can type
y
to re-test Wisply, or type any other character to exit. - Start goconvey - It is a shortcut to start the goconvey server. It can be used for a more detailed testing (you need to install this first).
- CommitSQL - When it is executed it exports the entire SQL database scheme (without data) to the file
util/ubuntu/install/src/sql/Wisply.sql
. Thus, it can be used to quickly update the database schema. - SQLShoot - It is like CommitSQL, but it exports only the data. I can be used to take a photo of current data, which must be preserved.
- GenerateJsDoc - A shortcut to the JSDoc generated which generates the HTML documentation for JavaScript code. (Please edit the
conf.json
and change the paths to yours)
- Go to directory
util/windows/Utilities
- Edit every file and change the path where the Wisply directory is
- In order to start a script, double click on the file
I recommend XAMPP. This software contains the MySQL server and it has a good user interface. You can download XAMPP from here.
- Open XAMPP, start Apache and MySQL modules
- For the MySQL module, click ADMIN.
- Go to
Databases
- Create a new database with the name
wisply
- Go to Users and create a user
- Assign the user all the privileges for the database
wisply
- Click on database
wisply
- Choose
import
- Upload the file from
/util/ubuntu/install/src/sql/Wisply.sql
- Update the file
conf/database/default.json
with the details of this database (username, password) - Double click
/util/windows/Start bee go tool.bat
- You are now running Wisply!
Wisply is evolving. You may want to get the last version on your server, but installing each version is time consuming. Thus, in order to quickly update Wisply, please follow the next steps:
The update is not affecting the current configuration (information about database, about server) and does not delete the existing data from database.
There are 2 ways to update Wisply:
- Just code changes
- Open a terminal window
- Type
bash util/ubuntu/update-and-run.sh
This utility stops Wisply, updates it and runs the
- The schema or data of database are changed
- Open a terminal window
- Type
bash util/ubuntu/update-just-code.sh
and wait. This command stops Wisply and updates the code - Install Wisply as highlighted bellow.
- Stop Wisply
- Open a terminal window
- Type
go get -u github.com/cristian-sima/Wisply
- If there was no message shown, it means the update was successful
Note: In case the new version has a different SQL schema, there is a need to install the application again (follow the installer steps, highlighted above)
Wisply considers that documentation is an essential element to maintain an application. The software provides a lot of information regarding documentation.
Every method or property that is exported is well documented. You can see all the documentation by runnning the go fmt
The documentation is according to the official google style. You can find it [here]( http://blog.golang.org/godoc-documenting-go-code).
JavaScript has a lot of documentation. The documentation passes the guidelines of JSDoc. The documentation can be accessed in browser (see bellow). The HTML files have been generated using JSDoc 3. The html file are in the directory util/doc/js
.
Note!
- Due to security reasons, the JavaScript documentation can't be accessed using the Wisply server (for instance http://wisply.me/doc/js). You can access it by using the absolute path in your browser (C:\path\util\doc\js\index.html for Windows)
Wisply has a number of automate functional tests. In order to run these you need to follow the next steps:
- Install Node.JS
- Navigate to
tests/acceptance/node
- Install Jasmine
Note: You need to install this into
/tests/acceptance/node/
- Install webdriver Note: You need to install this into /tests/acceptance/node/
- Install selenium server
- Type
java -jar /your/download/directory/selenium-server-standalone-2.42.2.jar
in order to start the server - Run tests by typing
wdio wdio.conf.js
The Shell code is documentated according to the guidelines presented by Inquisitor. Also, the utilities for Windows have comments in order to adapt them to your system
This section is optional and it contains information regarding the development progress which you may find it useful.
If you want to edit the source files, but you do not what editor to choose, I recommend Atom. It is simple, easy to use and fast. Also, I suggest these plugins (the description is the official one):
- atom-pretiffy Pretiffy your HTML
- auto-indent This package will allow you to auto-indent your current file. Use the auto-indent:apply command.
- docblockr A helper package for writing documentation.
- go-plus It saves you a lot of time Adds
gocode
,gofmt
,goimports
,go vet
,golint
,go build
andgo test
functionality for the go language. - linter A Base Linter with Cow Powers
- linter-jshint Linter plugin for JavaScript, using jshint
Do you have a preferred editor or a plugin which I did not mention? Great, please suggest it!