Skip to content

Api gateway - #1

Merged
anupamavm merged 4 commits into
mainfrom
api-gateway
Mar 12, 2026
Merged

anupamavm merged 4 commits into
mainfrom
api-gateway

Conversation

@anupamavm

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Spring Cloud API Gateway service and updates the user-service configuration to support running behind the gateway with environment-driven settings.

Changes:

  • Introduces a new api-gateway Spring Boot service (Gateway routes, WebFlux Security, Docker/Maven wrapper scaffolding).
  • Updates user-service configuration (port, app name, env-var DB config, JWT settings, actuator exposure).
  • Enables actuator endpoint exposure (health/info/prometheus) across services.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
services/user-service/src/main/resources/application.yml Configures user-service port, DB env vars, JWT settings, and actuator exposure.
services/api-gateway/src/main/java/com/platformops/api_gateway/ApiGatewayApplication.java Adds API gateway Spring Boot entrypoint.
services/api-gateway/src/main/java/com/platformops/api_gateway/SecurityConfig.java Adds WebFlux security with JWT resource-server configuration.
services/api-gateway/src/main/resources/application.yml Configures gateway port, routes to user-service, and resource-server issuer URI.
services/api-gateway/src/test/java/com/platformops/api_gateway/ApiGatewayApplicationTests.java Adds basic context-load test.
services/api-gateway/pom.xml Adds Gateway/WebFlux/Security/Actuator/Prometheus dependencies.
services/api-gateway/Dockerfile Container build for the gateway service.
services/api-gateway/mvnw / mvnw.cmd / .mvn/wrapper/maven-wrapper.properties Maven wrapper scripts/config for the gateway module.
services/api-gateway/.gitignore Module-local ignores for build/IDE artifacts.
services/api-gateway/.gitattributes Line-ending settings for wrapper scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,12 +1,29 @@
server:
port: 8081

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server.port is set to 8081, but the existing container/compose setup still exposes 8080 for user-service (see services/user-service/Dockerfile EXPOSE 8080 and docker-compose.yml mapping 8080:8080). This will make the service unreachable unless those are updated (or revert the port to 8080 and update the gateway accordingly).

Copilot uses AI. Check for mistakes.
endpoints:
web:
exposure:
include: health,info,prometheus

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config exposes the prometheus actuator endpoint, but user-service does not include micrometer-registry-prometheus in its dependencies, so /actuator/prometheus will not be available. Either add the Prometheus registry dependency or remove prometheus from the exposure list to avoid a misleading configuration.

Suggested change
include: health,info,prometheus
include: health,info

Copilot uses AI. Check for mistakes.
show-sql: true

jwt:
secret: ${JWT_SECRET:404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970}

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jwt.secret has a committed default value. Keeping a usable default secret in source control makes it easy to accidentally deploy insecurely. Prefer requiring JWT_SECRET to be set (no default), or load it from a secret store/config tree so the app fails fast when missing.

Suggested change
secret: ${JWT_SECRET:404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970}
secret: ${JWT_SECRET}

Copilot uses AI. Check for mistakes.
Comment thread services/api-gateway/src/main/resources/application.yml Outdated
Comment thread services/api-gateway/src/main/resources/application.yml
…ons and Kafka integration

- Added Maven configuration for order service.
- Implemented main application class for Spring Boot.
- Created OrderController with endpoints for creating and retrieving orders.
- Defined OrderRequest and OrderResponse DTOs for request and response handling.
- Developed Order entity with JPA annotations for database mapping.
- Created OrderRepository interface for data access.
- Implemented OrderService for business logic related to orders.
- Configured application properties for PostgreSQL and Kafka.
- Added unit tests for application context loading.

feat(payment-service): implement payment service with Kafka producer

- Created Dockerfile for payment service.
- Implemented main application logic with Gin framework.
- Developed PaymentHandler for handling payment requests.
- Created Kafka producer for publishing payment events.
- Defined PaymentService for processing payments and emitting events.
- Added model definitions for PaymentRequest and PaymentResponse.

fix(risk-service): update Dockerfile for Python application

- Changed base image to Python 3.11 and configured for Uvicorn server.

feat(user-service): add Redis dependency and update application configuration

- Added Redis starter dependency for user service.
- Updated application properties for PostgreSQL and Redis configuration.
- Refactored JWT security settings for improved clarity.
@anupamavm
anupamavm merged commit a5652cb into main Mar 12, 2026
@anupamavm
anupamavm deleted the api-gateway branch March 12, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants