Scouts' activity planning app.
These instructions will help you setup working environment for development and testing purposes.
See deployment on how to deploy to production.
- Make sure tosu-backend is running
- Clone the repository
$ git clone [email protected]:partio-scout/tosu-frontend.git
- Install npm packages
$ npm install
- Run the project
$ npm start
The app will be running at http://localhost:3000/
This project uses TravisCI to manage continuous integration needs.
Travis is used to perform three tasks:
- Run unit tests
- Run end-to-end tests
- Deploy this application to AWS and Docker hub
After running tests this application is deployed
using two scripts scripts/deploy.sh
and docker_push
.
These scripts deploy the application only on the master branch.
This project uses unit tests to tests functions and reducers. Components are tested with end-to-end testing.
- Run tests
$ npm test
- Generate test coverage
$ npm run test-local
Unit test are quite straight forward using Travis. Travis runs the tests using the command $ npm run test
This project uses Cypress to run its end-to-end test suites. Documentation for Cypress API can be found here
Before running Cypress tests locally the user must first start both the frontend and the backend are running as described above.
To start the Cypress-launcher input command
$ npm run cypress:open
while in the project root
The user can run all the test suites by pressing the "Run all specs"-button or a single test suite by pressing the filename
Tests can be found in directory
/cypress/integrations
New test files must have the .spec.js filename extension
The tests are run with Travis when the project is pushed to Github. To achieve the goal of end-to-end testing this project uses Docker and Cypress in Travis. We have a three container setup consisting of tosu-frontend, tosu-backend and postgresql. This is started with docker-compose.yml. On startup tosu-backend container will run database migrations if the postgresql-containers database is empty.
After running docker-compose up Travis will run $ npx cypress run
. This will use headless electron runner of cypress. If the end-to-end tests fail the Travis build will fail.
Sometimes the test can pass in local environment but fail while run in CI. This is due to the tests handling differently when run by Chrome than when run in electron runner. Before making pull request you should run the tests using command
$ npx cypress run
to check if they will pass in the CI-environment.
The tosu-frontend image contains the production build of the application and serves it using npm/serve on port 3000.
The app currently has automatic deployment from Travis CI to the staging server.
- Get the unencrypted ssh key
tosu_node.pem
- SSH to the server instance:
$ chmod 600 tosu_node.pem
$ ssh-add tosu_node.pem
$ ssh [email protected]
- Execute the following:
git clone https://github.com/partio-scout/tosu-frontend.git
cd tosu-frontend
npm install
npm run build
rm -rf /var/www/html
cp -a /build /var/www/html
cd ..
rm -rf tosu-frontend
Generate JSDOC with following command:
$ npx jsdoc src/ -r
Fall 2018 product & sprint backlogs
Spring 2018 product & sprint backlogs
This project is licensed under the MIT License - see the LICENSE file for details.