Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
37a538a
Initial commit
rashmithachamikara Mar 5, 2026
d136f06
Add .ai-reference to .gitignore for optional symlinks
rashmithachamikara Mar 5, 2026
82ea4c7
Add environment files to .gitignore
rashmithachamikara Mar 19, 2026
82c2384
Update packages to address 1 high severity vulnerability
rashmithachamikara Mar 19, 2026
6b945fc
Migrate to pnpm
rashmithachamikara Mar 20, 2026
63633a0
Configure Linting and Formatting
rashmithachamikara Mar 20, 2026
33cbf05
Configure testing
rashmithachamikara Mar 20, 2026
60fbfcf
Restructure project to match guidlines
rashmithachamikara Mar 20, 2026
02176c5
Update readme with testing section
rashmithachamikara Mar 20, 2026
12f974c
Update gitignore to exclude coverage report directories
rashmithachamikara Mar 20, 2026
7484262
Improve project structure
rashmithachamikara Mar 20, 2026
6253896
Add copilot instructions
rashmithachamikara Mar 20, 2026
de45c36
Improve copilot instructions
rashmithachamikara Mar 20, 2026
38d1abc
Add additional copilot instruction files
rashmithachamikara Mar 20, 2026
a235ec1
Fix CI script
rashmithachamikara Mar 20, 2026
15265b2
Add localization support with i18next and react-i18next
rashmithachamikara Mar 23, 2026
6d37238
Update readme with project description
rashmithachamikara Mar 23, 2026
5b5438b
Add agents.md instructions to project. Update Readme on agents.md
rashmithachamikara Mar 23, 2026
20a49c6
Install new packages
rashmithachamikara Mar 24, 2026
4a20e1b
Update Vite configuration to include additional inline dependencies
rashmithachamikara Mar 24, 2026
95b7429
Add rule to enforce no extraneous dependencies in ESLint configuration
rashmithachamikara Mar 24, 2026
85087d0
Add router bootstrap and app routes
rashmithachamikara Mar 24, 2026
202b5b7
Add main layout and sidebar components
rashmithachamikara Mar 24, 2026
ecc2ae3
Add consent registry page filters and table
rashmithachamikara Mar 24, 2026
c934a52
Add dashboard page and consent types
rashmithachamikara Mar 24, 2026
413ef56
Add UI translation strings for layout and consent registry
rashmithachamikara Mar 24, 2026
2b68d63
Add tests for sidebar and consent registry page
rashmithachamikara Mar 24, 2026
0046329
Refactor sx to Box since AppShell.Main doesn’t support sx
rashmithachamikara Mar 24, 2026
670a6d6
Update filter tab styling
rashmithachamikara Mar 24, 2026
83e0c78
Refactor ConsentRegistryFilters layout for improved responsiveness an…
rashmithachamikara Mar 24, 2026
c5fcbc3
Remove additional breadcrumb
rashmithachamikara Mar 24, 2026
9f740f4
Update breadcrumb system
rashmithachamikara Mar 24, 2026
7b4eaa7
Remove unused translation entries
rashmithachamikara Mar 24, 2026
1c50c38
Sync consent filters with URL query params
rashmithachamikara Mar 24, 2026
6abe145
Add Pending Consents sidebar route shortcut
rashmithachamikara Mar 24, 2026
4365f21
Add sidebar group for consents
rashmithachamikara Mar 25, 2026
6636b6a
Fix breadcrumbs alignment
rashmithachamikara Mar 25, 2026
e986f9a
Move breadcrumbs to page
rashmithachamikara Mar 25, 2026
1395919
Include i18n Internationalization instructions in Agents files
rashmithachamikara Mar 25, 2026
f434c36
Format improvements
rashmithachamikara Mar 26, 2026
34adb44
Create consent details page
rashmithachamikara Mar 26, 2026
5103184
Update breadcrumbs for consent details page
rashmithachamikara Mar 26, 2026
cf83680
Reduce icon size
rashmithachamikara Mar 26, 2026
5f8440c
Minor spacing improvement
rashmithachamikara Mar 26, 2026
201f44f
Link consent details button to consent registry
rashmithachamikara Mar 26, 2026
3c97de6
Minor UI improvements
rashmithachamikara Mar 26, 2026
7c906fd
Minor UI improvements
rashmithachamikara Mar 26, 2026
d5d7661
Minor UI improvements
rashmithachamikara Mar 26, 2026
960c92d
Minor UI improvements
rashmithachamikara Mar 26, 2026
512adae
Minor UI improvements
rashmithachamikara Mar 26, 2026
5e7c6bd
Import openfgc-portal into portal/frontend with full history
rashmithachamikara Mar 30, 2026
736a506
Squashed commit of the following:
rashmithachamikara Apr 3, 2026
2f7f38a
add bff backend scaffold
rashmithachamikara Apr 5, 2026
afc71de
add backend tooling and documentation
rashmithachamikara Apr 5, 2026
6153d39
add backend ci workflow
rashmithachamikara Apr 5, 2026
4ef2ff9
Move copilot instructions to monorepo root
rashmithachamikara Apr 6, 2026
67daaef
Refine BFF endpoint structure plan
rashmithachamikara Apr 6, 2026
298373f
Refine BFF endpoint structure plan
rashmithachamikara Apr 7, 2026
0f42d75
Add BFF proxy routes and forwarding service
rashmithachamikara Apr 7, 2026
6b84934
Add proxy and configuration test coverage
rashmithachamikara Apr 7, 2026
006d0d2
Update BFF contract and developer run configuration
rashmithachamikara Apr 7, 2026
afb1817
Rename test
rashmithachamikara Apr 7, 2026
c6e6141
portal-backend: add configurable credentialed CORS
rashmithachamikara Apr 7, 2026
8e5ea8f
portal-frontend: add fetch and react-query data layer
rashmithachamikara Apr 7, 2026
5a5e7a7
portal-frontend: wire consent screens to BFF
rashmithachamikara Apr 7, 2026
8606ed5
Add mock lifecycle section back
rashmithachamikara Apr 8, 2026
7310024
Update Agents.md with test file naming convention
rashmithachamikara Apr 9, 2026
9796abf
Add modals
rashmithachamikara Apr 9, 2026
dcc66eb
Integrate modals into pages
rashmithachamikara Apr 9, 2026
a330ee8
Add test for modals
rashmithachamikara Apr 9, 2026
5f118a8
Implement consent aggregation and metadata enrichment for consent ret…
rashmithachamikara Apr 9, 2026
a4751ce
Implement consent approval flow with optional selections and update r…
rashmithachamikara Apr 17, 2026
8ad79b1
Remove literal file named BFF_CONFIG_FILE from gitignore
rashmithachamikara Apr 20, 2026
cdb9135
Fix: Calling os.Exit(1) inside the goroutine
rashmithachamikara Apr 20, 2026
53273f6
Fix: Run the runtime container as a non-root user.
rashmithachamikara Apr 20, 2026
cc54e9a
Fix: Update docker-compose to load local environment overrides from .…
rashmithachamikara Apr 20, 2026
1274af2
Add unit tests for the logger package
rashmithachamikara Apr 20, 2026
aa8dc44
Fix: Enhance correlation ID validation and add unit tests for middleware
rashmithachamikara Apr 20, 2026
0fbe95f
Fix: Update golangci-lint versioning in Taskfile to use variable for …
rashmithachamikara Apr 20, 2026
f71319c
Move CI workflows for portal backend and frontend to correct director…
rashmithachamikara Apr 20, 2026
b74e472
Fix: Rename CI job identifiers for portal backend and frontend workfl…
rashmithachamikara Apr 20, 2026
405df98
Fix: Update workflow paths in portal backend CI configuration
rashmithachamikara Apr 20, 2026
9baeb49
Fix: Add an explicit error-path test for failed consent fetch
rashmithachamikara Apr 20, 2026
17eb446
Fix: Add a fallback-path assertion for i18n behavior
rashmithachamikara Apr 20, 2026
4a2e1e9
Fix: Use neutral root-container styles for app-shell layouts.
rashmithachamikara Apr 20, 2026
013d7ff
Fix: Edge case: epochInSeconds=0 returns '-' instead of valid date.
rashmithachamikara Apr 20, 2026
fb7dc71
Test: Add unit tests for date formatting utilities
rashmithachamikara Apr 20, 2026
67944d1
Fix: Externalize brand title string to i18n resources
rashmithachamikara Apr 20, 2026
4718efd
Add WSO2 logo to the header with updated dimensions and styling
rashmithachamikara Apr 20, 2026
bf74e00
Add favicon support with multiple sizes and web manifest
rashmithachamikara Apr 20, 2026
0750270
Fix: Date parsing doesn't handle invalid input gracefully.
rashmithachamikara Apr 21, 2026
224db29
Fix: Type assertion undefined as T may cause runtime issues.
rashmithachamikara Apr 21, 2026
00dc33d
Fix: Update version number from 0.0.0 to 0.0.1 in package.json
rashmithachamikara Apr 21, 2026
176510b
Refactor UserID derivation into middleware for placeholder-based user…
rashmithachamikara Apr 21, 2026
4c8ebba
Fix: Inconsistent error handling for response body read failure.
rashmithachamikara Apr 21, 2026
35b258e
Fix: Add type definition for value property
rashmithachamikara Apr 21, 2026
0b8fab3
Fix: Fragile query parameter ordering assertion. Update expected erro…
rashmithachamikara Apr 21, 2026
bf0873b
Fix: Empty state message renders alongside the table when rows are empty
rashmithachamikara Apr 21, 2026
49cc71a
Fix: Potential nil-map panic when request body is JSON null
rashmithachamikara Apr 21, 2026
3d31910
Fix: Switch aria-label is not unique per toggle
rashmithachamikara Apr 21, 2026
a7ffca8
Refactor: Introduce getConsentStatusChipColor utility for consistent …
rashmithachamikara Apr 21, 2026
0bc7bd2
Refactor status color mapping logic and improve text labels for statuses
rashmithachamikara Apr 21, 2026
b24490f
Fix: Add missing REJECTED status
rashmithachamikara Apr 21, 2026
fda738b
Fix: Avoid collapsing all fallback requests into one correlation ID
rashmithachamikara Apr 21, 2026
322e7e8
Fix: Typos and Clarity
rashmithachamikara Apr 21, 2026
e51b711
Test: Add unit tests for MainLayout component
rashmithachamikara Apr 21, 2026
181b15e
Fix: Avoid duplicate brand announcement for screen readers.
rashmithachamikara Apr 21, 2026
3b49aa7
Fix: Externalize hardcoded user-facing strings to i18n resources
rashmithachamikara Apr 21, 2026
5088ea9
Remove unnencessary comments from authroizations
rashmithachamikara Apr 21, 2026
423db16
Add authorization modal
rashmithachamikara Apr 21, 2026
663bb00
Update mock timestamps in ConsentDetailsPage.tsx lifecycle table to i…
rashmithachamikara Apr 21, 2026
7832ab9
Fix: Update revocation messages for clarity and consistency
rashmithachamikara Apr 22, 2026
974716c
Add tooltip for button when no resources are available in ConsentDeta…
rashmithachamikara Apr 22, 2026
85d4eae
Fix: Update test for revocation modal
rashmithachamikara Apr 22, 2026
6d55ab5
Fix: Adjust CI workflow triggers for pull requests and pushes
rashmithachamikara Apr 22, 2026
f57f75f
Fix: Fixed unused-parameter issue by linter
rashmithachamikara Apr 22, 2026
85e4f23
Update consent table. Remove consent id and created date column. Make…
rashmithachamikara Apr 22, 2026
dde4d72
Improve consent purpose display
rashmithachamikara Apr 22, 2026
a7dc3c7
Improve consent purpose popover
rashmithachamikara Apr 22, 2026
d6e0609
Refactor consent status handling and improve status normalization fun…
rashmithachamikara Apr 22, 2026
a85b4b5
Improve consent elements table layout and truncate element names for …
rashmithachamikara Apr 23, 2026
556fde5
Refactor column widths in ConsentRegistryTable for improved layout co…
rashmithachamikara Apr 23, 2026
b4816ba
Enhance ConsentDetailsPage with additional formatting, omitting and t…
rashmithachamikara Apr 23, 2026
20294c6
Update title
rashmithachamikara Apr 23, 2026
8bfb208
Fix: Validate the upstream URL before constructing the service.
rashmithachamikara Apr 24, 2026
e5a964b
Fix: Skip Content-Length in header copying; remove manual header blan…
rashmithachamikara Apr 24, 2026
1ec7ae9
Fix: Handle headers listed in the Connection header when forwarding r…
rashmithachamikara Apr 24, 2026
264a702
Fix: Specify the language for the project-structure fence.
rashmithachamikara Apr 24, 2026
9e2c774
Fix: Inconsistent handling of validityTime === 0 vs the registry table.
rashmithachamikara Apr 24, 2026
10f8510
Fix: Normalize HeadersInit before merging default headers.
rashmithachamikara Apr 24, 2026
69519ba
Remove unused images
rashmithachamikara Apr 24, 2026
126a76b
Improve portal/backend pord script to add .exe extenion on windows
rashmithachamikara Apr 24, 2026
1fcb82b
Remove AGENTS.md files and copilot instructions files
rashmithachamikara Apr 24, 2026
8dbcb57
Add license headers
rashmithachamikara Apr 25, 2026
4ca4246
Several UI enhancements
rashmithachamikara Apr 27, 2026
c3b2d31
Add skeletons for loading
rashmithachamikara Apr 27, 2026
33541a4
Reduce consent details cache TTL
rashmithachamikara Apr 27, 2026
f941da5
Add tooltips for table action buttons. Minor UI enhancements
rashmithachamikara Apr 28, 2026
d1bfbdb
Fix: Navigation to pending consent page keeps the current page of all…
rashmithachamikara Apr 29, 2026
e6b397f
Enhance header handling: Add TE header to canonical set and update te…
rashmithachamikara May 12, 2026
b300a06
Refactor: Unify header handling in writeUpstreamResponse and add test…
rashmithachamikara May 12, 2026
b83abbb
Fix: Pin golangci-lint version to v1.64.8 for consistency in CI
rashmithachamikara May 12, 2026
926c964
Fix: Enhance API method handling to return 404 for unknown paths with…
rashmithachamikara May 12, 2026
e2606b2
Add .env.example and update configuration to require VITE_API_BASE_URL
rashmithachamikara May 12, 2026
3f52cb9
Fix: Add VITE_API_BASE_URL environment variable to portal frontend CI…
rashmithachamikara May 12, 2026
159187c
Add phased implementation plan for BFF architecture
rashmithachamikara May 12, 2026
e89c220
Remove frontend changes from backend PR
rashmithachamikara May 12, 2026
9b4f183
Fix: Add an explicit non-root USER in the runtime stage
rashmithachamikara May 12, 2026
2fc2496
Apply multiple fixes
rashmithachamikara May 12, 2026
497753a
Merge branch 'feature/portal-backend' of https://github.com/rashmitha…
rashmithachamikara May 12, 2026
b4e49ba
Remove frontend changes from backend PR
rashmithachamikara May 12, 2026
4a16a9c
Fix: Copilot suggested fixes
rashmithachamikara May 18, 2026
1342587
Fix: Copilot suggested fixes
rashmithachamikara May 19, 2026
4bb59f5
Fix: Copilot suggested fixes
rashmithachamikara May 19, 2026
b1a788b
Add proxy URL path joining logic and add test for base path preservation
rashmithachamikara May 19, 2026
730c8c2
Fix: Validation rejects all placeholder trusted-header values when pl…
rashmithachamikara May 19, 2026
c5e8aaf
Fix: Copilot suggested fixes
rashmithachamikara May 19, 2026
a8efad3
Fix: Buffered upstream responses now have a configurable max size
rashmithachamikara May 19, 2026
a0f04e7
Fix: Copilot suggested fixes
rashmithachamikara May 19, 2026
fbe1d39
Fix multiple issues
rashmithachamikara Jul 2, 2026
88a73c1
Add UUID validation for `consentId`
rashmithachamikara Jul 2, 2026
67c2789
Refactor to match the consent-server
rashmithachamikara Jul 3, 2026
051dc0f
Refactor tests
rashmithachamikara Jul 3, 2026
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
44 changes: 44 additions & 0 deletions .github/workflows/portal-backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Portal Backend CI

on:
pull_request:
paths:
- 'portal/backend/**'
- '.github/workflows/portal-backend-ci.yml'
push:
branches: [ main ]
paths:
- 'portal/backend/**'
- '.github/workflows/portal-backend-ci.yml'

jobs:
portal-backend-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: portal/backend

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: portal/backend/go.mod

- name: Download deps
run: go mod download

- name: Format check
run: |
test -z "$(gofmt -l . | tee /dev/stderr)"

- name: golangci-lint
Comment thread
rashmithachamikara marked this conversation as resolved.
uses: golangci/golangci-lint-action@v9
with:
working-directory: portal/backend
version: v2.12.2

- name: Run tests
run: go test ./... -v
35 changes: 35 additions & 0 deletions portal/backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Optional config file path. If unset, defaults are used and env overrides apply.
BFF_CONFIG_FILE=

# Server
BFF_SERVER__HOST=0.0.0.0
BFF_SERVER__PORT=8080
BFF_SERVER__READ_TIMEOUT=15s
BFF_SERVER__WRITE_TIMEOUT=15s
BFF_SERVER__IDLE_TIMEOUT=60s
BFF_SERVER__SHUTDOWN_TIMEOUT=10s

# Logging
BFF_LOG__LEVEL=info

# Environment
BFF_ENV=development

