Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions code/services/comment-service/src/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ func (s *CommentServer) DeleteComment(ctx context.Context, req *commentpb.Delete
return nil, err
}

// find all child comments
comments, err := s.ListComments(ctx, &commentpb.ListCommentsRequest{
ThreadId: &res.Id,
})
if err != nil {
return nil, err
}

// delete child comments
for _, comment := range comments.Comments {
_, err = s.DeleteComment(ctx, &commentpb.DeleteCommentRequest{
Id: comment.Id,
})
if err != nil {
return nil, err
}
}

// delete comment
_, err = s.DBClient.DeleteComment(ctx, &dbpb.DeleteCommentRequest{
Id: req.Id,
Expand Down
2 changes: 1 addition & 1 deletion docs/phases/phase10.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 🔍 Phase 10 - Final Report

TODO
The project final report can be found [here](../report/threadit_grupo8_final_report.pdf).
2 changes: 1 addition & 1 deletion docs/phases/phase3.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@

### 📦 Application Architecture

![Application architecture](../images/architecture.png)
![Application architecture](../images/application-architecture.png)
34 changes: 15 additions & 19 deletions docs/phases/phase6.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

## 1. Planned Improvements

### 1.1 Ingress/API Gateway Configuration
### 1.1 API Gateway Configuration

Currently, we are using Traefik with a basic IngressRoute and minimal configuration. To improve flexibility and take advantage of Kubernetes-native features, we will explore two alternatives:

- **Kubernetes Ingress with Traefik:** This allows using standard Ingress resources with Traefik's CRDs for fine-grained traffic routing, TLS termination, and middleware chaining.

- **Kubernetes Gateway API:** A more expressive and extensible alternative to the Ingress API, which decouples traffic routing from infrastructure. We'll experiment with it alongside Traefik's Gateway API support to modernize our networking layer.
The application will use a Traefik instance installed and configured via Helm.
An IngressRoute and some Middlewares will be defined to ensure that Traefik routes the incoming requests to the gRPC Gateway.

### 1.2 Liveness and Readiness Probes
To improve fault tolerance and enable better self-healing behavior in Kubernetes, we will define:
Expand All @@ -22,9 +19,6 @@ We will benchmark services to determine ideal values for:
* **CPU and memory resource requests/limits**.
* **Horizontal Pod Autoscaling (HPA)** thresholds based on real traffic patterns to ensure scalability.

### 1.4 Authentication & Authorization with Keycloak
We will introduce authentication and authorization by integrating [Keycloak](https://www.keycloak.org/) as the Identity Provider. Keycloak will manage user sessions, tokens (OIDC) and Role-Based Access Control (RBAC) across the services.

### 1.5 Secret management

To further improve security we will explore Google Secret Manager for managing sensitive configuration data such as API keys, credentials and tokens. This approach provides:
Expand All @@ -49,18 +43,20 @@ A continuous integration and deployment (CI/CD) pipeline will be implemented usi
| --------------- | -------------------------------------------------------------------------- |
| Scalability | Use HPA to autoscale services based on CPU usage. |
| Availability | Configure liveness/readiness probes and multiple replicas where necessary. |
| Security | Enforce authentication and authorization via Keycloak. |
| Maintainability | Implement CI/CD for consistent, automated deployments. |

## 3. Deployment Plan
| Step | Tool/Technology |
| ------------------------------- | --------------------- |
| Containerization | Docker |
| Cluster Orchestration | Kubernetes (GKE) |
| Ingress Management | GKE Native Ingress |
| Identity and Access Management | Keycloak (OIDC, RBAC) |
| CI/CD | GitHub Actions + GKE |
| Autoscaling | Kubernetes HPA |
| Step | Tool/Technology |
| ------------------------------- |----------------------------|
| Containerization | Docker |
| Cluster Orchestration | Kubernetes (GKE) |
| Ingress Management | Traefik Ingress Controller |
| CI/CD | GitHub Actions |
| Autoscaling | Kubernetes HPA |

## 4. Architecture Diagram
![application architecture](../images/architecture.png)
![Application architecture](../images/application-architecture.png)

## 5. Technical Architecture

![Technical architecture](../images/technical-architecture.png)
2 changes: 1 addition & 1 deletion docs/phases/phase9.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 🔍 Phase 9 - System Testing

TODO
This phase can be found under the chapter 8 of the final [report](../report/threadit_grupo8_final_report.pdf).
Binary file added docs/report/threadit_grupo8_final_report.pdf
Binary file not shown.
Loading