From 4528c740220388800a710a6c58a0d11e97fef409 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Mon, 25 Dec 2017 20:13:32 -0300 Subject: [PATCH 1/6] Minor fixes to the README --- README.md | 71 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 45894a2d..db7607d1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/opensupports/opensupports.svg?branch=master)](https://travis-ci.org/opensupports/opensupports) v4.1.1 -OpenSupports is an open source ticket system built primarly with PHP and ReactJS. +OpenSupports is an open source ticket system built primarily with PHP and ReactJS. Please, visit our website for more information: [http://www.opensupports.com/](http://www.opensupports.com/) ## Requirements @@ -10,52 +10,53 @@ Please, visit our website for more information: [http://www.opensupports.com/](h * MySQL 4.1+ ## Development -Here is a guide of how to set up the development environment in OpenSupports +Here is a guide of how to set up the development environment in OpenSupports. ### Getting up and running FRONT-END (client folder) -0. update `sudo apt-get update` -1. Clone this repo -2. Install node 4.x version +1. Update: `sudo apt-get update` +2. Clone this repo: `git clone https://github.com/opensupports/opensupports.git` +3. Install node 4.x version: - `sudo apt-get install curl` - `curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -` - `sudo apt-get install -y nodejs` -3. Install npm `sudo apt-get install npm` -4. Install gulp `sudo npm install -g gulp` -5. Go to repo `cd os4-react/client` -6. Install dependences `npm install` -7. Rebuild node-sass `npm rebuild node-sass` -8. Run `gulp dev` -9. Go to the main app: `http://localhost:3000/app` or the component demo `http://localhost:3000/demo` -10. 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). +4. Install npm: `sudo apt-get install npm` +5. Install gulp: `sudo npm install -g gulp` +6. Go to client: `cd os4-react/client` +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). 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. +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`. ##### Production Task -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. +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. -**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`. +**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`. #### 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 +1. Do the steps described before. +2. Install mocha: `sudo npm install -g mocha` +3. Run `npm test` to run the tests. ### Getting up and running BACK-END (server folder) -1. Clone this repo +1. Clone this repo: `git clone https://github.com/opensupports/opensupports.git` 2. [Install PHP 5.6](https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/) 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` +5. Go to the server folder: `cd os4-react/server` 6. Run `composer install` -7. Run the server with `php -S localhost:8080` +7. Run the server with: `php -S localhost:8080` ##### Create MySQL Database -1. Install mysql-server +1. Install mysql-server: Ubuntu @@ -66,41 +67,41 @@ Just as there is the `gulp dev` task for development, there is also a `gulp prod `sudo yum install mysql-server` `/etc/init.d/mysqld start` -2. Access the mysql shell +2. Access the MySQL shell: `mysql -u root` -3. Create a new database +3. Create a new database: `CREATE DATABASE development;` -4. Run the MySQL server +4. Run the MySQL server: `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` -Test can run by using executing `run-tests.sh` file. +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 tests folder: `cd os4-react/tests` +5. Install project dependencies: `sudo gem install bundler` +Tests can run by using executing the `run-tests.sh` file. ##### BACKEND FAKE SMTP SERVER If you're doing development, you can use a FakeSMTP server to see the mails that are being sent. -1. Install java if you don't have it jet +1. Install Java if you don't have it yet: `sudo apt-get install default-jre` `sudo apt-get install default-jdk` 2. [Download FakeSMTP](https://nilhcem.github.io/FakeSMTP/download.html) -3. Extract the file from the zip and run it +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 +4. Set the port to 7070 and start the SMTP server. 5. Every time the application sends an email, it will be reflected there. From e3ca2c5e52b32945b9ead5c63d5813d7718f224a Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Mon, 25 Dec 2017 23:06:58 -0300 Subject: [PATCH 2/6] Fixes a typo and a path in the backend docs --- server/API_STANDARD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/API_STANDARD.md b/server/API_STANDARD.md index d7ebb5d5..693e1e27 100644 --- a/server/API_STANDARD.md +++ b/server/API_STANDARD.md @@ -2,7 +2,7 @@ OpenSupports can work completely fine without a frontend. You could only use thi This documentation is intended for application developers who are looking to integrate OpenSupports with other applications. ## Request/Response Interface -The API server is located in the `api/` folder of your OpenSupports' instance folder. +The API server is located in the `server/` folder of your OpenSupports' instance folder. **All the requests must be done via POST method**, with the exception of the path `/system/download`. The response object has the following JSON structure: @@ -37,4 +37,4 @@ This request will return you the session data with an `userId` and a `token`. Yo If you don't pass the userId and token, a `NO_PERMISSION` error will be returned. -Additionally, if there is no users (only staff members), you can check a ticket you created by providing your email and the ticketNumber to the `/ticket/check` path. This path will return you a `token` and `ticketNumber` you will use to comment, retrieve, or do any other operations to the ticket. +Additionally, if there are no users (only staff members), you can check a ticket you created by providing your email and the ticketNumber to the `/ticket/check` path. This path will return you a `token` and `ticketNumber` you will use to comment, retrieve, or do any other operations to the ticket. From 193bc0ec049816e4baa34b05c96020851f36fd1b Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Tue, 26 Dec 2017 12:43:31 -0300 Subject: [PATCH 3/6] changes os4-react to opensupports in docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index db7607d1..d4bc024f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Here is a guide of how to set up the development environment in OpenSupports. - `sudo apt-get install -y nodejs` 4. Install npm: `sudo apt-get install npm` 5. Install gulp: `sudo npm install -g gulp` -6. Go to client: `cd os4-react/client` +6. Go to client: `cd opensupports/client` 7. Install dependencies: `npm install` 8. Rebuild node-sass: `npm rebuild node-sass` 9. Run: `gulp dev` @@ -50,8 +50,8 @@ Just as there is a `gulp dev` task for development, there is also a `gulp prod` 2. [Install PHP 5.6](https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/) 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 the server folder: `cd os4-react/server` -6. Run `composer install` +5. Go to the server folder: `cd opensupports/server` +6. Run: `composer install` 7. Run the server with: `php -S localhost:8080` ##### Create MySQL Database @@ -84,7 +84,7 @@ Just as there is a `gulp dev` task for development, there is also a `gulp prod` 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 tests folder: `cd os4-react/tests` +4. Go to tests folder: `cd opensupports/tests` 5. Install project dependencies: `sudo gem install bundler` Tests can run by using executing the `run-tests.sh` file. From fc05f9b9056028ebcf01a7d66932c7466567ca71 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Tue, 26 Dec 2017 18:33:31 -0300 Subject: [PATCH 4/6] Minor fix to en.js --- client/src/data/languages/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 3bbf473a..40403bd2 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -358,7 +358,7 @@ export default { 'ACTIVITY_DEPARTMENT_CHANGED_THIS': 'changed department of this ticket to ', 'ACTIVITY_PRIORITY_CHANGED_THIS': 'changed priority of this ticket to', 'DATE_PREFIX': 'on', - 'LEFT_EMPTY_DATABASE': 'Left empty for automatic database creation', + 'LEFT_EMPTY_DATABASE': 'Leave empty for automatic database creation', 'REMEMBER_ME': 'Remember me', 'EMAIL_LOWERCASE': 'email', 'PASSWORD_LOWERCASE': 'password', From 472dd6e8bb4a186319ffdef73204ff0ff619a5a6 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Sun, 31 Dec 2017 00:25:36 -0300 Subject: [PATCH 5/6] Reverts wrong renaming of a path --- server/API_STANDARD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/API_STANDARD.md b/server/API_STANDARD.md index 693e1e27..05ee15c4 100644 --- a/server/API_STANDARD.md +++ b/server/API_STANDARD.md @@ -2,7 +2,7 @@ OpenSupports can work completely fine without a frontend. You could only use thi This documentation is intended for application developers who are looking to integrate OpenSupports with other applications. ## Request/Response Interface -The API server is located in the `server/` folder of your OpenSupports' instance folder. +The API server is located in the `api/` folder of your OpenSupports' instance folder. **All the requests must be done via POST method**, with the exception of the path `/system/download`. The response object has the following JSON structure: From b54fadc75f00171043f54c41bdeb4af92358386e Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Tue, 20 Feb 2018 10:18:42 -0300 Subject: [PATCH 6/6] Fixes step 5 instruction in backend api ruby testing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e11bde2a..05077543 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Just as there is a `gulp dev` task for development, there is also a `gulp prod` 2. Install MySQL dev dependencies: `sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev` 3. Install bundle: `sudo gem install bundler` 4. Go to tests folder: `cd opensupports/tests` -5. Install project dependencies: `sudo gem install bundler` +5. Install project dependencies: `bundle install` Tests can run by using executing the `run-tests.sh` file. ##### BACKEND FAKE SMTP SERVER