This repo is a Pet-project of web application represent list of students from database (HSQLDB, MySQl), with a java based spring framework configuration (a plain old XML configuration here) and with a 3-layer architecture (i.e. presentation --> service --> repository). Created by following the example of this repository spring-projects/spring-framework-petclinic.
git clone https://github.com/ilya-vdovenko/Students-WebApp.git
cd Students-WebApp
./mvnw jetty:run-war
# For Windows : ./mvnw.cmd jetty:run-war
You can then access app here: localhost:8080/Students-WebApp
The following items should be installed in your system:
- Java 8 or newer.
- git command line tool (https://help.github.com/articles/set-up-git)
- Your preferred IDE
- Eclipse with the m2e plugin. Note: when m2e is available, there is an m2 icon in Help -> About dialog. If m2e is not there, just follow the install process here
- Spring Tools Suite (STS)
- IntelliJ IDEA
- Visual studio code
- Import project and past url to the project. Or on the command line
git clone https://github.com/ilya-vdovenko/Students-WebApp.git
- (If through CL) Inside IDE
File -> Import -> Maven -> Existing Maven project
-
After import, click
jetty:run
from maven window, or type in IDE command linemvn jetty:run
-
Visit localhost:8080/Students-WebApp in your browser.
By default, Students-WebApp uses an in-memory database (HSQLDB) which gets populated at startup with data. A similar setup is provided for MySQL in case a persistent database configuration is needed. To run web-app locally using persistent database, it is needed to run with profile defined in main pom.xml file.
For MySQL database, it is needed to run with 'MySQL' profile defined in main pom.xml file.
./mvnw jetty:run-war -P JDBC_MySQL
Before do this, would be good to check properties defined in MySQL profile inside pom.xml file.
<properties>
<maven.spring.profiles.active>jdbc</maven.spring.profiles.active>
<maven.skipTests>%regex[.*Jpa.*Tests.*]</maven.skipTests>
<maven.db.script>mysql</maven.db.script>
<maven.jpa.database>MYSQL</maven.jpa.database>
<maven.jdbc.driverClassName>com.mysql.cj.jdbc.Driver</maven.jdbc.driverClassName>
<maven.jdbc.url>jdbc:mysql://localhost:3306, mysql:3306/institute?failOverReadOnly=false</maven.jdbc.url>
<maven.jdbc.username>institute</maven.jdbc.username>
<maven.jdbc.password>institute</maven.jdbc.password>
</properties>
You can use docker-compose.yml
file for run MySQL. Be sure that you had install Docker-compose.
docker-compose -f "docker-compose.yml" up -d --build
Students-WebApp is released under version 2.0 of the Apache License.