2017-04-07 02:23:37 +02:00
![OpenSupports ](http://www.opensupports.com/logo.png )
2015-12-29 21:56:23 +01:00
2018-08-20 00:17:03 +02:00
[![Build Status ](https://travis-ci.org/opensupports/opensupports.svg?branch=master )](https://travis-ci.org/opensupports/opensupports) v4.2.0
2017-04-07 02:25:44 +02:00
2017-12-26 00:13:32 +01:00
OpenSupports is an open source ticket system built primarily 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
2017-12-26 00:13:32 +01:00
Here is a guide of how to set up the development environment in OpenSupports.
2017-04-07 02:23:37 +02:00
2016-04-17 23:43:11 +02:00
### Getting up and running FRONT-END (client folder)
2017-12-26 00:13:32 +01:00
1. Update: `sudo apt-get update`
2. Clone this repo: `git clone https://github.com/opensupports/opensupports.git`
3. 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`
2017-12-26 00:13:32 +01:00
4. Install npm: `sudo apt-get install npm`
5. Install gulp: `sudo npm install -g gulp`
2017-12-26 16:43:31 +01:00
6. Go to client: `cd opensupports/client`
2017-12-26 00:13:32 +01:00
7. Install dependencies: `npm install`
8. Rebuild node-sass: `npm rebuild node-sass`
9. Run: `gulp dev`
10. Go to the main app: `http://localhost:3000/app` or to the component demo `http://localhost:3000/demo`
11. Your browser will automatically be opened and directed to the browser-sync proxy address.
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
2017-12-26 00:13:32 +01:00
OpenSupport uses by default the port 3000, but this port could already be used. If this is the case, you can modify this in the file: `client/gulp/config.js` .
2016-06-30 22:58:04 +02:00
##### Production Task
2017-12-26 00:13:32 +01:00
Just as there is a `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-12-26 00:13:32 +01:00
**Reminder:** Notice there is `index.html` and `index.php` . The first one searches the backend server where `config.js` says 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
2017-12-26 00:13:32 +01:00
1. Do the steps described before.
2. Install mocha: `sudo npm install -g mocha`
3. Run `npm test` to run the tests.
2016-04-30 00:12:36 +02:00
2016-04-17 23:43:11 +02:00
### Getting up and running BACK-END (server folder)
2018-03-28 04:30:18 +02:00
1. Install [Docker CE ](https://docs.docker.com/install/ )
2. Go to the server folder: `cd opensupports/server`
3. Run `make build` to build the images
4. Run `make install` to install composer dependencies
2015-08-16 01:47:51 +02:00
2018-03-28 04:30:18 +02:00
- `make run` runs the backend and database
- `make stop` stop backend and database server
- `make log` show live server logs
- `make db` access to mysql database console
- `make sh` access to backend docker container bash
- `make test` run phpunit tests
2015-08-16 01:47:51 +02:00
2018-03-28 04:30:18 +02:00
Server api runs on `http://localhost:8080/`
2018-04-12 03:10:28 +02:00
Also, there's a *phpmyadmin* instance running on `http://localhost:6060/` ,
you can access with the username `root` and empty password
2017-12-07 00:58:28 +01:00
2018-05-11 00:59:56 +02:00
##### Building
Once you've installed dependencies for frontend and backend, you can run `./build.sh` and it will generate a zip file inside `dist/` ready for distribution. You can use this file to install OpenSupports on a serving following the [installation instructions ](https://github.com/opensupports/opensupports/wiki/Installation )
2016-06-30 22:59:34 +02:00
##### BACKEND API RUBY TESTING
2018-03-28 04:30:18 +02:00
1. Go to tests folder: `cd opensupports/tests`
2. Run `make install` to install ruby and its the required dependencies
- `make run` for running tests (database will be cleared)
- `make clear` for clearing database
2016-07-15 00:53:24 +02:00
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
2017-12-26 00:13:32 +01:00
1. Install Java if you don't have it yet:
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
2017-12-26 00:13:32 +01:00
3. Extract the file from the zip and run it:
2016-07-15 00:53:24 +02:00
`java -jar fakeSMTP-2.0.jar`
2017-12-26 00:13:32 +01:00
4. Set the port to 7070 and start the SMTP server.
2016-07-15 00:53:24 +02:00
2017-04-07 02:23:37 +02:00
5. Every time the application sends an email, it will be reflected there.