LikeHeroToZero is a web application built with Java that showcases a modular design, featuring essential components like managed beans, DAOs, entities, and utilities. It employs JSF for the front-end interface and JPA for handling database interactions, offering a well-organized and efficient method for developing web applications.
- User and Role Management
- Country and Emission Tracking
- Authentication and Authorization
- Database Persistence with JPA
- Modular and Maintainable Code Structure
The project is organized using a modular architecture. Here's a breakdown of the primary components:
- src/main/java/com.timo.likeherotozero:
beans
: Houses managed beans to support JSF (Java Server Faces) functionality.dao
: Contains Data Access Objects for handling database operations.entities
: Includes JPA (Java Persistence API) entity classes that map to database tables.utils
: Comprises utility classes for tasks like authorization and session management.
- src/main/resources:
META-INF/beans.xml
: Manages dependency injection (CDI) configurations.META-INF/persistence.xml
: Specifies database connection details and JPA configurations.
- src/main/webapp:
- Contains JSF (XHTML) pages for user interface interactions.
- Includes configuration files in 'WEB-INF' for setting up the web application.
- pom.xml:
- Defines the Project Object Model for managing dependencies with Maven.
To run this project, ensure you have the following installed:
- JDK 17
- Apache Maven
- A compatible application server (e.g., WildFly or Tomcat with CDI extensions)
- MySQL Database running on http://localhost:3306 (e.g. via Docker or Docker Compose)
- Clone the repository.
- Build the project using
Maven:
mvn clean install
Docker:
docker build .
docker compose up
for MySQL Database- [Optional if you choose Maven] Deploy the WAR file to your application server
- Access the application in your web browser at
http://localhost:8080/
(or your server's configured port).