Skip to content

Ski equipment rental company system. Hibernate ORM system with Jakarta EE, EJB and JSP pages with "JSP Model 2" architecture.

License

Notifications You must be signed in to change notification settings

milosz08/ski-rental-service

Repository files navigation

Ski Rental Service

More info about this project you will find on my personal website

Enterprise-class application for managing a ski rental company. Created using Jakarta EE with EJB specifications. This application can be run on any application server that supports Java 17, Jakarta EE 9, Jakarta Servlet API 6 and EJB, such as Apache TomEE, Glassfish or JBoss/Wildfly.

I realize that the specification of servlets, JSP pages and monolithic applications is no longer a standard today. This application was created only for learning purposes and familiarization with older "legacy" technologies.

Table of content

Clone and install

To install the program on your computer, use the command below (or use the build-in GIT system in your IDE environment):

$ git clone https://github.com/Milosz08/ski-rental-service

Prepare configuration and run

  1. Before run project, insert application properties in .env file:
SKI_DEV_S3_USERNAME=<Minio S3 access key for AWS SDK>
SKI_DEV_S3_PASSWORD=<Minio S3 secret key for AWS SDK>
SKI_DEV_MYSQL_USERNAME=<database username>
SKI_DEV_MYSQL_PASSWORD=<database password>
SKI_DEV_MAILHOG_USERNAME=<mailhog username, by default: mailhoguser (check .volumes/mail/mailhog-auth.txt file)>
SKI_DEV_MAILHOG_PASSWORD=<mailhog password, by default: root (check .volumes/mail/mailhog-auth.txt file)>
SKI_DEV_SSH_HOST=<optional, for creating email addresses in production>
SKI_DEV_SSH_LOGIN=<optional, for creating email addresses in production>

Important

If you run this project as standalone application without using Docker containers, this variables should be provided as exported environment variables.

  1. To run project via Docker technology move to root project directory and type:
$ docker-compose up -d

This command will create 4 Docker containers:

  • ski-mailhog-smtp - simple mail server, for development purposes,
  • ski-minio-s3 - Minio S3 file storage server,
  • ski-mysql-db - MySQL application database,
  • ski-rental-app - TomEE application server with exploded .war archive of this application

Default application ports (can be changed by editing .env file):

Application Port Description
ski-mailhog-smtp 7591 SMTP server api port
7592 SMTP server web iterface
ski-minio-s3 7593 Minio S3 api for AWS SDK for Java
7594 Minio S3 web interface
ski-mysql-db 7590 MySQL database port
ski-rental-app 7595 TomEE server with application

Note

Application by default run with docker profile. To change profile (dev, docker or prod), change SKI_ENVIRONMENT environment variable.

Manage mailboxes via SSH

Accessed in src/main/resources/ssh/ssh.cfg.xml, run commands only for prod environment.

<?xml version="1.0" encoding="UTF-8"?>
<ssh-configuration>
  <property name="ssh.host">${SKI_SSH_HOST}</property>
  <property name="ssh.login">${SKI_SSH_LOGIN}</property>
  <property name="ssh.private-key.path">${SKI_SSH_PRIVATE_KEY_PATH}</property>
  <property name="ssh.known-hosts.path">${SKI_SSH_KNOWN_HOSTS_PATH}</property>
  <commands>
    <create-mailbox>
      <!-- create mailbox command -->
    </create-mailbox>
    <update-mailbox-password>
      <!-- change mailbox password command -->
    </update-mailbox-password>
    <delete-mailbox>
      <!-- delete mailbox command -->
    </delete-mailbox>
    <set-mailbox-capacity>
      <!-- set mailbox capacity command -->
    </set-mailbox-capacity>
  </commands>
</ssh-configuration>

Tech stack

  • Java (Jakarta) EE 9
  • EJB (Enterprise Java Beans)
  • MySQL relational database system
  • JSP (views) + JSTL
  • Jakarta Mail Api (mail sender) + Freemarker (templates)
  • Hibernate (ORM system) + C3P0 (connection pool) + Liquibase (database migrations)
  • Bootstrap, jQuery, PopperJS
  • Barcode4J - bar codes generator
  • iText - pdf documents generator
  • Apache TomEE application server with Docker technology

Author

Created by Miłosz Gilga. If you have any questions about this application, send message: personal@miloszgilga.pl.

Project status

Project is finished.

License

This application is on Apache 2.0 License.

About

Ski equipment rental company system. Hibernate ORM system with Jakarta EE, EJB and JSP pages with "JSP Model 2" architecture.

Resources

License

Stars

Watchers

Forks

Languages