# CORS (frontend integration)
BFF_CORS__ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
BFF_CORS__ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
BFF_CORS__ALLOWED_HEADERS=Content-Type,X-Correlation-ID
BFF_CORS__ALLOW_CREDENTIALS=false

# Proxy
BFF_PROXY__OPENFGC_API_URL=http://localhost:9090
BFF_PROXY__OPENFGC_API_TIMEOUT=10s
BFF_PROXY__MAX_REQUEST_BYTES=1048576
BFF_PROXY__MAX_RESPONSE_BYTES=10485760
BFF_PROXY__ALLOWED_PASSTHROUGH_METHODS=["GET","POST","PUT","DELETE"]

# Placeholder identity mode (Phase 2 only; must be false in production)
BFF_PROXY__PLACEHOLDER_MODE_ENABLED=false
BFF_PROXY__PLACEHOLDER_USER_ID=
BFF_PROXY__PLACEHOLDER_ORG_ID=
BFF_PROXY__PLACEHOLDER_CLIENT_ID=
28 changes: 28 additions & 0 deletions portal/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Go build outputs
bin/
*.exe
*.dll
*.so
*.dylib
*.test
*.out

# Coverage outputs
coverage.out
coverage.txt
*.cov

# Local environment/config files
.env
.env.local
local.yaml
local.yml

