2017-04-07 02:23:37 +02:00
![OpenSupports ](http://www.opensupports.com/logo.png )
2015-12-29 21:56:23 +01:00
2017-04-07 02:23:37 +02:00
[![Build Status ](https://travis-ci.org/opensupports/opensupports.svg?branch=master )](https://travis-ci.org/opensupports/opensupports)
2017-04-07 02:25:44 +02:00
2017-04-07 02:27:12 +02:00
OpenSupports is an open source ticket system built primarly with PHP and ReactJS.
2017-04-07 02:23:37 +02:00
Please, visit our website for more information: [http://www.opensupports.com/ ](http://www.opensupports.com/ )
## Requirements
* PHP 5.6+
* MySQL 4.1+
## Development
Here is a guide of how to set up the development environment in OpenSupports
2016-04-17 23:43:11 +02:00
### Getting up and running FRONT-END (client folder)
2015-12-26 23:57:34 +01:00
0. update `sudo apt-get update`
2015-12-26 23:46:48 +01:00
1. Clone this repo
2015-12-29 16:44:08 +01:00
2. Install node 4.x version
2015-12-29 21:56:23 +01:00
- `sudo apt-get install curl`
- `curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -`
- `sudo apt-get install -y nodejs`
2015-12-26 23:46:48 +01:00
3. Install npm `sudo apt-get install npm`
4. Install gulp `sudo npm install -g gulp`
2016-09-22 23:23:53 +02:00
5. Go to repo `cd os4-react/client`
2016-01-26 22:05:09 +01:00
6. Install dependences `npm install`
7. Rebuild node-sass `npm rebuild node-sass`
2015-12-29 16:44:08 +01:00
8. Run `gulp dev`
9. Go to the main app: `http://localhost:3000/app` or the component demo `http://localhost:3000/demo`
2016-01-26 22:05:09 +01:00
10. Your browser will automatically be opened and directed to the browser-sync proxy address
2016-03-05 01:06:40 +01:00
12. Use `gulp dev --api` to disable fixtures and use the real php server api (it must be running at :8080).
2015-12-26 23:43:39 +01:00
2016-01-26 22:05:09 +01:00
Now that `gulp dev` is running, the server is up as well and serving files from the `/build` directory. Any changes in the `/src` directory will be automatically processed by Gulp and the changes will be injected to any open browsers pointed at the proxy address.
2015-08-16 01:47:51 +02:00
2016-06-30 22:58:04 +02:00
##### Production Task
2017-04-07 02:23:37 +02:00
Just as there is the `gulp dev` task for development, there is also a `gulp prod` task for putting the project into a production-ready state. This will run each of the tasks, while also adding the image minification task discussed above.
2016-06-30 22:58:04 +02:00
2017-04-07 02:23:37 +02:00
**Reminder:** Notice there is `index.html` and `index.php` . The firstone searches the backend server where `config.js` say it, the second one uses `/api` to find the server. If you want to run OpenSupports in a single server, then use `index.php` .
2016-06-30 22:58:04 +02:00
2016-04-30 00:12:36 +02:00
#### Frontend Unit Testing
1. Do the steps described before
2. Install mocha "sudo npm install -g mocha"
3. Run `npm test` to run the tests
2016-04-17 23:43:11 +02:00
### Getting up and running BACK-END (server folder)
2015-08-16 01:47:51 +02:00
2016-01-26 22:05:09 +01:00
1. Clone this repo
2016-06-30 22:58:04 +02:00
2. [Install PHP 5.6 ](https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/ )
2016-03-05 01:06:40 +01:00
3. [Create MySQL Database ](#markdown-header-create-mysql-database )
4. [Install composer ](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-14-04 )
5. Go to `cd os4-react/api`
6. Run `composer install`
7. Run the server with `php -S localhost:8080`
2015-08-16 01:47:51 +02:00
2016-06-30 22:59:34 +02:00
##### Create MySQL Database
2015-10-19 00:25:54 +02:00
2015-10-19 00:22:07 +02:00
1. Install mysql-server
2015-08-16 01:47:51 +02:00
2015-10-19 00:22:07 +02:00
Ubuntu
2015-08-16 01:47:51 +02:00
2015-10-19 00:22:07 +02:00
`sudo apt-get install mysql-server`
2016-01-26 22:05:09 +01:00
2015-10-19 00:22:07 +02:00
Cent OS
2015-08-16 01:47:51 +02:00
2015-10-19 00:22:07 +02:00
`sudo yum install mysql-server`
`/etc/init.d/mysqld start`
2015-08-16 01:47:51 +02:00
2016-01-26 22:05:09 +01:00
2. Access the mysql shell
2015-08-16 01:47:51 +02:00
2016-06-30 22:58:04 +02:00
`mysql -u root`
2015-08-16 01:47:51 +02:00
2015-10-19 01:37:04 +02:00
3. Create a new database
2015-08-16 01:47:51 +02:00
2016-06-30 22:58:04 +02:00
`CREATE DATABASE development;`
2015-08-16 01:47:51 +02:00
2016-06-30 23:04:33 +02:00
4. Run the MySQL server
2015-10-19 00:29:29 +02:00
2016-06-30 22:59:34 +02:00
`sudo /etc/init.d/mysql start`
##### BACKEND API RUBY TESTING
1. Install ruby `sudo apt-get install ruby-full`
2. Install mysql dev dependencies `sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev`
3. Install bundle `sudo gem install bundler`
4. Go to test folder `cd os4-react/tests`
5. Install project dependencies `sudo gem install bundler`
2016-07-15 00:53:24 +02:00
Test can run by using executing `run-tests.sh` file.
2016-07-15 00:58:54 +02:00
##### BACKEND FAKE SMTP SERVER
If you're doing development, you can use a FakeSMTP server to see the mails that are being sent.
2016-07-15 00:53:24 +02:00
2016-07-15 00:58:54 +02:00
1. Install java if you don't have it jet
2016-07-15 00:53:24 +02:00
`sudo apt-get install default-jre`
`sudo apt-get install default-jdk`
2016-07-15 00:58:54 +02:00
2. [Download FakeSMTP ](https://nilhcem.github.io/FakeSMTP/download.html )
2016-07-15 00:53:24 +02:00
3. Extract the file from the zip and run it
`java -jar fakeSMTP-2.0.jar`
4. Set the port to 7070 and start the SMTP server
2017-04-07 02:23:37 +02:00
5. Every time the application sends an email, it will be reflected there.