This is a simple web application built using Java, Spring Boot, Thymeleaf, and H2 Database. The application features user authentication, including login and registration capabilities.
Demo-J.S.T.H-Website-WebApp-Project/
│
├── .mvn/
│ └── wrapper/
│ └── maven-wrapper.properties
├── .vscode/
│ └── settings.json
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/demo/
│ │ │ ├── controller/
│ │ │ │ └── DemoController.java
│ │ │ ├── model/
│ │ │ │ └── DemoModel.java
│ │ │ ├── repository/
│ │ │ │ └── DemoRepository.java
│ │ │ ├── service/
│ │ │ │ └── DemoService.java
│ │ │ └── DemoApplication.java
│ │ ��── resources/
│ │ │ ├── static/
│ │ │ │ └── css/
│ │ │ │ └── styles.css
│ │ │ ├── templates/
│ │ │ │ ├── about.html
│ │ │ │ ├── index.html
│ │ │ │ ├── login.html
│ │ �� │ └── signup.html
│ │ │ └── application.properties
│ └── test/
│ └── java/
│ └── com/example/demo/
│ └── DemoApplicationTests.java
├── target/
│ ├── classes/
│ ├── generated-sources/
│ ├── generated-test-sources/
│ ├── maven-archiver/
│ ├── maven-status/
│ ├── surefire-reports/
│ ├── test-classes/
│ ├── demo-0.0.1-SNAPSHOT.jar
│ └── demo-0.0.1-SNAPSHOT.jar.original
├── .gitattributes
├── .gitignore
├── HELP.md
├── mvnw
├── mvnw.cmd
├── pom.xml
└── README.md
The application's entry point is DemoApplication.java
. It initializes the Spring Boot application and sets up the necessary configurations.
- User Authentication: Users can register and log in.
- MVC Architecture: Utilizes Spring Boot's MVC framework.
- In-Memory Database: Uses H2 for development and testing.
- Template Rendering: Employs Thymeleaf for dynamic HTML content.
- Home (
/
) - Login (
/login
) - Signup (
/signup
) - About (
/about
)
-
Clone the Repository
git clone https://github.com/your-repo/Demo-J.S.T.H-Website-WebApp-Project.git cd Demo-J.S.T.H-Website-WebApp-Project
-
Build the Project with Maven
./mvnw clean install
-
Run the Spring Boot Application
./mvnw spring-boot:run
-
Access the Application
Open your web browser and navigate to
http://localhost:8080
.
Located at src/main/resources/application.properties
, this file contains configuration settings for the application, such as database connectivity and logging levels.
The pom.xml
file lists the project's dependencies and build configurations:
<dependencies>
<!-- Spring Boot Starters -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Data JPA for ORM -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- H2 Database for testing -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Lombok to reduce boilerplate code -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- Testing libraries -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
To install the dependencies:
./mvnw clean install
- Java: Primary programming language.
- Spring Boot: Framework for building the web application.
- Thymeleaf: Server-side Java template engine.
- Spring Data JPA: For database operations.
- H2 Database: In-memory database for development.
- HTML/CSS: Frontend layout and styling.
- HTML: Structures the web pages.
- CSS: Styles the web pages, with custom styles in
styles.css
.
- Spring Boot: Framework for building Java applications.
- Spring Data JPA: Simplifies database interactions.
- Lombok: Reduces boilerplate code in Java classes.
- H2 Database: An embedded, in-memory database used for storing user data during development and testing.
- Maven: Manages project builds and dependencies.
- JUnit: Framework for writing and running tests.
- Spring Boot Test Starter: Provides testing libraries for Spring Boot applications.
- Frontend: HTML, CSS
- Backend: Java, Spring Boot
- Database: H2 Database
- Build Tools: Maven, Lombok
- Testing: JUnit, Spring Boot Test Starter
This tech stack provides a robust foundation for developing a web application that is easy to maintain and scalable for future enhancements.