OpenSupports v4.0
Getting up and running FRONT-END (client folder)
- update
sudo apt-get update - Clone this repo
- Install node 4.x version
sudo apt-get install curlcurl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -sudo apt-get install -y nodejs
- Install npm
sudo apt-get install npm - Install gulp
sudo npm install -g gulp - Go to repo
cd os4-react/client - Install dependences
npm install - Rebuild node-sass
npm rebuild node-sass - Run
gulp dev - Go to the main app:
http://localhost:3000/appor the component demohttp://localhost:3000/demo - Your browser will automatically be opened and directed to the browser-sync proxy address
- Use
gulp dev --apito 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.
Production Task
Just as there is the gulp dev task for development, there is also a gulp prod task for putting your project into a production-ready state. This will run each of the tasks, while also adding the image minification task discussed above. There is also an empty gulp deploy task that is included when running the production task. This deploy task can be fleshed out to automatically push your production-ready site to your hosting setup.
Reminder: When running the production task, gulp will not fire up the express server and serve your index.html. This task is designed to be run before the deploy step that may copy the files from /build to a production web server.
Frontend Unit Testing
- Do the steps described before
- Install mocha "sudo npm install -g mocha"
- Run
npm testto run the tests
Getting up and running BACK-END (server folder)
- Clone this repo
- Install PHP 5.6
- Create MySQL Database
- Install composer
- Go to
cd os4-react/api - Run
composer install - Run the server with
php -S localhost:8080
Create MySQL Database
-
Install mysql-server
Ubuntu
sudo apt-get install mysql-serverCent OS
sudo yum install mysql-server/etc/init.d/mysqld start -
Access the mysql shell
mysql -u root -
Create a new database
CREATE DATABASE development; -
Run the MySQL server
sudo /etc/init.d/mysql start
BACKEND API RUBY TESTING
- Install ruby
sudo apt-get install ruby-full - Install mysql dev dependencies
sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev - Install bundle
sudo gem install bundler - Go to test folder
cd os4-react/tests - Install project dependencies
sudo gem install bundlerTest can run by using executingrun-tests.shfile.
BACKEND FAKE SMTP SERVER
If you're doing development, you can use a FakeSMTP server to see the mails that are being sent.
-
Install java if you don't have it jet
sudo apt-get install default-jresudo apt-get install default-jdk -
Extract the file from the zip and run it
java -jar fakeSMTP-2.0.jar -
Set the port to 7070 and start the SMTP server
-
Every time the application sends an email, it will be reflected there.