# IDE/editor files
.vscode/
.idea/
*.swp

# OS files
.DS_Store
Thumbs.db
15 changes: 15 additions & 0 deletions portal/backend/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "2"

run:
timeout: 3m
tests: true

linters:
enable:
- govet
- staticcheck
- revive

formatters:
enable:
- gofmt
11 changes: 11 additions & 0 deletions portal/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.26.3 AS builder
WORKDIR /app
COPY . .
RUN go mod download && go build -o /out/bff ./cmd/server

FROM gcr.io/distroless/base-debian12:nonroot
WORKDIR /app
COPY --from=builder /out/bff /app/bff
USER 65532:65532
EXPOSE 8080
ENTRYPOINT ["/app/bff"]
Comment thread
rashmithachamikara marked this conversation as resolved.
110 changes: 110 additions & 0 deletions portal/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!--
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->

# OpenFGC Portal Backend (BFF)

Stateless backend-for-frontend (BFF) for OpenFGC Portal, responsible for handling portal-facing authentication flows and securely proxying API requests from `portal/frontend` to `/consent-server`.
Comment thread
rashmithachamikara marked this conversation as resolved.

## Commands

- `task fmt`
- `task fmt:check` (no edits. check only)
- `task lint`
- `task lint:install` (optional, installs golangci-lint to GOPATH/bin)
- `task test`
- `task build`
- `task run`
- `task run:env` (loads variables from `.env` for local development)

Install Task if needed: https://taskfile.dev/installation/

## Configuration

- Primary source: `BFF_` environment variables
- Optional file overlay: set `BFF_CONFIG_FILE` to a YAML config file path
- Final effective config is: defaults < file < env

### CORS for local frontend

When running `portal/frontend` on a different origin (for example Vite dev server), allow that origin with:

- `BFF_CORS__ALLOWED_ORIGINS` (comma-separated origins)
- `BFF_CORS__ALLOWED_METHODS` (comma-separated methods)
- `BFF_CORS__ALLOWED_HEADERS` (comma-separated request headers)
- `BFF_CORS__ALLOW_CREDENTIALS` (`true`/`false`)

Requests that include an `Origin` header from a non-allowlisted origin are rejected.
When credentials are enabled, origins must be explicitly allowlisted (wildcard origin is rejected).

## Health endpoints

- `GET /health`
- `GET /health/liveness`
- `GET /health/readiness`

## API endpoints

Portal-facing user endpoints:

- `GET /me/consents` -> upstream `GET /api/v1/consents` with forced `userIds=<placeholder>`
- `GET /me/consents/{consentId}` -> upstream `GET /api/v1/consents/{consentId}`
- `POST /me/consents/{consentId}/approve` -> BFF fetches current consent, merges selected optional approvals, uses the consent's `clientId` as the trusted upstream `TPP-client-id`, updates an existing authorization to approved for the trusted user (or creates one if none exist), and upstreams `PUT /api/v1/consents/{consentId}`
- `PUT /me/consents/{consentId}/revoke` -> upstream `PUT /api/v1/consents/{consentId}/revoke`

