Java example interface to this database. Have been written with usage of:
- Java 8
- Servlets
- Jdbc
- Postgres connection pool
- Tomcat connection pool
- Hibernate
- JPA
- Freemarker
- Maven
- Maven Wrapper
- Tomcat
- Postgres
- Docker
All project dependencies will be downloaded by Maven from central repo. To run this application locally you need:
- PostgreSql 9.6 installed locally
- Installed Tomcat 7 with java 8 support You probably can use newest versions of Tomcat and Postgres but I didn't test it.
To run this application in container you need to install Docker
There are two profiles in resources/profiles dir and described in pom file to package application for local usage and inside docker accordingly. If you need to deploy this application to remote tomcat or with remote postgres support you should add another profile and edit pom file.
To build locally you need installed Maven locally:
mvn clean package -P local
or you can use Maven Wrapper:
./mvnw clean package -P local
If you don't have postgres installed or tomcat you can use docker. Go to docker folder and run
make
This will create tomcat 7 container with application inside. But you still need initialized postgres service as external dependency.
- Make sure you installed tomcat 7 and run it on 8080 port
- Make sure you installed Postgresql 9.6 and run it on 5432 port
- Initialize Postgres with data:
psql -U postgres -d postgres -a -f docker/init/init.sql
- Deploy application on Tomcat:
or
mvn clean tomcat7:redeploy -P local
or just copy war file from docker/app to /webapps folder./mvnw clean tomcat7:redeploy -P local
- Use browser to run the application
http://localhost:8080/powerliftersdb
To run inside docker container use command from docker/ directory:
make run
and go to
http://localhost:8080/powerliftersdb
GNU GPLv3