Skip to content

Commit

Permalink
Merge pull request #32 from commonground-project/feat/add-poc-website
Browse files Browse the repository at this point in the history
Add poc website
  • Loading branch information
YukinaMochizuki authored Dec 21, 2024
2 parents ce809c2 + bebf3e0 commit ba6c0de
Show file tree
Hide file tree
Showing 19 changed files with 246 additions and 19 deletions.
14 changes: 1 addition & 13 deletions src/main/java/tw/commonground/backend/BackendApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,10 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
@SuppressWarnings("HideUtilityClassConstructor")
public class BackendApplication {
/**
* Handles requests to the root URL ("/") and returns a greeting message.
*
* @return A string greeting message.
*/
@RequestMapping("/")
public String home() {
return "Hello Docker World";
}

/**
* The entry point of the application.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
)
.addFilterBefore(new JwtAuthenticationFilter(jwtService), UsernamePasswordAuthenticationFilter.class)
.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/api/user/avatar/**").permitAll()
.requestMatchers("/api/jwt/refresh/**").permitAll()
.requestMatchers("/actuator/**").permitAll()
.requestMatchers("/api/setup/**").hasRole("SETUP_REQUIRED")
.requestMatchers("/api/debug/**").anonymous()
.requestMatchers("/api/admin/**").hasRole("ADMIN")
.requestMatchers("/completed-sign-in.html").permitAll()
.requestMatchers("/login").permitAll()
.requestMatchers("/**").permitAll()
.requestMatchers("/static/**").permitAll()
.anyRequest().authenticated())
.oauth2Login(oauth2 -> oauth2
.userInfoEndpoint(userInfo -> userInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@ public static IssueResponse toResponse(IssueEntity entity, List<FactEntity> fact

return IssueResponse.builder()
.id(entity.getId().toString())
.createAt(entity.getCreateAt())
.createdAt(entity.getCreatedAt())
.updatedAt(entity.getUpdatedAt())
.title(entity.getTitle())
.description(entity.getDescription())
.insight(insight.getText())
.authorId(entity.getAuthorId())
.authorName(entity.getAuthorName())
.authorAvatar(entity.getAuthorAvatar())
.insightFacts(factEntities.stream().map(FactMapper::toResponse).toList())
.facts(factEntities.stream().map(FactMapper::toResponse).toList())
.build();
}

public static SimpleIssueResponse toResponse(SimpleIssueEntity entity) {
return SimpleIssueResponse.builder()
.id(entity.getId().toString())
.createdAt(entity.getCreatedAt())
.updatedAt(entity.getUpdatedAt())
.title(entity.getTitle())
.description(entity.getDescription())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,20 @@ public class IssueRequest {
private String insight;

private List<UUID> facts;

public String getInsight() {
if (insight == null) {
return "";
}

return insight;
}

public List<UUID> getFacts() {
if (facts == null) {
return List.of();
}

return facts;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class IssueResponse {

private String id;

private LocalDateTime createAt;
private LocalDateTime createdAt;

private LocalDateTime updatedAt;

Expand All @@ -32,5 +32,5 @@ public class IssueResponse {

private String authorAvatar;

private List<FactResponse> insightFacts;
private List<FactResponse> facts;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SimpleIssueResponse {

private String id;

private LocalDateTime createAt;
private LocalDateTime createdAt;

private LocalDateTime updatedAt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public IssueEntity(UUID id) {

@CreatedDate
@Column(nullable = false)
private LocalDateTime createAt;
private LocalDateTime createdAt;

@LastModifiedDate
private LocalDateTime updatedAt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package tw.commonground.backend.service.issue.entity;

import java.time.LocalDateTime;
import java.util.UUID;

public interface SimpleIssueEntity {
UUID getId();

LocalDateTime getCreatedAt();

LocalDateTime getUpdatedAt();

String getTitle();

String getDescription();
}
12 changes: 12 additions & 0 deletions src/main/resources/static/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files": {
"main.css": "/static/css/main.4efb37a3.css",
"main.js": "/static/js/main.1b690891.js",
"static/js/206.c092c3fc.chunk.js": "/static/js/206.c092c3fc.chunk.js",
"index.html": "/index.html"
},
"entrypoints": [
"static/css/main.4efb37a3.css",
"static/js/main.1b690891.js"
]
}
Binary file added src/main/resources/static/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.1b690891.js"></script><link href="/static/css/main.4efb37a3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Binary file added src/main/resources/static/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/static/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/main/resources/static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions src/main/resources/static/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
1 change: 1 addition & 0 deletions src/main/resources/static/static/css/main.4efb37a3.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main/resources/static/static/js/206.c092c3fc.chunk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 102 additions & 0 deletions src/main/resources/static/static/js/main.1b690891.js

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions src/main/resources/static/static/js/main.1b690891.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @mui/styled-engine v6.1.9
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

0 comments on commit ba6c0de

Please sign in to comment.