All frontend code is to be located in /site or a subdirectory. package.json contains frontend build configuration and a list of packages your frontend needs to install in order to run. Place top-level pages in /site/src/pages and other components in /site/src/components. You will need to download Node.js from https://nodejs.org/ to run the frontend code independently.
All backend code is located in /src/main or a subdirectory. Please do not remove redirect() from SpringBootAPI.java, as this is responsible for enabling your website files to be served.
All unit tests will run with mvn test and the coverage output directory will be target/site/jacoco for your Java code and site/coverage for your JavaScript code.
To run just your frontend tests:
- First, navigate in your terminal/command prompt to
/site. - Run
npm run testto run Jest tests- This will ask you to select an option:
awill run all tests,fwill run failed tests, etc
- This will ask you to select an option:
- Run
npm run test -- --coverage --watchAll=falseto run Jest coverage tests. Note the extra--is required.
To run the app in the development environment, first run mvn compile and then mvn spring-boot:run The app will now be available on http://localhost:8080
- Navigate to
/sitein terminal/command prompt - Run
npm start. Note that this will auto rebuild/refresh when you make changes to the frontend.
- Run the main method in
SpringBootAPI.java
To run the project's acceptance tests, use mvn integration-test. Cucumber can be configured to run a subset of the features by modifying the junit-platform.properties file in the src/test/resources folder
The container can be run with docker-compose run --service-ports 310-project This opens up a bash prompt, then the web app can be compiled with mvn compile and run with mvn spring-boot:run The app will then be available on localhost:8080. Note that the container must be configured by the group so it contains all dependencies and environmental configuration necessary for the CP stakeholder to run and interact with the app. Remember to stop the container to be able to run the app in the development environment. Without doing so, the OS will report that port 8080 is in use. You can rebuild the docker container after changes using docker-compose build --no-cache 310-project
- React
- Frontend Styling Libraries
- https://tailwindcss.com/docs/guides/create-react-app
- Start on Step 2 for installation
- Search page for relevant styles/class names
- https://getbootstrap.com/docs/5.3/getting-started/introduction/
- Search page for relevant styles/class names
- https://tailwindcss.com/docs/guides/create-react-app
- JavaScript unit testing with Jest
- SpringBoot
- Acceptance testing information
- Gherkin information: https://cucumber.io/docs/gherkin/reference/
- Cucumber information: https://cucumber.io/docs/cucumber/
- Selenium information: https://www.selenium.dev/documentation/en/
- Selenium Javadocs: https://www.selenium.dev/selenium/docs/api/java/
- Java unit testing with JUnit