Skip to content

Add portal backend to farajaland#23

Open
ginaxu1 wants to merge 1 commit intoold-mainfrom
5-add-portal-backend-to-dockerfile
Open

Add portal backend to farajaland#23
ginaxu1 wants to merge 1 commit intoold-mainfrom
5-add-portal-backend-to-dockerfile

Conversation

@ginaxu1
Copy link
Copy Markdown
Contributor

@ginaxu1 ginaxu1 commented Jan 8, 2026

Summary

Added portal-backend service to docker-compose.yml, integrating with the existing NDX infrastructure (PostgreSQL, WSO2 IS, Consent Engine, OE)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Security improvement
  • Configuration improvement

Checklist

  • Code follows project's style guidelines (consistent with other services)
  • Self-review performed
  • Code commented (inline comments for security improvements)
  • Documentation updated (PORTAL_BACKEND_VALIDATION_REPORT.md, ENV_EXAMPLE_TEMPLATE.md)
  • No new warnings generated
  • No merge conflicts

Deployment Notes

Required Actions Before Deployment

  1. Set JWT_SECRET in .env file:

    # Generate strong secret
    JWT_SECRET=$(openssl rand -base64 32)
    echo "JWT_SECRET=$JWT_SECRET" >> .env
  2. Verify Image Availability:

    • Ensure ghcr.io/opendif/opendif-mvp/portals-backend:v0.1.0 is available
    • Or update version tag to match available image
  3. Database Connectivity:

    • Defaults are configured to work out-of-the-box
    • Verify postgres service is running before starting portal-backend

Environment Variables

  • JWT_SECRET - REQUIRED (no default)
  • PORTAL_BACKEND_PORT - Optional (defaults to 8083)
  • Database variables - Optional (defaults match postgres service)

Breaking Changes

None - This is a new service addition, no existing functionality is affected.

Additional Notes

  • The service follows the same patterns as other OpenDIF services (PDP, CE, OE)
  • Security improvements align with best practices for production deployments
  • Database configuration ensures seamless integration with existing Postgres service

@ginaxu1 ginaxu1 marked this pull request as draft January 8, 2026 08:13
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @ginaxu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new portal-backend service into the farajaland environment by updating the docker-compose.yml configuration. This addition is crucial for expanding the system's capabilities, likely enabling new portal-related functionalities and ensuring proper integration with existing services like the database and identity provider.

Highlights

  • New Service Integration: A new portal-backend service has been added to the docker-compose.yml file, integrating it into the existing exchange-network.
  • Service Configuration: The portal-backend service is configured with essential environment variables for database connectivity, identity provider settings, and URLs for other internal services like the Consent Engine, Orchestration Engine, and API Gateway.
  • Dependency Management and Health Check: The portal-backend service is set to depend on postgres and wso2is. A health check has been implemented to monitor its availability. Additionally, the consent-portal service now lists portal-backend as a dependency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ginaxu1 ginaxu1 force-pushed the 5-add-portal-backend-to-dockerfile branch from 2e9e5bc to 1537c65 Compare January 8, 2026 08:14
@ginaxu1
Copy link
Copy Markdown
Contributor Author

ginaxu1 commented Jan 8, 2026

/gemini review

@ginaxu1 ginaxu1 marked this pull request as ready for review January 8, 2026 08:14
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the portal-backend service to the Docker Compose configuration. My review has identified several important issues in the new service's definition. There is a critical issue with the default database connection settings, which are incorrect and will prevent the service from starting correctly. I've also flagged a high-severity security risk due to a hardcoded default JWT secret. Additionally, a medium-severity issue is raised regarding the use of the :latest Docker image tag, which can impact build reproducibility. I have provided specific code suggestions to address these points and improve the security and stability of the service.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the portal-backend service to the docker-compose.yml configuration. The overall structure is consistent with other services in the file. However, I've identified a critical issue with the database configuration that will prevent the new service from starting correctly. I've also included feedback on security and deployment best practices, such as avoiding weak default secrets and pinning Docker image versions instead of using the :latest tag. Please see the detailed comments for suggestions.

- ORCHESTRATION_ENGINE_URL=${ORCHESTRATION_ENGINE_URL:-http://orchestration-engine:4000}
- API_GATEWAY_URL=${API_GATEWAY_URL:-http://api-gateway:9080}
ports:
- "${PORTAL_BACKEND_PORT:-8083}:8083"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should not be directly exposed outside of the exchange-network subnet, instead, we should expose it using the API Gateway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hint: Similar to how consent-engine is exposed. Check init.sh script. lines 389 - 426 in the rancher-desktop-compatibility branch.

depends_on:
- postgres
- wso2is
- portal-backend
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why consent-portal should depend on portal-backend?

@mushrafmim
Copy link
Copy Markdown
Member

For now, let's keep this PR unmerged until portal-backend becomes useful inside the eco system.

@ginaxu1 ginaxu1 added wontfix This will not be worked on and removed wontfix This will not be worked on labels Jan 12, 2026
@ginaxu1 ginaxu1 marked this pull request as draft January 12, 2026 06:22
@mushrafmim mushrafmim marked this pull request as ready for review January 16, 2026 09:03
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