KevanSoon commited on
Commit
31dbadc
·
1 Parent(s): 62e55b3

springboot with project

Browse files
.gitignore CHANGED
@@ -4,6 +4,9 @@ target/
4
  !**/src/main/**/target/
5
  !**/src/test/**/target/
6
 
 
 
 
7
  ### STS ###
8
  .apt_generated
9
  .classpath
 
4
  !**/src/main/**/target/
5
  !**/src/test/**/target/
6
 
7
+ ### Environment Variables ###
8
+ .env
9
+
10
  ### STS ###
11
  .apt_generated
12
  .classpath
pom.xml CHANGED
@@ -8,11 +8,11 @@
8
  <version>3.5.5</version>
9
  <relativePath/> <!-- lookup parent from repository -->
10
  </parent>
11
- <groupId>com.example</groupId>
12
- <artifactId>demo</artifactId>
13
  <version>0.0.1-SNAPSHOT</version>
14
- <name>demo</name>
15
- <description>Demo project for Spring Boot</description>
16
  <url/>
17
  <licenses>
18
  <license/>
@@ -30,29 +30,59 @@
30
  <java.version>17</java.version>
31
  </properties>
32
  <dependencies>
33
- <dependency>
34
- <groupId>org.springframework.boot</groupId>
35
- <artifactId>spring-boot-starter-data-jpa</artifactId>
36
- </dependency>
37
- <dependency>
38
- <groupId>org.springframework.boot</groupId>
39
- <artifactId>spring-boot-starter-web</artifactId>
40
- </dependency>
41
- <dependency>
42
- <groupId>org.springframework.boot</groupId>
43
- <artifactId>spring-boot-starter-test</artifactId>
44
- <scope>test</scope>
45
- </dependency>
46
- <dependency>
47
- <groupId>com.h2database</groupId>
48
- <artifactId>h2</artifactId>
49
- <scope>runtime</scope>
50
- </dependency>
51
- </dependencies>
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  <build>
55
  <plugins>
 
 
 
 
 
 
 
 
 
 
 
 
56
  <plugin>
57
  <groupId>org.springframework.boot</groupId>
58
  <artifactId>spring-boot-maven-plugin</artifactId>
 
8
  <version>3.5.5</version>
9
  <relativePath/> <!-- lookup parent from repository -->
10
  </parent>
11
+ <groupId>com.cs102</groupId>
12
+ <artifactId>attendance</artifactId>
13
  <version>0.0.1-SNAPSHOT</version>
14
+ <name>cs102-attendance-project</name>
15
+ <description>CS102 Attendance Project</description>
16
  <url/>
17
  <licenses>
18
  <license/>
 
30
  <java.version>17</java.version>
31
  </properties>
32
  <dependencies>
33
+ <dependency>
34
+ <groupId>org.springframework.boot</groupId>
35
+ <artifactId>spring-boot-starter-actuator</artifactId>
36
+ </dependency>
37
+ <dependency>
38
+ <groupId>org.springframework.boot</groupId>
39
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
40
+ </dependency>
41
+ <dependency>
42
+ <groupId>org.springframework.boot</groupId>
43
+ <artifactId>spring-boot-starter-security</artifactId>
44
+ </dependency>
45
+ <dependency>
46
+ <groupId>org.springframework.boot</groupId>
47
+ <artifactId>spring-boot-starter-web</artifactId>
48
+ </dependency>
 
 
 
49
 
50
+ <dependency>
51
+ <groupId>org.springframework.boot</groupId>
52
+ <artifactId>spring-boot-configuration-processor</artifactId>
53
+ <optional>true</optional>
54
+ </dependency>
55
+ <dependency>
56
+ <groupId>org.springframework.boot</groupId>
57
+ <artifactId>spring-boot-starter-test</artifactId>
58
+ <scope>test</scope>
59
+ </dependency>
60
+ <dependency>
61
+ <groupId>org.springframework.security</groupId>
62
+ <artifactId>spring-security-test</artifactId>
63
+ <scope>test</scope>
64
+ </dependency>
65
+ <dependency>
66
+ <groupId>org.postgresql</groupId>
67
+ <artifactId>postgresql</artifactId>
68
+ <scope>runtime</scope>
69
+ </dependency>
70
+ </dependencies>
71
 
72
  <build>
73
  <plugins>
74
+ <plugin>
75
+ <groupId>org.apache.maven.plugins</groupId>
76
+ <artifactId>maven-compiler-plugin</artifactId>
77
+ <configuration>
78
+ <annotationProcessorPaths>
79
+ <path>
80
+ <groupId>org.springframework.boot</groupId>
81
+ <artifactId>spring-boot-configuration-processor</artifactId>
82
+ </path>
83
+ </annotationProcessorPaths>
84
+ </configuration>
85
+ </plugin>
86
  <plugin>
87
  <groupId>org.springframework.boot</groupId>
88
  <artifactId>spring-boot-maven-plugin</artifactId>
src/main/java/com/{example/demo/DemoApplication.java → cs102/attendance/Cs102AttendanceProjectApplication.java} RENAMED
@@ -1,14 +1,13 @@
1
- package com.example.demo;
2
 
3
  import org.springframework.boot.SpringApplication;
4
  import org.springframework.boot.autoconfigure.SpringBootApplication;
5
 
6
  @SpringBootApplication
7
- public class DemoApplication {
8
 
9
  public static void main(String[] args) {
10
-
11
- SpringApplication.run(DemoApplication.class, args);
12
  }
13
 
14
  }
 
1
+ package com.cs102.attendance;
2
 
3
  import org.springframework.boot.SpringApplication;
4
  import org.springframework.boot.autoconfigure.SpringBootApplication;
5
 
6
  @SpringBootApplication
7
+ public class Cs102AttendanceProjectApplication {
8
 
9
  public static void main(String[] args) {
10
+ SpringApplication.run(Cs102AttendanceProjectApplication.class, args);
 
11
  }
12
 
13
  }
src/main/resources/application.properties DELETED
@@ -1,7 +0,0 @@
1
- spring.application.name=demo
2
- spring.datasource.url=jdbc:h2:mem:testdb
3
- spring.datasource.driver-class-name=org.h2.Driver
4
- spring.datasource.username=sa
5
- spring.datasource.password=
6
- spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
7
- spring.jpa.hibernate.ddl-auto=update
 
 
 
 
 
 
 
 
src/main/resources/application.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ spring:
2
+ datasource:
3
+ url: ${SPRING_DATASOURCE_URL}
4
+ username: ${SPRING_DATASOURCE_USERNAME}
5
+ password: ${SPRING_DATASOURCE_PASSWORD}
6
+ driver-class-name: org.postgresql.Driver
7
+ jpa:
8
+ hibernate:
9
+ ddl-auto: update
10
+ open-in-view: false
11
+ properties:
12
+ hibernate:
13
+ dialect: org.hibernate.dialect.PostgreSQLDialect
14
+
15
+ # Expose metrics for demo proof
16
+ management.endpoints.web.exposure.include: health,info,metrics,prometheus
17
+
18
+ # Externalised CV thresholds
19
+ recognition:
20
+ confidence: 0.6
21
+ cooldownMs: 10000
22
+ face-service:
23
+ url: http://localhost:5001 # backend face service url
src/test/java/com/{example/demo/DemoApplicationTests.java → cs102/attendance/Cs102AttendanceProjectApplicationTests.java} RENAMED
@@ -1,10 +1,10 @@
1
- package com.example.demo;
2
 
3
  import org.junit.jupiter.api.Test;
4
  import org.springframework.boot.test.context.SpringBootTest;
5
 
6
  @SpringBootTest
7
- class DemoApplicationTests {
8
 
9
  @Test
10
  void contextLoads() {
 
1
+ package com.cs102.attendance;
2
 
3
  import org.junit.jupiter.api.Test;
4
  import org.springframework.boot.test.context.SpringBootTest;
5
 
6
  @SpringBootTest
7
+ class Cs102AttendanceProjectApplicationTests {
8
 
9
  @Test
10
  void contextLoads() {