diff options
-rw-r--r-- | README.md | 77 | ||||
-rw-r--r-- | docs/DesignDoc.md | 172 | ||||
-rw-r--r-- | docs/architecture-tiers-and-layers.png | bin | 0 -> 75718 bytes | |||
-rw-r--r-- | docs/domain-model-placeholder.png | bin | 0 -> 28823 bytes | |||
-rw-r--r-- | docs/index.md | 16 | ||||
-rw-r--r-- | docs/pom.xml | 41 | ||||
-rw-r--r-- | etc/Acceptance Test Plan.xlsx | bin | 0 -> 21019 bytes | |||
-rw-r--r-- | ufund-api/.gitignore | 32 | ||||
-rw-r--r-- | ufund-api/HELP.md | 22 | ||||
-rw-r--r-- | ufund-api/pom.xml | 155 | ||||
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java | 13 | ||||
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java | 16 | ||||
-rw-r--r-- | ufund-api/src/main/resources/application.properties | 1 | ||||
-rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java | 13 | ||||
-rw-r--r-- | ufund-ui/README.txt | 2 |
15 files changed, 560 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..dfead94 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# U-Fund: _____ _replace with your particular fundraising type_ _____ +# Modify this document to expand any and all sections that are applicable for a better understanding from your users/testers/collaborators (remove this comment and other instructions areas for your FINAL release) + +An online U-Fund system built in Java **21** and ___ _replace with other platform requirements_ ___ + +## Team + +- MEMBER1 +- MEMBER2 +- MEMBER3 +- MEMBER4 + + +## Prerequisites + +- Java **21** (Make sure to have correct JAVA_HOME setup in your environment) +- Maven +- _add any other tech stack requirements_ + + +## How to run it + +1. Clone the repository and go to the root directory. +2. Execute `mvn compile exec:java` +3. Open in your browser `http://localhost:8080/` +4. _add any other steps required or examples of how to use/run_ + +## Known bugs and disclaimers +(It may be the case that your implementation is not perfect.) + +Document any known bug or nuisance. +If any shortcomings, make clear what these are and where they are located. + +## How to test it + +The Maven build script provides hooks for run unit tests and generate code coverage +reports in HTML. + +To run tests on all tiers together do this: + +1. Execute `mvn clean test jacoco:report` +2. Open in your browser the file at `PROJECT_API_HOME/target/site/jacoco/index.html` + +To run tests on a single tier do this: + +1. Execute `mvn clean test-compile surefire:test@tier jacoco:report@tier` where `tier` is one of `controller`, `model`, `persistence` +2. Open in your browser the file at `PROJECT_API_HOME/target/site/jacoco/{controller, model, persistence}/index.html` + +To run tests on all the tiers in isolation do this: + +1. Execute `mvn exec:exec@tests-and-coverage` +2. To view the Controller tier tests open in your browser the file at `PROJECT_API_HOME/target/site/jacoco/model/index.html` +3. To view the Model tier tests open in your browser the file at `PROJECT_API_HOME/target/site/jacoco/model/index.html` +4. To view the Persistence tier tests open in your browser the file at `PROJECT_API_HOME/target/site/jacoco/model/index.html` + +*(Consider using `mvn clean verify` to attest you have reached the target threshold for coverage) + + +## How to generate the Design documentation PDF + +1. Access the `PROJECT_DOCS_HOME/` directory +2. Execute `mvn exec:exec@docs` +3. The generated PDF will be in `PROJECT_DOCS_HOME/` directory + + +## How to setup/run/test program +1. Tester, first obtain the Acceptance Test plan +2. IP address of target machine running the app +3. Execute ________ +4. ... +5. ... + +## License + +MIT License + +See LICENSE for details. diff --git a/docs/DesignDoc.md b/docs/DesignDoc.md new file mode 100644 index 0000000..c1e8676 --- /dev/null +++ b/docs/DesignDoc.md @@ -0,0 +1,172 @@ +--- +geometry: margin=1in +--- +# PROJECT Design Documentation + +> _The following template provides the headings for your Design +> Documentation. As you edit each section make sure you remove these +> commentary 'blockquotes'; the lines that start with a > character +> and appear in the generated PDF in italics but do so only **after** all team members agree that the requirements for that section and current Sprint have been met. **Do not** delete future Sprint expectations._ + +## Team Information +* Team name: TEAMNAME +* Team members + * MEMBER1 + * MEMBER2 + * MEMBER3 + * MEMBER4 + +## Executive Summary + +This is a summary of the project. + +### Purpose +> _**[Sprint 2 & 4]** Provide a very brief statement about the project and the most +> important user group and user goals._ + +### Glossary and Acronyms +> _**[Sprint 2 & 4]** Provide a table of terms and acronyms._ + +| Term | Definition | +|------|------------| +| SPA | Single Page | + + +## Requirements + +This section describes the features of the application. + +> _In this section you do not need to be exhaustive and list every +> story. Focus on top-level features from the Vision document and +> maybe Epics and critical Stories._ + +### Definition of MVP +> _**[Sprint 2 & 4]** Provide a simple description of the Minimum Viable Product._ + +### MVP Features +> _**[Sprint 4]** Provide a list of top-level Epics and/or Stories of the MVP._ + +### Enhancements +> _**[Sprint 4]** Describe what enhancements you have implemented for the project._ + + +## Application Domain + +This section describes the application domain. + + + +> _**[Sprint 2 & 4]** Provide a high-level overview of the domain for this application. You +> can discuss the more important domain entities and their relationship +> to each other._ + + +## Architecture and Design + +This section describes the application architecture. + +### Summary + +The following Tiers/Layers model shows a high-level view of the webapp's architecture. +**NOTE**: detailed diagrams are required in later sections of this document. +> _**[Sprint 1]** (Augment this diagram with your **own** rendition and representations of sample system classes, placing them into the appropriate M/V/VM (orange rectangle) tier section. Focus on what is currently required to support **Sprint 1 - Demo requirements**. Make sure to describe your design choices in the corresponding _**Tier Section**_ and also in the _**OO Design Principles**_ section below.)_ + + + +The web application, is built using the Model–View–ViewModel (MVVM) architecture pattern. + +The Model stores the application data objects including any functionality to provide persistance. + +The View is the client-side SPA built with Angular utilizing HTML, CSS and TypeScript. The ViewModel provides RESTful APIs to the client (View) as well as any logic required to manipulate the data objects from the Model. + +Both the ViewModel and Model are built using Java and Spring Framework. Details of the components within these tiers are supplied below. + + +### Overview of User Interface + +This section describes the web interface flow; this is how the user views and interacts with the web application. + +> _Provide a summary of the application's user interface. Describe, from the user's perspective, the flow of the pages/navigation in the web application. +> (Add low-fidelity mockups prior to initiating your **[Sprint 2]** work so you have a good idea of the user interactions.) Eventually replace with representative screen shots of your high-fidelity results as these become available and finally include future recommendations improvement recommendations for your **[Sprint 4]** )_ + + +### View Tier +> _**[Sprint 4]** Provide a summary of the View Tier UI of your architecture. +> Describe the types of components in the tier and describe their +> responsibilities. This should be a narrative description, i.e. it has +> a flow or "story line" that the reader can follow._ + +> _**[Sprint 4]** You must provide at least **2 sequence diagrams** as is relevant to a particular aspects +> of the design that you are describing. (**For example**, in a shopping experience application you might create a +> sequence diagram of a customer searching for an item and adding to their cart.) +> As these can span multiple tiers, be sure to include an relevant HTTP requests from the client-side to the server-side +> to help illustrate the end-to-end flow._ + +> _**[Sprint 4]** To adequately show your system, you will need to present the **class diagrams** where relevant in your design. Some additional tips:_ + >* _Class diagrams only apply to the **ViewModel** and **Model** Tier_ +>* _A single class diagram of the entire system will not be effective. You may start with one, but will be need to break it down into smaller sections to account for requirements of each of the Tier static models below._ + >* _Correct labeling of relationships with proper notation for the relationship type, multiplicities, and navigation information will be important._ + >* _Include other details such as attributes and method signatures that you think are needed to support the level of detail in your discussion._ + +### ViewModel Tier +> _**[Sprint 1]** List the classes supporting this tier and provide a description of there purpose._ + +> _**[Sprint 4]** Provide a summary of this tier of your architecture. This +> section will follow the same instructions that are given for the View +> Tier above._ + +> _At appropriate places as part of this narrative provide **one** or more updated and **properly labeled** +> static models (UML class diagrams) with some details such as associations (connections) between classes, and critical attributes and methods. (**Be sure** to revisit the Static **UML Review Sheet** to ensure your class diagrams are using correct format and syntax.)_ +> + + +### Model Tier +> _**[Sprint 1]** List the classes supporting this tier and provide a description of there purpose._ + +> _**[Sprint 2, 3 & 4]** Provide a summary of this tier of your architecture. This +> section will follow the same instructions that are given for the View +> Tier above._ + +> _At appropriate places as part of this narrative provide **one** or more updated and **properly labeled** +> static models (UML class diagrams) with some details such as associations (connections) between classes, and critical attributes and methods. (**Be sure** to revisit the Static **UML Review Sheet** to ensure your class diagrams are using correct format and syntax.)_ +> + + +## OO Design Principles + +> _**[Sprint 1]** Name and describe the initial OO Principles that your team has considered in support of your design (and implementation) for this first Sprint._ + +> _**[Sprint 2, 3 & 4]** Will eventually address upto **4 key OO Principles** in your final design. Follow guidance in augmenting those completed in previous Sprints as indicated to you by instructor. Be sure to include any diagrams (or clearly refer to ones elsewhere in your Tier sections above) to support your claims._ + +> _**[Sprint 3 & 4]** OO Design Principles should span across **all tiers.**_ + +## Static Code Analysis/Future Design Improvements +> _**[Sprint 4]** With the results from the Static Code Analysis exercise, +> **Identify 3-4** areas within your code that have been flagged by the Static Code +> Analysis Tool (SonarQube) and provide your analysis and recommendations. +> Include any relevant screenshot(s) with each area._ + +> _**[Sprint 4]** Discuss **future** refactoring and other design improvements your team would explore if the team had additional time._ + +## Testing +> _This section will provide information about the testing performed +> and the results of the testing._ + +### Acceptance Testing +> _**[Sprint 2 & 4]** Report on the number of user stories that have passed all their +> acceptance criteria tests, the number that have some acceptance +> criteria tests failing, and the number of user stories that +> have not had any testing yet. Highlight the issues found during +> acceptance testing and if there are any concerns._ + +### Unit Testing and Code Coverage +> _**[Sprint 4]** Discuss your unit testing strategy. Report on the code coverage +> achieved from unit testing of the code base. Discuss the team's +> coverage targets, why you selected those values, and how well your +> code coverage met your targets._ + +>_**[Sprint 2, 3 & 4]** **Include images of your code coverage report.** If there are any anomalies, discuss +> those._ + +## Ongoing Rationale +>_**[Sprint 1, 2, 3 & 4]** Throughout the project, provide a time stamp **(yyyy/mm/dd): Sprint # and description** of any _**mayor**_ team decisions or design milestones/changes and corresponding justification._ diff --git a/docs/architecture-tiers-and-layers.png b/docs/architecture-tiers-and-layers.png Binary files differnew file mode 100644 index 0000000..5848a40 --- /dev/null +++ b/docs/architecture-tiers-and-layers.png diff --git a/docs/domain-model-placeholder.png b/docs/domain-model-placeholder.png Binary files differnew file mode 100644 index 0000000..ba1ef65 --- /dev/null +++ b/docs/domain-model-placeholder.png diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..9f7d821 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +# PROJECT Home + +Welcome to the PROJECT Project! + +## Team + +* MEMBER1 +* MEMBER2 + +## [Design Documentation](DesignDoc) + +Click above for details of the PROJECT design documentation. + +## [Setup Guide](SetupGuide) + +Click above for details about how to setup your development environment to work on this project. diff --git a/docs/pom.xml b/docs/pom.xml new file mode 100644 index 0000000..802283a --- /dev/null +++ b/docs/pom.xml @@ -0,0 +1,41 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>U-Fund</groupId> + <artifactId>design-doc</artifactId> + <version>1.0-SNAPSHOT</version> + + <name></name> + <description>Design documentation for U-Fund project</description> + + <properties> + <!-- Application build dependency versions + <maven.compiler.version>3.8.0</maven.compiler.version> + <maven.assembly.version>3.1.0</maven.assembly.version> --> + <maven.exec.version>1.6.0</maven.exec.version> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${maven.exec.version}</version> + <executions> + <execution> + <id>docs</id> + <configuration> + <executable>pandoc</executable> + <workingDirectory>${project.basedir}</workingDirectory> + <arguments> + <argument>DesignDoc.md</argument> + <argument>-o</argument> + <argument>${project.basedir}/DesignDoc.pdf</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/etc/Acceptance Test Plan.xlsx b/etc/Acceptance Test Plan.xlsx Binary files differnew file mode 100644 index 0000000..36ece15 --- /dev/null +++ b/etc/Acceptance Test Plan.xlsx diff --git a/ufund-api/.gitignore b/ufund-api/.gitignore new file mode 100644 index 0000000..7ed0d6b --- /dev/null +++ b/ufund-api/.gitignore @@ -0,0 +1,32 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/ufund-api/HELP.md b/ufund-api/HELP.md new file mode 100644 index 0000000..f110fea --- /dev/null +++ b/ufund-api/HELP.md @@ -0,0 +1,22 @@ +# Read Me First +The following was discovered as part of building this project: + +* The original package name 'com.ufund.api.ufund-api' is invalid and this project uses 'com.ufund.api.ufundapi' instead. + +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.2/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.2/maven-plugin/reference/html/#build-image) +* [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.2/reference/htmlsingle/#boot-features-developing-web-applications) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) + diff --git a/ufund-api/pom.xml b/ufund-api/pom.xml new file mode 100644 index 0000000..ce96d60 --- /dev/null +++ b/ufund-api/pom.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>3.4.2</version> + <relativePath /> <!-- lookup parent from repository --> + </parent> + <groupId>com.ufund.api</groupId> + <artifactId>ufund-api</artifactId> + <version>0.0.1-SNAPSHOT</version> + <name>ufund-api</name> + <description>API for U-Fund</description> + <properties> + <java.version>21</java.version> + <jacoco.version>0.8.11</jacoco.version> + <exec.maven.version>3.5.0</exec.maven.version> + </properties> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${exec.maven.version}</version> + <executions> + <execution> + <goals> + <goal>java</goal> + </goals> + </execution> + <execution> + <id>tests-and-coverage</id> + <configuration> + <executable>mvn</executable> + <arguments> + <argument>clean</argument> + <argument>test-compile</argument> + <argument>surefire:test@controller</argument> + <argument>jacoco:report@controller</argument> + <argument>surefire:test@model</argument> + <argument>jacoco:report@model</argument> + <argument>surefire:test@persistence</argument> + <argument>jacoco:report@persistence</argument> + </arguments> + </configuration> + </execution> + </executions> + <configuration> + <mainClass>com.ufund.api.ufundapi.UfundApiApplication</mainClass> + <arguments></arguments> + </configuration> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <configuration> + <destfile>/target/coverage-reports/jacoco-unit.exec</destfile> + <datafile>/target/coverage-reports/jacoco-unit.exec</datafile> + </configuration> + <executions> + <execution> + <id>jacoco-initialize</id> + <configuration> + <!-- throw away the old data with each test run --> + <append>false</append> + </configuration> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <!-- attached to Maven test phase --> + <execution> + <id>report</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>controller</id> + <configuration> + <footer>Controller Tier</footer> + <title>U-Fund API Controller Tier Test Coverage</title> + <outputDirectory>target/site/jacoco/controller</outputDirectory> + </configuration> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>persistence</id> + <configuration> + <footer>Persistence Tier</footer> + <title>U-Fund API Persistence Tier Test Coverage</title> + <outputDirectory>target/site/jacoco/persistence</outputDirectory> + </configuration> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>model</id> + <configuration> + <footer>Model Tier</footer> + <title>U-Fund API Model Tier Test Coverage</title> + <outputDirectory>target/site/jacoco/model</outputDirectory> + </configuration> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>jacoco-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>BUNDLE</element> + <limits> + <limit> + <counter>INSTRUCTION</counter> + <value>COVEREDRATIO</value> + <minimum>0.90</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java new file mode 100644 index 0000000..6e263d5 --- /dev/null +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java @@ -0,0 +1,13 @@ +package com.ufund.api.ufundapi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class UfundApiApplication { + + public static void main(String[] args) { + SpringApplication.run(UfundApiApplication.class, args); + } + +} diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java new file mode 100644 index 0000000..7d7bfa0 --- /dev/null +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java @@ -0,0 +1,16 @@ +package com.ufund.api.ufundapi; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +@EnableWebMvc +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH"); + } +}
\ No newline at end of file diff --git a/ufund-api/src/main/resources/application.properties b/ufund-api/src/main/resources/application.properties new file mode 100644 index 0000000..3e7fc8a --- /dev/null +++ b/ufund-api/src/main/resources/application.properties @@ -0,0 +1 @@ +server.error.include-message=always diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java new file mode 100644 index 0000000..fc7eda8 --- /dev/null +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java @@ -0,0 +1,13 @@ +package com.ufund.api.ufundapi; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class UfundApiApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/ufund-ui/README.txt b/ufund-ui/README.txt new file mode 100644 index 0000000..56b0acc --- /dev/null +++ b/ufund-ui/README.txt @@ -0,0 +1,2 @@ +This is the directory for your UI code. +Update this file as you see fit and be sure to document and maintain as you go. |