Proxy hardening:

- Path rewrite `/api/*` -> `/api/v1/*` with query preservation
- Deny-by-default allowlist for consent-server routes (unknown path -> `404`, known path wrong method -> `405`)
- Hop-by-hop header stripping and trusted-header override prevention (`org-id`, `TPP-client-id`)
- Correlation ID propagation/generation via `X-Correlation-ID`
- Request body limit enforcement (`BFF_PROXY__MAX_REQUEST_BYTES`) with `413`
- Deterministic upstream error mapping: timeout -> `504`, other connectivity failures -> `502`

Error contract for proxy-originated failures:

```json
{
"code": "REQUEST_TOO_LARGE",
"message": "request entity too large"
}
```

Common error codes:

- `REQUEST_TOO_LARGE`
- `METHOD_NOT_ALLOWED`
- `NOT_FOUND`
- `INVALID_PAYLOAD`
- `UPSTREAM_TIMEOUT`
- `UPSTREAM_UNAVAILABLE`

## Placeholder mode guardrails

- `BFF_PROXY__PLACEHOLDER_MODE_ENABLED=true` is blocked when `BFF_ENV=production`
- `BFF_PROXY__PLACEHOLDER_USER_ID` must be empty if placeholder mode is disabled

## AI Instructions

This repository uses VS Code Copilot instruction files to keep AI-generated changes aligned with project and organization standards.

- Backend standards: `portal/backend/AGENTS.md`
- Copilot workspace entrypoint (repo root): `.github/copilot-instructions.md`
- Scoped instructions folder (repo root): `.github/instructions/`
- Backend scope mapping: `portal/backend/**` -> `.github/instructions/portal-backend.instructions.md`

Copilot instructions are discovered automatically and scoped using `applyTo` patterns.
47 changes: 47 additions & 0 deletions portal/backend/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'

vars:
GOLANGCI_LINT_VERSION: v2.12.2

tasks:
fmt:
desc: Format Go source files
cmds:
- gofmt -w cmd internal tests

fmt:check:
desc: Check formatting without modifying files
cmds:
- gofmt -l cmd internal tests
Comment thread
rashmithachamikara marked this conversation as resolved.

lint:
desc: Run golangci-lint (no global install required)
cmds:
- go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} run ./...

lint:install:
desc: Install golangci-lint to GOPATH/bin (optional)
cmds:
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}}

test:
desc: Run all tests
cmds:
- go test ./... -v

build:
desc: Build the BFF binary
cmds:
- go build -o bin/portal-backend{{if eq OS "windows"}}.exe{{end}} ./cmd/server

run:
desc: Run the BFF server
cmds:
- go run ./cmd/server

run:env:
desc: Run the BFF server with variables loaded from .env
dotenv:
- .env
cmds:
- go run ./cmd/server
Loading
Loading