This project is a Java web application that is set up with a SQL database using JDBC.
The project structure is as follows:
.gradle/- Gradle configuration files.idea/- IntelliJ IDEA configuration filessrc/main/java/com/example/demo/- Java source filescontroller/- Contains the controller classessrc/main/java/com/example/demo/controller/Controller.java- Main controller classErrorControllerAdvice.java- Error handling class
model/- Contains the model classes and data access objects (DAOs)src/main/java/com/example/demo/model/FilmDao.java- Data access object for filmsFilmDTO.java- Data transfer object for filmsKinosaalDTO.java- Data transfer object for kinosaalKundeDao.java- Data access object for customersKundeDTO.java- Data transfer object for customerssrc/main/java/com/example/demo/model/MitarbeiterDao.java- Data access object for employeesMitarbeiterDTO.java- Data transfer object for employeesRole.java- Role enumerationSimpleRole.java- Simple role classSimpleUser.java- Simple user classsrc/main/java/com/example/demo/model/TicketDao.java- Data access object for ticketsTicketDTO.java- Data transfer object for ticketsUser.java- User classUserRepository.java- User repository interfacesrc/main/java/com/example/demo/model/VorstellungDao.java- Data access object for VorstellungenVorstellungDTO.java- Data transfer object for Vorstellungen
persistence/- Contains the persistence classesPostgresqlUserRepository.java- PostgreSQL user repository implementation
security/- Contains the security configuration classesCurrentUser.java- Current user annotationCustomUserDetailsService.java- Custom user details serviceSecurityConfig.java- Security configurationUserToUserDetailsAdapter.java- User to user details adapter
src/main/java/com/example/demo/DemoApplication.java- Main application class
src/main/resources/- Resource filesapplication.properties- Application properties filedata/- Contains SQL scripts for database initializationdata.sql- Data initialization scriptschema.sql- Database schema script
templates/- Contains HTML templatesaddFilm.html- Template for adding a filmaddVorstellung.html- Template for adding a VorstellungchangePassword.html- Template for changing passworddemo.html- Demo templatefilm.html- Template for displaying filmsindex.html- Index templateregistrierung.html- Template for registrationregistrierungGast.html- Template for guest registrationregistrierungMitarbeiter.html- Template for employee registrationticket.html- Template for displaying ticketsvorstellung.html- Template for displaying Vorstellungen
build.gradle- Gradle build filecompose.yaml- Docker Compose filegradle/- Gradle wrapper filesgradlew- Gradle wrapper script (Unix)gradlew.bat- Gradle wrapper script (Windows)settings.gradle- Gradle settings file
- Ensure you have Java and Gradle installed on your system.
- Clone the repository.
- Navigate to the project directory.
- Run the following command to build the project:
./gradlew build - Run the following command to start the application:
./gradlew bootRun - The application will be accessible at
http://localhost:8080.
The application uses a PostgreSQL database. The database configuration can be found in the src/main/resources/application.properties file. Update the following properties with your database credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/kinodb
spring.datasource.username=postgres
spring.datasource.password=1234
This project is licensed under the MIT License.